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
5031c46ec40984d57fd0e4a1e53dc3490603b2ae
test/PCH/asm.c
test/PCH/asm.c
// Test this without pch. // RUN: clang-cc -include %S/asm.h -fsyntax-only -verify %s && // Test with pch. // RUN: clang-cc -emit-pch -o %t %S/asm.h && // RUN: clang-cc -include-pch %t -fsyntax-only -verify %s void call_f(void) { f(); } void call_clobbers(void) { clobbers(); }
// Test this without pch. // RUN: clang-cc -triple i386-unknown-unknown -include %S/asm.h -fsyntax-only -verify %s && // Test with pch. // RUN: clang-cc -triple i386-unknown-unknown -emit-pch -o %t %S/asm.h && // RUN: clang-cc -triple i386-unknown-unknown -include-pch %t -fsyntax-only -verify %s void call_f(void) { f(); } void call_clobbers(void) { clobbers(); }
Make this test portable to non-x86 hosts, patch by Mark Cianciosa!
Make this test portable to non-x86 hosts, patch by Mark Cianciosa! git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@71146 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
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,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
3624f96f852e276f9fc7731b9c43a9de42dd8983
test/helpers-Server.c
test/helpers-Server.c
#include <stdio.h> #include <stdlib.h> #include <inttypes.h> #include "Server.h" char char_of_uint8(uint8_t x) { return (char) x; } uint32_t bufstrcpy(char *dst, const char *src) { /* The F* precondition guarantees that src is zero-terminated */ return sprintf(dst, "%s", src); } uint32_t print_u32(char *dst, uint32_t i) { return sprintf(dst, "%"PRIu32, i); }
#include <stdio.h> #include <stdlib.h> #include <inttypes.h> #include "Server.h" uint32_t bufstrcpy(char *dst, const char *src) { /* The F* precondition guarantees that src is zero-terminated */ return sprintf(dst, "%s", src); } uint32_t print_u32(char *dst, uint32_t i) { return sprintf(dst, "%"PRIu32, i); }
Remove function now implemented in kremlib
Remove function now implemented in kremlib
C
apache-2.0
FStarLang/kremlin,FStarLang/kremlin,FStarLang/kremlin,FStarLang/kremlin
fc066825e6f076f54e3a08f6c498eb49a64aff50
projects/com.oracle.truffle.llvm.test/tests/c/attributes/visibility/visibility1.c
projects/com.oracle.truffle.llvm.test/tests/c/attributes/visibility/visibility1.c
#include<stdlib.h> volatile int i1 __attribute__ ((visibility ("protected"))); volatile int i2 __attribute__ ((visibility ("default"))); volatile int i3 __attribute__ ((visibility ("hidden"))); volatile int i4 __attribute__ ((visibility ("protected"))); volatile int i5 __attribute__ ((visibility ("internal"))); int main() { i1 = 542; i2 = 2341; i3 = 1; i4 = 4534; i5 = 12312; if (i1 != 542) { abort(); } if (i2 != 2341) { abort(); } if (i3 != 1) { abort(); } if (i4 != 4534) { abort(); } if (i5 != 12312) { abort(); } }
Add test case for visibility attributes
Add test case for visibility attributes
C
bsd-3-clause
grimmerm/sulong,lxp/sulong,crbb/sulong,lxp/sulong,PrinzKatharina/sulong,PrinzKatharina/sulong,PrinzKatharina/sulong,crbb/sulong,PrinzKatharina/sulong,crbb/sulong,grimmerm/sulong,crbb/sulong,lxp/sulong,grimmerm/sulong,lxp/sulong,grimmerm/sulong
82b3f8023289175cf756187ab35318066715f430
src/modules/conf_theme/e_int_config_theme.h
src/modules/conf_theme/e_int_config_theme.h
/* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ #ifdef E_TYPEDEFS #else #ifndef E_INT_CONFIG_THEME_H #define E_INT_CONFIG_THEME_H EAPI E_Config_Dialog *e_int_config_theme(E_Container *con, const char *params __UNUSED__); EAPI void e_int_config_theme_import_done(E_Config_Dialog *dia); EAPI void e_int_config_theme_update(E_Config_Dialog *dia, char *file); #endif #endif
/* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ #ifdef E_TYPEDEFS #else #ifndef E_INT_CONFIG_THEME_H #define E_INT_CONFIG_THEME_H EAPI E_Config_Dialog *e_int_config_theme(E_Container *con, const char *params __UNUSED__); EAPI void e_int_config_theme_import_done(E_Config_Dialog *dia); EAPI void e_int_config_theme_update(E_Config_Dialog *dia, char *file); EAPI void e_int_config_theme_web_done(E_Config_Dialog *dia); #endif #endif
Declare public function in header.
Declare public function in header. git-svn-id: 0f3f1c46c6da7ffd142db61e503a7ff63af3a195@35475 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
C
bsd-2-clause
jordemort/e17,jordemort/e17,jordemort/e17
f755ecfb8cec7b19dff84295309f2afb24a5afd1
arch/powerpc/platforms/pseries/of_helpers.c
arch/powerpc/platforms/pseries/of_helpers.c
#include <linux/string.h> #include <linux/err.h> #include <linux/slab.h> #include <linux/of.h> #include "of_helpers.h" /** * pseries_of_derive_parent - basically like dirname(1) * @path: the full_name of a node to be added to the tree * * Returns the node which should be the parent of the node * described by path. E.g., for path = "/foo/bar", returns * the node with full_name = "/foo". */ struct device_node *pseries_of_derive_parent(const char *path) { struct device_node *parent; char *parent_path = "/"; const char *tail = kbasename(path); /* reject if path is "/" */ if (!strcmp(path, "/")) return ERR_PTR(-EINVAL); if (tail > path + 1) { parent_path = kstrndup(path, tail - path, GFP_KERNEL); if (!parent_path) return ERR_PTR(-ENOMEM); } parent = of_find_node_by_path(parent_path); if (strcmp(parent_path, "/")) kfree(parent_path); return parent ? parent : ERR_PTR(-EINVAL); }
#include <linux/string.h> #include <linux/err.h> #include <linux/slab.h> #include <linux/of.h> #include "of_helpers.h" /** * pseries_of_derive_parent - basically like dirname(1) * @path: the full_name of a node to be added to the tree * * Returns the node which should be the parent of the node * described by path. E.g., for path = "/foo/bar", returns * the node with full_name = "/foo". */ struct device_node *pseries_of_derive_parent(const char *path) { struct device_node *parent; char *parent_path = "/"; const char *tail; /* We do not want the trailing '/' character */ tail = kbasename(path) - 1; /* reject if path is "/" */ if (!strcmp(path, "/")) return ERR_PTR(-EINVAL); if (tail > path) { parent_path = kstrndup(path, tail - path, GFP_KERNEL); if (!parent_path) return ERR_PTR(-ENOMEM); } parent = of_find_node_by_path(parent_path); if (strcmp(parent_path, "/")) kfree(parent_path); return parent ? parent : ERR_PTR(-EINVAL); }
Correct string length in pseries_of_derive_parent()
powerpc/pseries: Correct string length in pseries_of_derive_parent() Commit a030e1e4bbd085bbcfd0a23f8d355fcd41f39bed make a change to use kstrndup() instead of kmalloc() + strlcpy() in the pseries_of_derive_parent() routine that introduces a subtle change in the parent path name generated. The kstrndup() routine will copy n characters followed by a terminating null, whereas strlcpy() will copy n-1 characters and add a terminating null. This slight difference results in having a parent path that includes the tailing '/' character, "/cpus/" vs. "/cpus". This then causes the subsequent call to of_find_node_by_path() to fail, and in the case of DLPAR add operations the DLPAR request fails. This patch decrements the pointer returned from kbasename() to point to the '/' character before the base name instead of the base name. This then adjusts the string length calculations to not include the trailing '/' in the parent path name. Signed-off-by: Nathan Fontenot <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
C
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
3151c3c004a5edac53a35a9a017cd7b9229cc85b
runtime/runtime_vars.c
runtime/runtime_vars.c
#include "gc.h" #include "runtime_vars.h" #include "scheduler.h" GC_Env* __get_GC_Env() { #ifdef MULTITHREAD return get_currentthread()->gcEnv; #else return currentthread->gcEnv; #endif }
#include "gc.h" #include "runtime_vars.h" #include "scheduler.h" GC_Env* __get_GC_Env() { #ifdef MULTITHREAD return get_currentthread()->gcEnv; #else return currentthread->gcEnv; #endif } ThreadData* __mellow_get_cur_green_thread() { #ifdef MULTITHREAD return get_currentthread(); #else return currentthread; #endif }
Add function to get current green thread at-will
Add function to get current green thread at-will
C
mit
Mellow-Programming-Language/Mellow,Mellow-Programming-Language/Mellow,Mellow-Programming-Language/Mellow
54fcf270dee6ed9d27e23b94129788b758df1e6b
include/uapi/linux/cifs/cifs_mount.h
include/uapi/linux/cifs/cifs_mount.h
/* * include/uapi/linux/cifs/cifs_mount.h * * Author(s): Scott Lovenberg ([email protected]) * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU Lesser General Public License for more details. */ #ifndef _CIFS_MOUNT_H #define _CIFS_MOUNT_H /* Max string lengths for cifs mounting options. */ #define CIFS_MAX_DOMAINNAME_LEN 256 /* max fully qualified domain name */ #define CIFS_MAX_USERNAME_LEN 256 /* reasonable max for current servers */ #define CIFS_MAX_PASSWORD_LEN 512 /* Windows max seems to be 256 wide chars */ #define CIFS_MAX_SHARE_LEN 80 #endif /* _CIFS_MOUNT_H */
/* * include/uapi/linux/cifs/cifs_mount.h * * Author(s): Scott Lovenberg ([email protected]) * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU Lesser General Public License for more details. */ #ifndef _CIFS_MOUNT_H #define _CIFS_MOUNT_H /* Max string lengths for cifs mounting options. */ #define CIFS_MAX_DOMAINNAME_LEN 256 /* max fully qualified domain name */ #define CIFS_MAX_USERNAME_LEN 256 /* reasonable max for current servers */ #define CIFS_MAX_PASSWORD_LEN 512 /* Windows max seems to be 256 wide chars */ #define CIFS_MAX_SHARE_LEN 256 /* reasonable max share name length */ #endif /* _CIFS_MOUNT_H */
Expand max share name length to 256
cifs: Expand max share name length to 256 The old max share name length limit was 80 due to Windows NET SHARE command not allowing more than that. However, share names can be much longer. This is a more reasonable maximum share name length. Signed-off-by: Scott Lovenberg <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Steve French <[email protected]>
C
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
13f68420e7b441d5364055f2cc50f14e7b547f76
vp8/common/opencl/idctllm_cl.h
vp8/common/opencl/idctllm_cl.h
/* * Copyright (c) 2010 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. */ #include "vp8_opencl.h" #define CLAMP(x,min,max) if (x < min) x = min; else if ( x > max ) x = max; const char *idctCompileOptions = "-Ivp8/common/opencl"; const char *idctllm_cl_file_name = "vp8/common/opencl/idctllm_cl.cl";
/* * Copyright (c) 2010 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. */ #include "vp8_opencl.h" #define CLAMP(x,min,max) if (x < min) x = min; else if ( x > max ) x = max; //External functions that are fallbacks if CL is unavailable void vp8_short_idct4x4llm_c(short *input, short *output, int pitch); void vp8_short_idct4x4llm_1_c(short *input, short *output, int pitch); void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred_ptr, unsigned char *dst_ptr, int pitch, int stride); void vp8_short_inv_walsh4x4_c(short *input, short *output); void vp8_short_inv_walsh4x4_1_c(short *input, short *output); const char *idctCompileOptions = "-Ivp8/common/opencl"; const char *idctllm_cl_file_name = "vp8/common/opencl/idctllm_cl.cl";
Declare C fallbacks in IDCT header.
Declare C fallbacks in IDCT header.
C
bsd-3-clause
awatry/libvpx.opencl,awatry/libvpx.opencl,awatry/libvpx.opencl,awatry/libvpx.opencl
1475e4c1f1ae295038b97cbb8cdcdd42e9e27cf1
common/network/packet_type.h
common/network/packet_type.h
#ifndef __PACKET_TYPE_H__ #define __PACKET_TYPE_H__ enum PacketType { INVALID, USER, SHARED_MEM_REQ, SHARED_MEM_EVICT, SHARED_MEM_RESPONSE, SHARED_MEM_UPDATE_UNEXPECTED, SHARED_MEM_ACK, SHARED_MEM_TERMINATE_THREADS, MCP_REQUEST_TYPE, MCP_RESPONSE_TYPE, MCP_UTILIZATION_UPDATE_TYPE, NUM_PACKET_TYPES }; // This defines the different static network types enum EStaticNetwork { STATIC_NETWORK_USER, STATIC_NETWORK_MEMORY, STATIC_NETWORK_SYSTEM, NUM_STATIC_NETWORKS }; // Packets are routed to a static network based on their type. This // gives the static network to use for a given packet type. static EStaticNetwork g_type_to_static_network_map[] __attribute__((unused)) = { STATIC_NETWORK_SYSTEM, // INVALID STATIC_NETWORK_USER, // USER STATIC_NETWORK_MEMORY, // SM_REQ STATIC_NETWORK_MEMORY, // SM_EVICT STATIC_NETWORK_MEMORY, // SM_RESPONSE STATIC_NETWORK_MEMORY, // SM_UPDATE_UNEXPECTED STATIC_NETWORK_MEMORY, // SM_ACK STATIC_NETWORK_MEMORY, // SM_TERMINATE_THREADS STATIC_NETWORK_SYSTEM, // MCP_REQ STATIC_NETWORK_SYSTEM, // MCP_RESP STATIC_NETWORK_SYSTEM, // MCP_UTIL }; #endif
#ifndef __PACKET_TYPE_H__ #define __PACKET_TYPE_H__ enum PacketType { INVALID, USER, SHARED_MEM_REQ, SHARED_MEM_EVICT, SHARED_MEM_RESPONSE, SHARED_MEM_UPDATE_UNEXPECTED, SHARED_MEM_ACK, SHARED_MEM_TERMINATE_THREADS, MCP_REQUEST_TYPE, MCP_RESPONSE_TYPE, MCP_UTILIZATION_UPDATE_TYPE, MCP_SYSTEM_TYPE, NUM_PACKET_TYPES }; // This defines the different static network types enum EStaticNetwork { STATIC_NETWORK_USER, STATIC_NETWORK_MEMORY, STATIC_NETWORK_SYSTEM, NUM_STATIC_NETWORKS }; // Packets are routed to a static network based on their type. This // gives the static network to use for a given packet type. static EStaticNetwork g_type_to_static_network_map[] __attribute__((unused)) = { STATIC_NETWORK_SYSTEM, // INVALID STATIC_NETWORK_USER, // USER STATIC_NETWORK_MEMORY, // SM_REQ STATIC_NETWORK_MEMORY, // SM_EVICT STATIC_NETWORK_MEMORY, // SM_RESPONSE STATIC_NETWORK_MEMORY, // SM_UPDATE_UNEXPECTED STATIC_NETWORK_MEMORY, // SM_ACK STATIC_NETWORK_MEMORY, // SM_TERMINATE_THREADS STATIC_NETWORK_USER, // MCP_REQ STATIC_NETWORK_USER, // MCP_RESP STATIC_NETWORK_SYSTEM, // MCP_UTIL STATIC_NETWORK_SYSTEM, // MCP_SYSTEM }; #endif
Expand MCP messages to have user (modeled) and system (magic) types.
[network] Expand MCP messages to have user (modeled) and system (magic) types.
C
mit
8l/Graphite,8l/Graphite,mit-carbon/Graphite-Cycle-Level,8l/Graphite,mit-carbon/Graphite,nkawahara/Graphite,mit-carbon/Graphite,fhijaz/Graphite,nkawahara/Graphite,mit-carbon/Graphite-Cycle-Level,mit-carbon/Graphite,mit-carbon/Graphite-Cycle-Level,nkawahara/Graphite,fhijaz/Graphite,nkawahara/Graphite,victorisildur/Graphite,fhijaz/Graphite,victorisildur/Graphite,victorisildur/Graphite,mit-carbon/Graphite-Cycle-Level,8l/Graphite,mit-carbon/Graphite,fhijaz/Graphite,victorisildur/Graphite
7edfed86771a8b04c8b20919311f5493e07f775f
core/cont/inc/TListOfTypes.h
core/cont/inc/TListOfTypes.h
// @(#)root/cont // Author: Philippe Canal Aug 2013 /************************************************************************* * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TListOfTypes #define ROOT_TListOfTypes ////////////////////////////////////////////////////////////////////////// // // // TListOfTypes // // // // A collection of TDataType designed to hold the typedef information // // and numerical type information. The collection is populated on // // demand. // // // ////////////////////////////////////////////////////////////////////////// #ifndef ROOT_THastTable #include "THashTable.h" #endif class TDataType; class TListOfTypes : public THashTable { public: TListOfTypes(); using THashTable::FindObject; virtual TObject *FindObject(const char *name) const; virtual TDataType *FindType(const char *name) const; ClassDef(TListOfTypes,3); // Specical container for the list of types. }; #endif
// @(#)root/cont // Author: Philippe Canal Aug 2013 /************************************************************************* * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TListOfTypes #define ROOT_TListOfTypes ////////////////////////////////////////////////////////////////////////// // // // TListOfTypes // // // // A collection of TDataType designed to hold the typedef information // // and numerical type information. The collection is populated on // // demand. // // // ////////////////////////////////////////////////////////////////////////// #ifndef ROOT_THastTable #include "THashTable.h" #endif class TDataType; class TListOfTypes : public THashTable { public: TListOfTypes(); using THashTable::FindObject; virtual TObject *FindObject(const char *name) const; TDataType *FindType(const char *name) const; ClassDef(TListOfTypes,2); // Specical container for the list of types. }; #endif
Remove unnecessary virtual keyword. Lower version number to minimun.
Remove unnecessary virtual keyword. Lower version number to minimun.
C
lgpl-2.1
CristinaCristescu/root,root-mirror/root,agarciamontoro/root,Duraznos/root,zzxuanyuan/root-compressor-dummy,thomaskeck/root,CristinaCristescu/root,perovic/root,cxx-hep/root-cern,Duraznos/root,esakellari/root,CristinaCristescu/root,abhinavmoudgil95/root,jrtomps/root,sbinet/cxx-root,zzxuanyuan/root-compressor-dummy,karies/root,Y--/root,beniz/root,veprbl/root,lgiommi/root,lgiommi/root,smarinac/root,root-mirror/root,zzxuanyuan/root,nilqed/root,omazapa/root-old,nilqed/root,vukasinmilosevic/root,arch1tect0r/root,esakellari/root,perovic/root,thomaskeck/root,satyarth934/root,buuck/root,gbitzes/root,simonpf/root,arch1tect0r/root,zzxuanyuan/root-compressor-dummy,mhuwiler/rootauto,mkret2/root,sawenzel/root,gganis/root,gganis/root,gbitzes/root,sirinath/root,alexschlueter/cern-root,gganis/root,vukasinmilosevic/root,lgiommi/root,zzxuanyuan/root-compressor-dummy,satyarth934/root,olifre/root,Y--/root,georgtroska/root,perovic/root,simonpf/root,gbitzes/root,CristinaCristescu/root,mkret2/root,nilqed/root,sbinet/cxx-root,veprbl/root,omazapa/root-old,sirinath/root,arch1tect0r/root,esakellari/root,dfunke/root,mkret2/root,arch1tect0r/root,gbitzes/root,pspe/root,evgeny-boger/root,krafczyk/root,dfunke/root,jrtomps/root,cxx-hep/root-cern,omazapa/root,esakellari/my_root_for_test,thomaskeck/root,lgiommi/root,thomaskeck/root,gganis/root,satyarth934/root,lgiommi/root,zzxuanyuan/root-compressor-dummy,abhinavmoudgil95/root,0x0all/ROOT,abhinavmoudgil95/root,olifre/root,buuck/root,evgeny-boger/root,zzxuanyuan/root,simonpf/root,thomaskeck/root,mkret2/root,Y--/root,alexschlueter/cern-root,davidlt/root,mattkretz/root,esakellari/my_root_for_test,dfunke/root,karies/root,thomaskeck/root,davidlt/root,simonpf/root,vukasinmilosevic/root,omazapa/root,cxx-hep/root-cern,pspe/root,sbinet/cxx-root,evgeny-boger/root,bbockelm/root,omazapa/root-old,zzxuanyuan/root,arch1tect0r/root,0x0all/ROOT,mattkretz/root,bbockelm/root,root-mirror/root,mhuwiler/rootauto,zzxuanyuan/root,nilqed/root,mattkretz/root,sirinath/root,BerserkerTroll/root,root-mirror/root,zzxuanyuan/root,jrtomps/root,buuck/root,esakellari/my_root_for_test,buuck/root,abhinavmoudgil95/root,dfunke/root,krafczyk/root,karies/root,dfunke/root,Duraznos/root,agarciamontoro/root,sawenzel/root,esakellari/my_root_for_test,mhuwiler/rootauto,mkret2/root,gganis/root,sawenzel/root,nilqed/root,lgiommi/root,alexschlueter/cern-root,smarinac/root,sbinet/cxx-root,pspe/root,esakellari/my_root_for_test,Duraznos/root,zzxuanyuan/root,mkret2/root,sawenzel/root,satyarth934/root,krafczyk/root,olifre/root,bbockelm/root,agarciamontoro/root,mhuwiler/rootauto,agarciamontoro/root,perovic/root,Duraznos/root,sawenzel/root,davidlt/root,krafczyk/root,evgeny-boger/root,CristinaCristescu/root,olifre/root,mhuwiler/rootauto,Y--/root,pspe/root,root-mirror/root,satyarth934/root,zzxuanyuan/root-compressor-dummy,simonpf/root,gbitzes/root,abhinavmoudgil95/root,mhuwiler/rootauto,smarinac/root,georgtroska/root,esakellari/my_root_for_test,lgiommi/root,mattkretz/root,thomaskeck/root,georgtroska/root,sirinath/root,vukasinmilosevic/root,zzxuanyuan/root-compressor-dummy,root-mirror/root,veprbl/root,bbockelm/root,0x0all/ROOT,davidlt/root,satyarth934/root,olifre/root,krafczyk/root,0x0all/ROOT,agarciamontoro/root,mkret2/root,evgeny-boger/root,gganis/root,abhinavmoudgil95/root,simonpf/root,mhuwiler/rootauto,abhinavmoudgil95/root,karies/root,esakellari/root,sawenzel/root,BerserkerTroll/root,mhuwiler/rootauto,BerserkerTroll/root,thomaskeck/root,zzxuanyuan/root-compressor-dummy,bbockelm/root,mattkretz/root,gganis/root,davidlt/root,beniz/root,jrtomps/root,georgtroska/root,beniz/root,gbitzes/root,esakellari/root,krafczyk/root,Y--/root,buuck/root,gganis/root,vukasinmilosevic/root,smarinac/root,perovic/root,bbockelm/root,satyarth934/root,perovic/root,davidlt/root,sirinath/root,lgiommi/root,sirinath/root,smarinac/root,georgtroska/root,georgtroska/root,BerserkerTroll/root,cxx-hep/root-cern,sbinet/cxx-root,georgtroska/root,bbockelm/root,agarciamontoro/root,alexschlueter/cern-root,davidlt/root,sirinath/root,mkret2/root,veprbl/root,BerserkerTroll/root,simonpf/root,sawenzel/root,agarciamontoro/root,sawenzel/root,krafczyk/root,mhuwiler/rootauto,simonpf/root,abhinavmoudgil95/root,omazapa/root,omazapa/root-old,karies/root,simonpf/root,buuck/root,thomaskeck/root,omazapa/root,BerserkerTroll/root,veprbl/root,nilqed/root,pspe/root,mattkretz/root,pspe/root,0x0all/ROOT,evgeny-boger/root,bbockelm/root,pspe/root,karies/root,esakellari/root,omazapa/root-old,BerserkerTroll/root,sbinet/cxx-root,krafczyk/root,olifre/root,evgeny-boger/root,nilqed/root,beniz/root,mattkretz/root,jrtomps/root,gbitzes/root,dfunke/root,simonpf/root,georgtroska/root,agarciamontoro/root,mkret2/root,root-mirror/root,nilqed/root,gganis/root,veprbl/root,0x0all/ROOT,beniz/root,dfunke/root,gbitzes/root,jrtomps/root,omazapa/root,sbinet/cxx-root,arch1tect0r/root,gbitzes/root,esakellari/my_root_for_test,arch1tect0r/root,pspe/root,zzxuanyuan/root-compressor-dummy,esakellari/root,BerserkerTroll/root,0x0all/ROOT,esakellari/my_root_for_test,arch1tect0r/root,root-mirror/root,vukasinmilosevic/root,root-mirror/root,buuck/root,omazapa/root,georgtroska/root,zzxuanyuan/root,pspe/root,cxx-hep/root-cern,dfunke/root,beniz/root,zzxuanyuan/root,beniz/root,CristinaCristescu/root,smarinac/root,CristinaCristescu/root,jrtomps/root,lgiommi/root,esakellari/root,CristinaCristescu/root,omazapa/root-old,lgiommi/root,zzxuanyuan/root,smarinac/root,mhuwiler/rootauto,Duraznos/root,thomaskeck/root,omazapa/root,nilqed/root,zzxuanyuan/root,omazapa/root,sawenzel/root,alexschlueter/cern-root,krafczyk/root,cxx-hep/root-cern,Duraznos/root,karies/root,bbockelm/root,dfunke/root,gganis/root,perovic/root,abhinavmoudgil95/root,evgeny-boger/root,Y--/root,perovic/root,jrtomps/root,davidlt/root,evgeny-boger/root,vukasinmilosevic/root,0x0all/ROOT,omazapa/root-old,karies/root,jrtomps/root,zzxuanyuan/root-compressor-dummy,nilqed/root,Y--/root,Y--/root,arch1tect0r/root,georgtroska/root,beniz/root,omazapa/root-old,arch1tect0r/root,gbitzes/root,Y--/root,pspe/root,Y--/root,satyarth934/root,0x0all/ROOT,omazapa/root,karies/root,jrtomps/root,veprbl/root,gganis/root,olifre/root,pspe/root,veprbl/root,davidlt/root,BerserkerTroll/root,veprbl/root,dfunke/root,sbinet/cxx-root,smarinac/root,veprbl/root,davidlt/root,bbockelm/root,CristinaCristescu/root,mattkretz/root,beniz/root,sawenzel/root,omazapa/root,omazapa/root-old,sirinath/root,vukasinmilosevic/root,perovic/root,root-mirror/root,bbockelm/root,agarciamontoro/root,smarinac/root,buuck/root,omazapa/root-old,satyarth934/root,esakellari/root,simonpf/root,omazapa/root-old,sawenzel/root,jrtomps/root,sbinet/cxx-root,Duraznos/root,sbinet/cxx-root,esakellari/root,buuck/root,satyarth934/root,alexschlueter/cern-root,abhinavmoudgil95/root,zzxuanyuan/root-compressor-dummy,root-mirror/root,cxx-hep/root-cern,nilqed/root,lgiommi/root,karies/root,mhuwiler/rootauto,abhinavmoudgil95/root,mattkretz/root,veprbl/root,dfunke/root,esakellari/my_root_for_test,perovic/root,buuck/root,agarciamontoro/root,sbinet/cxx-root,satyarth934/root,buuck/root,sirinath/root,Duraznos/root,BerserkerTroll/root,mattkretz/root,sirinath/root,olifre/root,CristinaCristescu/root,evgeny-boger/root,beniz/root,Duraznos/root,omazapa/root,vukasinmilosevic/root,mattkretz/root,krafczyk/root,olifre/root,esakellari/root,vukasinmilosevic/root,Duraznos/root,zzxuanyuan/root,agarciamontoro/root,gbitzes/root,alexschlueter/cern-root,arch1tect0r/root,evgeny-boger/root,karies/root,smarinac/root,mkret2/root,georgtroska/root,sirinath/root,Y--/root,esakellari/my_root_for_test,davidlt/root,krafczyk/root,perovic/root,beniz/root,CristinaCristescu/root,olifre/root,cxx-hep/root-cern,olifre/root,zzxuanyuan/root,mkret2/root,BerserkerTroll/root,vukasinmilosevic/root
e6f3a0156453cfd376e90f50ee93acfda2b03e9e
BotKit/BotKit.h
BotKit/BotKit.h
// // BotKit.h // BotKit // // Created by Mark Adams on 9/28/12. // Copyright (c) 2012 thoughtbot. All rights reserved. // #import "BKCoreDataManager.h" #import "BKManagedViewController.h" #import "BKManagedTableViewController.h" #import "NSObject+Coding.h" #import "NSArray+ObjectAccess.h" #import "NSDate+RelativeDates.h" #import "UIColor+AdjustColor.h" #import "UIColor+Serialization.h" #import "NSArray+Filtering.h" /* TODOS: BKImageLoader -imageWithContentsOfURL:completionHandler: -imageWithContentsOFURLPath:completionHandler: UIImage: +imageWithContentsOfURLPath: NSArray: -filteredArrayWhereKeys:matchValue:withMethod: -filteredArrayWhereKeys:containValue:caseInsensitive:diacritical: NSURLRequest: +requestWithString: +requestWithURL: NSDate: -dateStringWithFormat: -dateStringWithStyle: */
// // BotKit.h // BotKit // // Created by Mark Adams on 9/28/12. // Copyright (c) 2012 thoughtbot. All rights reserved. // #import "BKCoreDataManager.h" #import "BKManagedViewController.h" #import "BKManagedTableViewController.h" #import "NSObject+BKCoding.h" #import "NSArray+ObjectAccess.h" #import "NSDate+RelativeDates.h" #import "UIColor+AdjustColor.h" #import "UIColor+Serialization.h" #import "NSArray+Filtering.h" /* TODOS: BKImageLoader -imageWithContentsOfURL:completionHandler: -imageWithContentsOFURLPath:completionHandler: UIImage: +imageWithContentsOfURLPath: NSArray: -filteredArrayWhereKeys:matchValue:withMethod: -filteredArrayWhereKeys:containValue:caseInsensitive:diacritical: NSURLRequest: +requestWithString: +requestWithURL: NSDate: -dateStringWithFormat: -dateStringWithStyle: */
Fix reference to BKCoding category
Fix reference to BKCoding category
C
mit
thoughtbot/BotKit,thoughtbot/BotKit
df2aa1efbb940aa7bf5ef49235e1d7aff0d52128
test/Analysis/array-struct.c
test/Analysis/array-struct.c
// RUN: clang -checker-simple -verify %s // RUN: clang -checker-simple -analyzer-store-region -verify %s struct s { int data; int data_array[10]; }; typedef struct { int data; } STYPE; void f(void) { int a[10]; int (*p)[10]; p = &a; (*p)[3] = 1; struct s d; struct s *q; q = &d; q->data = 3; d.data_array[9] = 17; } void f2() { char *p = "/usr/local"; char (*q)[4]; q = &"abc"; } void f3() { STYPE s; }
// RUN: clang -checker-simple -verify %s // RUN: clang -checker-simple -analyzer-store-region -verify %s struct s { int data; int data_array[10]; }; typedef struct { int data; } STYPE; void f(void) { int a[10]; int (*p)[10]; p = &a; (*p)[3] = 1; struct s d; struct s *q; q = &d; q->data = 3; d.data_array[9] = 17; } void f2() { char *p = "/usr/local"; char (*q)[4]; q = &"abc"; } void f3() { STYPE s; } void f4() { int a[] = { 1, 2, 3}; int b[3] = { 1, 2 }; }
Add test code for array initialization.
Add test code for array initialization. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@58502 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/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,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,apple/swift-clang
3d1e914af227fd8fd7a41420664b225bf63e8f81
drivers/scsi/qla4xxx/ql4_version.h
drivers/scsi/qla4xxx/ql4_version.h
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.04.00-k4"
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.04.00-k5"
Update driver version to 5.04.00-k5
qla4xxx: Update driver version to 5.04.00-k5 Signed-off-by: Vikas Chaudhary <[email protected]> Reviewed-by: Mike Christie <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
C
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
458e459c372dca5579958aa760b4f3e2fc4c0e35
bandit/registration/registrar.h
bandit/registration/registrar.h
#ifndef BANDIT_REGISTRATION_REGISTRAR_H #define BANDIT_REGISTRATION_REGISTRAR_H #include <bandit/registration/spec_registry.h> namespace bandit { namespace detail { struct spec_registrar { spec_registrar(std::function<void()> func) { bandit::detail::specs().push_back(func); } }; } } #define BANDIT_CONCAT2(a, b) a##b #define BANDIT_CONCAT(a, b) BANDIT_CONCAT2(a, b) #define BANDIT_ADD_COUNTER(a) SNOWHOUSE_CONCAT(a, __COUNTER__) #define go_bandit \ static bandit::detail::spec_registrar BANDIT_ADD_COUNTER(bandit_registrar_) #define SPEC_BEGIN(name) \ go_bandit([]{ #define SPEC_END \ }); #endif
#ifndef BANDIT_REGISTRATION_REGISTRAR_H #define BANDIT_REGISTRATION_REGISTRAR_H #include <bandit/registration/spec_registry.h> namespace bandit { namespace detail { struct spec_registrar { spec_registrar(std::function<void()> func) { bandit::detail::specs().push_back(func); } }; } } #define BANDIT_CONCAT2(a, b) a##b #define BANDIT_CONCAT(a, b) BANDIT_CONCAT2(a, b) #define BANDIT_ADD_COUNTER(a) BANDIT_CONCAT(a, __COUNTER__) #define go_bandit \ static bandit::detail::spec_registrar BANDIT_ADD_COUNTER(bandit_registrar_) #define SPEC_BEGIN(name) \ go_bandit([]{ #define SPEC_END \ }); #endif
Use BANDIT_CONCAT instead of SNOWHOUSE_CONCAT macro
Use BANDIT_CONCAT instead of SNOWHOUSE_CONCAT macro Resolves #134
C
mit
joakimkarlsson/bandit,joakimkarlsson/bandit,joakimkarlsson/bandit
594d5743324d6748cb3fb1fa01c559ec4b225a34
src/SE_CInputManager.h
src/SE_CInputManager.h
/* * This file is part of SpeakEasy. * Copyright (C) 2012 Lambert Clara <[email protected]> * * 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/>. */ /** * @file SE_CInputManager.h * @brief Input devices manager * * @author Lambert Clara <[email protected]> * @date Created : 2012-04-23 */ #pragma once #include "SE_IBaseManager.h" class SE_CInputManager : public SE_IBaseManager { public: explicit SE_CInputManager(); ~SE_CInputManager(); void startUp() override; void shutDown() override; };
/* * This file is part of SpeakEasy. * Copyright (C) 2012 Lambert Clara <[email protected]> * * 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/>. */ /** * @file SE_CInputManager.h * @brief Input devices manager * * @author Lambert Clara <[email protected]> * @date Created : 2012-04-23 */ #pragma once #include "SE_IBaseManager.h" class SE_CInputManager : public SE_IBaseManager { public: SE_CInputManager(); ~SE_CInputManager(); void startUp() override; void shutDown() override; };
Remove useless explicit keyword on constructors without arguments.
Remove useless explicit keyword on constructors without arguments.
C
agpl-3.0
belkiss/SpeakEasy,belkiss/SpeakEasy
81cb088385ca4a1f63b7b308a8766117eaf90c09
drivers/scsi/qla2xxx/qla_version.h
drivers/scsi/qla2xxx/qla_version.h
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.06.00.08-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 6 #define QLA_DRIVER_PATCH_VER 0 #define QLA_DRIVER_BETA_VER 0
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.06.00.12-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 6 #define QLA_DRIVER_PATCH_VER 0 #define QLA_DRIVER_BETA_VER 0
Update the driver version to 8.06.00.12-k.
[SCSI] qla2xxx: Update the driver version to 8.06.00.12-k. Signed-off-by: Giridhar Malavali <[email protected]> Signed-off-by: Saurav Kashyap <[email protected]> Signed-off-by: James Bottomley <[email protected]>
C
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
302313fc0923fb3cc142e3a37c54e5f0f5ebdaa4
test/FrontendC/vla-2.c
test/FrontendC/vla-2.c
// RUN: %llvmgcc -std=gnu99 %s -S -o - | grep ".*alloca.*align 32" extern void bar(int[]); void foo(int a) { int var[a] __attribute__((__aligned__(32))); bar(var); return; }
// RUN: %llvmgcc -std=gnu99 %s -S -o - | grep ".*alloca.*align 16" extern void bar(int[]); void foo(int a) { int var[a] __attribute__((__aligned__(16))); bar(var); return; }
Update this to use a "valid" alignment.
Update this to use a "valid" alignment. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@108985 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,chubbymaggie/asap,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm
dfc6e33a4089b9f76dfb9aaf22014daa925849a2
radiant-player-mac/LastFm/LastFmPopover.h
radiant-player-mac/LastFm/LastFmPopover.h
/* * LastFmPopover.h * * Created by Sajid Anwar. * * Subject to terms and conditions in LICENSE.md. * */ #import <Cocoa/Cocoa.h> #import <LastFM/LastFm.h> #import "LastFmService.h" #define LASTFM_SIGN_IN_TAG 1 @interface LastFmPopover : NSPopover<NSPopoverDelegate> @property (retain) IBOutlet LastFmService *service; - (void)refreshTracks; @end
/* * LastFmPopover.h * * Created by Sajid Anwar. * * Subject to terms and conditions in LICENSE.md. * */ #import <Cocoa/Cocoa.h> #import <LastFm/LastFm.h> #import "LastFmService.h" #define LASTFM_SIGN_IN_TAG 1 @interface LastFmPopover : NSPopover<NSPopoverDelegate> @property (retain) IBOutlet LastFmService *service; - (void)refreshTracks; @end
Fix case sensitive import statement
Fix case sensitive import statement Fixes #190
C
mit
kbhomes/radiant-player-mac,radiant-player/radiant-player-mac,kbhomes/radiant-player-mac,kbhomes/radiant-player-mac,radiant-player/radiant-player-mac,kbhomes/radiant-player-mac,radiant-player/radiant-player-mac,radiant-player/radiant-player-mac,kbhomes/radiant-player-mac,radiant-player/radiant-player-mac
b51aa35a0453a008bd583f4e8cfcf9a0eb22366b
Markup.h
Markup.h
//*************************************************************************** extern "C" { #import <Cocoa/Cocoa.h> #import "RWPluginFramework.h" } //*************************************************************************** #pragma mark Logging #if ENABLE_LOGGING # define Log NSLog # define LOG_ENTRY NSLog(@"Entered: %s (%@:%d)", __func__, [[NSString stringWithCString:__FILE__] lastPathComponent], __LINE__); #else # define Log(...) do { } while(0); # define LOG_ENTRY do { } while(0); #endif //*************************************************************************** @interface Markup : RWAbstractPlugin { @public BOOL usingSmartQuotes; } + (Markup*) sharedMarkupPlugin; + (NSBundle*) sharedBundle; + (NSArray*) markupStyles; + (NSNumber*) markupEnabledForFilterStyleInSelectedRange:(NSString*)markupStyleName; + (void) addMarkupMenuItem; @end //*************************************************************************** extern const NSString* const kMarkupStyleFilterCommand; extern const NSString* const kMarkupStyleName; extern const int kMarkupTextMenuItemTag; //***************************************************************************
//*************************************************************************** extern "C" { #import <Cocoa/Cocoa.h> #import "RWPluginFramework.h" } //*************************************************************************** #pragma mark Logging #if ENABLE_LOGGING # define Log NSLog # define LOG_ENTRY NSLog(@"Entered: %s (%@:%d)", __func__, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__); #else # define Log(...) do { } while(0); # define LOG_ENTRY do { } while(0); #endif //*************************************************************************** @interface Markup : RWAbstractPlugin { @public BOOL usingSmartQuotes; } + (Markup*) sharedMarkupPlugin; + (NSBundle*) sharedBundle; + (NSArray*) markupStyles; + (NSNumber*) markupEnabledForFilterStyleInSelectedRange:(NSString*)markupStyleName; + (void) addMarkupMenuItem; @end //*************************************************************************** extern const NSString* const kMarkupStyleFilterCommand; extern const NSString* const kMarkupStyleName; extern const int kMarkupTextMenuItemTag; //***************************************************************************
Use stringWithUTF8String instead of deprecated stringWithCString
Use stringWithUTF8String instead of deprecated stringWithCString
C
mit
andrep/rw-markup,andrep/rw-markup,andrep/rw-markup
7eb6596d3168977375219db486f412d6dafe267b
libc/sysdeps/linux/common/remap_file_pages.c
libc/sysdeps/linux/common/remap_file_pages.c
/* * remap_file_pages() for uClibc * * Copyright (C) 2008 Will Newton <[email protected]> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #include <sys/syscall.h> #ifdef __NR_remap_file_pages _syscall5(int, remap_file_pages, unsigned long, start, unsigned long, size, unsigned long, prot, unsigned long, pgoff, unsigned long, flags); #endif
Add rempa_file_pages function by Will Newton <[email protected]>
Add rempa_file_pages function by Will Newton <[email protected]>
C
lgpl-2.1
joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc
0c831cc87a2effc6791e946858afaf5156d0edfc
deal.II/base/include/base/std_cxx1x/shared_ptr.h
deal.II/base/include/base/std_cxx1x/shared_ptr.h
//--------------------------------------------------------------------------- // $Id$ // Version: $Name$ // // Copyright (C) 2009 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer // to the file deal.II/doc/license.html for the text and // further information on this license. // //--------------------------------------------------------------------------- #ifndef __deal2__std_cxx1x_shared_ptr_h #define __deal2__std_cxx1x_shared_ptr_h #include <base/config.h> #ifdef DEAL_II_CAN_USE_CXX1X # include <memory> #else #include <boost/shared_ptr.hpp> DEAL_II_NAMESPACE_OPEN namespace std_cxx1x { using boost::shared_ptr; using boost::enable_shared_from_this; } DEAL_II_NAMESPACE_CLOSE #endif #endif
//--------------------------------------------------------------------------- // $Id$ // Version: $Name$ // // Copyright (C) 2009 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer // to the file deal.II/doc/license.html for the text and // further information on this license. // //--------------------------------------------------------------------------- #ifndef __deal2__std_cxx1x_shared_ptr_h #define __deal2__std_cxx1x_shared_ptr_h #include <base/config.h> #ifdef DEAL_II_CAN_USE_CXX1X # include <memory> #else #include <boost/shared_ptr.hpp> #include <boost/scoped_ptr.hpp> DEAL_II_NAMESPACE_OPEN namespace std_cxx1x { using boost::shared_ptr; using boost::enable_shared_from_this; // boost doesn't have boost::unique_ptr, // but its scoped_ptr comes close so // re-implement unique_ptr using scoped_ptr template<class T> class unique_ptr : public boost::scoped_ptr<T> { public: explicit unique_ptr(T * p = 0) : boost::scoped_ptr<T> (p) {} }; } DEAL_II_NAMESPACE_CLOSE #endif #endif
Implement the equivalent of std::unique_ptr using boost::scoped_ptr.
Implement the equivalent of std::unique_ptr using boost::scoped_ptr. git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@19195 0785d39b-7218-0410-832d-ea1e28bc413d
C
lgpl-2.1
sriharisundar/dealii,YongYang86/dealii,sriharisundar/dealii,kalj/dealii,sriharisundar/dealii,YongYang86/dealii,sriharisundar/dealii,flow123d/dealii,flow123d/dealii,johntfoster/dealii,ibkim11/dealii,gpitton/dealii,pesser/dealii,ibkim11/dealii,spco/dealii,jperryhouts/dealii,shakirbsm/dealii,ibkim11/dealii,JaeryunYim/dealii,danshapero/dealii,lue/dealii,YongYang86/dealii,mac-a/dealii,andreamola/dealii,ESeNonFossiIo/dealii,danshapero/dealii,flow123d/dealii,EGP-CIG-REU/dealii,sairajat/dealii,mac-a/dealii,lue/dealii,lpolster/dealii,johntfoster/dealii,YongYang86/dealii,kalj/dealii,nicolacavallini/dealii,pesser/dealii,johntfoster/dealii,sairajat/dealii,kalj/dealii,johntfoster/dealii,maieneuro/dealii,flow123d/dealii,maieneuro/dealii,danshapero/dealii,JaeryunYim/dealii,shakirbsm/dealii,rrgrove6/dealii,nicolacavallini/dealii,shakirbsm/dealii,msteigemann/dealii,JaeryunYim/dealii,andreamola/dealii,mtezzele/dealii,andreamola/dealii,angelrca/dealii,adamkosik/dealii,YongYang86/dealii,lpolster/dealii,mac-a/dealii,angelrca/dealii,danshapero/dealii,msteigemann/dealii,flow123d/dealii,pesser/dealii,Arezou-gh/dealii,msteigemann/dealii,mac-a/dealii,lue/dealii,jperryhouts/dealii,ESeNonFossiIo/dealii,sairajat/dealii,shakirbsm/dealii,andreamola/dealii,msteigemann/dealii,lpolster/dealii,gpitton/dealii,andreamola/dealii,EGP-CIG-REU/dealii,danshapero/dealii,adamkosik/dealii,gpitton/dealii,msteigemann/dealii,EGP-CIG-REU/dealii,lue/dealii,Arezou-gh/dealii,rrgrove6/dealii,andreamola/dealii,natashasharma/dealii,mtezzele/dealii,YongYang86/dealii,rrgrove6/dealii,naliboff/dealii,spco/dealii,sairajat/dealii,johntfoster/dealii,naliboff/dealii,natashasharma/dealii,danshapero/dealii,gpitton/dealii,msteigemann/dealii,JaeryunYim/dealii,lpolster/dealii,flow123d/dealii,jperryhouts/dealii,ESeNonFossiIo/dealii,rrgrove6/dealii,JaeryunYim/dealii,sriharisundar/dealii,angelrca/dealii,maieneuro/dealii,kalj/dealii,danshapero/dealii,jperryhouts/dealii,angelrca/dealii,Arezou-gh/dealii,nicolacavallini/dealii,pesser/dealii,natashasharma/dealii,mac-a/dealii,Arezou-gh/dealii,natashasharma/dealii,adamkosik/dealii,ESeNonFossiIo/dealii,maieneuro/dealii,mtezzele/dealii,natashasharma/dealii,mtezzele/dealii,JaeryunYim/dealii,ESeNonFossiIo/dealii,naliboff/dealii,kalj/dealii,ibkim11/dealii,maieneuro/dealii,andreamola/dealii,rrgrove6/dealii,spco/dealii,kalj/dealii,sairajat/dealii,nicolacavallini/dealii,lpolster/dealii,mac-a/dealii,shakirbsm/dealii,pesser/dealii,naliboff/dealii,kalj/dealii,angelrca/dealii,Arezou-gh/dealii,mac-a/dealii,adamkosik/dealii,lue/dealii,natashasharma/dealii,rrgrove6/dealii,YongYang86/dealii,nicolacavallini/dealii,gpitton/dealii,msteigemann/dealii,shakirbsm/dealii,adamkosik/dealii,gpitton/dealii,maieneuro/dealii,jperryhouts/dealii,rrgrove6/dealii,flow123d/dealii,nicolacavallini/dealii,lpolster/dealii,mtezzele/dealii,johntfoster/dealii,spco/dealii,ibkim11/dealii,nicolacavallini/dealii,jperryhouts/dealii,EGP-CIG-REU/dealii,spco/dealii,EGP-CIG-REU/dealii,shakirbsm/dealii,EGP-CIG-REU/dealii,jperryhouts/dealii,lue/dealii,JaeryunYim/dealii,angelrca/dealii,naliboff/dealii,sairajat/dealii,mtezzele/dealii,ibkim11/dealii,pesser/dealii,spco/dealii,naliboff/dealii,johntfoster/dealii,adamkosik/dealii,adamkosik/dealii,maieneuro/dealii,sairajat/dealii,spco/dealii,Arezou-gh/dealii,ESeNonFossiIo/dealii,Arezou-gh/dealii,mtezzele/dealii,lpolster/dealii,lue/dealii,gpitton/dealii,pesser/dealii,naliboff/dealii,sriharisundar/dealii,natashasharma/dealii,sriharisundar/dealii,angelrca/dealii,ibkim11/dealii,ESeNonFossiIo/dealii,EGP-CIG-REU/dealii
799d09c40076c5187d25f489963f2a112cb7703b
sys/sys/devfsext.h
sys/sys/devfsext.h
/* usual BSD style copyright here */ /* Written by Julian Elischer ([email protected])*/ /* * $Id: devfsext.h,v 1.6 1996/01/21 09:03:04 julian Exp $ */ #ifndef _SYS_DEVFSECT_H_ #define _SYS_DEVFSECT_H_ 1 void *devfs_add_devsw(char *path, char *name, void *devsw, int minor, int chrblk, uid_t uid, gid_t gid, int perms) ; void *devfs_add_devswf(void *devsw, int minor, int chrblk, uid_t uid, gid_t gid, int perms, char *fmt, ...) ; void *dev_link(char *path, char *name, void *original); /* the result of a previous dev_link or dev_add operation */ /* remove the device the cookie represents */ void devfs_remove_dev(void *devnmp); #define DV_CHR 0 #define DV_BLK 1 #define DV_DEV 2 #endif /*_SYS_DEVFSECT_H_*/
/* usual BSD style copyright here */ /* Written by Julian Elischer ([email protected])*/ /* * $Id: devfsext.h,v 1.7 1996/01/25 07:17:05 phk Exp $ */ #ifndef _SYS_DEVFSECT_H_ #define _SYS_DEVFSECT_H_ 1 void *devfs_add_devsw(char *path, char *name, void *devsw, int minor, int chrblk, uid_t uid, gid_t gid, int perms) ; void *devfs_add_devswf(void *devsw, int minor, int chrblk, uid_t uid, gid_t gid, int perms, char *fmt, ...) ; void *dev_link(char *path, char *name, void *original); /* the result of a previous dev_link or dev_add operation */ /* remove the device the cookie represents */ void devfs_remove_dev(void *devnmp); #define DV_CHR 0 #define DV_BLK 1 #define DV_DEV 2 /* XXX */ #define UID_ROOT 0 #define UID_BIN 3 #define UID_UUCP 66 /* XXX */ #define GID_WHEEL 0 #define GID_KMEM 2 #define GID_OPERATOR 5 #define GID_BIN 7 #define GID_DIALER 68 #endif /*_SYS_DEVFSECT_H_*/
Define magic uids and gids for use in devfs_add_devsw[f]().
Define magic uids and gids for use in devfs_add_devsw[f](). The kernel shouldn't know these values, but there is currently no better way of setting them.
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
40716ab51517f20a322433ac0c9c3f54d7acf2f5
cpu/cc2538/dev/cc2538-sensors.h
cpu/cc2538/dev/cc2538-sensors.h
/* * Copyright (c) 2015, Zolertia - http://www.zolertia.com * Copyright (c) 2015, University of Bristol - http://www.bristol.ac.uk * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder 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 HOLDER 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. */ /*---------------------------------------------------------------------------*/ /** * \addtogroup cc2538 * @{ * * \defgroup cc2538-sensors CC2538 Built-In Sensors * * Module controlling sensors on the CC2538 SoC (Tmp and VDD3) * @{ * * \file * Generic header usable by all CC2538 sensor drivers */ /*---------------------------------------------------------------------------*/ #ifndef CC2538_SENSORS_H_ #define CC2538_SENSORS_H_ /*---------------------------------------------------------------------------*/ #include "lib/sensors.h" #include "dev/cc2538-temp-sensor.h" #include "dev/vdd3-sensor.h" /*---------------------------------------------------------------------------*/ /** * \name CC2538 sensor constants * * These constants are used by various sensors on the CC2538. They can be used * to differentiate between raw and converted readings, to configure ADC * decimation rate (where applicable). * @{ */ #define CC2538_SENSORS_VALUE_TYPE_RAW 0 /**< Request the raw reading */ #define CC2538_SENSORS_VALUE_TYPE_CONVERTED 1 /**< Request the converted reading */ #define CC2538_SENSORS_ERROR 0x80000000 /**< Generic Error */ /** @} */ /*---------------------------------------------------------------------------*/ #endif /* CC2538_SENSORS_H_ */ /*---------------------------------------------------------------------------*/ /** * @} * @} */
Add generic header for CC2538 sensors
Add generic header for CC2538 sensors
C
bsd-3-clause
bluerover/6lbr,bluerover/6lbr,MohamedSeliem/contiki,arurke/contiki,bluerover/6lbr,arurke/contiki,arurke/contiki,MohamedSeliem/contiki,MohamedSeliem/contiki,arurke/contiki,arurke/contiki,arurke/contiki,MohamedSeliem/contiki,MohamedSeliem/contiki,arurke/contiki,bluerover/6lbr,MohamedSeliem/contiki,bluerover/6lbr,bluerover/6lbr,bluerover/6lbr,MohamedSeliem/contiki
4577174153ee0fbabc142fee3bf4c178b56ec635
test/CodeGen/pr41027.c
test/CodeGen/pr41027.c
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -S -O2 -o - %s | FileCheck %s // CHECK-LABEL: f: // CHECK: movl $1, %eax // CHECK-NEXT: #APP // CHECK-NEXT: outl %eax, $1 // CHECK-NEXT: #NO_APP static inline void pr41027(unsigned a, unsigned b) { if (__builtin_constant_p(a)) { __asm__ volatile("outl %0,%w1" : : "a"(b), "n"(a)); } else { __asm__ volatile("outl %0,%w1" : : "a"(b), "d"(a)); } } void f(unsigned port) { pr41027(1, 1); }
// REQUIRES: x86-registered-target // RUN: %clang_cc1 -triple x86_64-unknown-unknown -S -O2 -o - %s | FileCheck %s // CHECK-LABEL: f: // CHECK: movl $1, %eax // CHECK-NEXT: #APP // CHECK-NEXT: outl %eax, $1 // CHECK-NEXT: #NO_APP static inline void pr41027(unsigned a, unsigned b) { if (__builtin_constant_p(a)) { __asm__ volatile("outl %0,%w1" : : "a"(b), "n"(a)); } else { __asm__ volatile("outl %0,%w1" : : "a"(b), "d"(a)); } } void f(unsigned port) { pr41027(1, 1); }
Add target requirements for those bots which don't handle x86.
Add target requirements for those bots which don't handle x86. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@368202 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
a814f00bae2bc7e43f718c4753c8b8cc5ed53358
tests/regression/36-octapron/33-large-int64.c
tests/regression/36-octapron/33-large-int64.c
// SKIP PARAM: --sets ana.activated[+] octApron #include <assert.h> void main() { // requires int64, not int signed long long x, y, z; if (x < y && y < z) { assert(x < y); assert(y < z); assert(x < z); if (9223372036854775805 <= x && z <= 9223372036854775807) { assert(x == 9223372036854775805); assert(y == 9223372036854775806); assert(z == 9223372036854775807); assert(x != -3); assert(y != -2); assert(z != -1); } } }
Add octApron test where int64 is required
Add octApron test where int64 is required
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
e478265659bb85608e72db67e8d15031b39cf15a
include/sdl_wrapper.h
include/sdl_wrapper.h
#ifndef SDL_WRAPPER_H #define SDL_WRAPPER_H 1 //------------------------------------------------------------------- #include <SDL.h> #include "wrapper/exceptions.h" //------------------------------------------------------------------- namespace SDL { template<class ErrorHandler =Throw> class SDL { ErrorHandler handle_error(); public: SDL(Uint32 flags =0) { if (SDL_Init(flags) != 0) handle_error(SDL_GetError()); } ~SDL() { SDL_Quit(); } }; template<> class SDL<NoThrow> { int st; public: SDL(Uint32 flags =0) :st {SDL_Init(flags)} {} int state() const { return st; } ~SDL() { SDL_Quit(); } }; } //namespace //------------------------------------------------------------------- #endif
Create wrapper for SDL_Init routine
Create wrapper for SDL_Init routine
C
mit
tagener-noisu/cxx_sdl
af58e8d5600753082455ec1ebedae00a6cf8ba32
test/FrontendC/2007-10-01-BuildArrayRef.c
test/FrontendC/2007-10-01-BuildArrayRef.c
// RUN: not %llvmgcc -S %s -o /dev/null |& grep "error: assignment of read-only location" // PR 1603 int func() { const int *arr; arr[0] = 1; }
// RUN: not %llvmgcc_only -c %s -o /dev/null |& FileCheck %s // PR 1603 void func() { const int *arr; arr[0] = 1; // CXHECK: error: assignment of read-only location } struct foo { int bar; }; struct foo sfoo = { 0 }; int func2() { const struct foo *fp; fp = &sfoo; fp[0].bar = 1; // CHECK: error: assignment of read-only member 'bar' return sfoo.bar; }
Test case for r113248. Raar 8361341.
Test case for r113248. Raar 8361341. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@113249 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm
2004a168dc481a9b3a2986741507e953efa7afab
bindings/uwp/uwp-binding/Microsoft.Azure.IoT.Gateway/GatewayUwp.h
bindings/uwp/uwp-binding/Microsoft.Azure.IoT.Gateway/GatewayUwp.h
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #pragma once #include "pch.h" #include "..\..\..\..\core\inc\gateway_ll.h" #include "IGatewayModule.h" namespace Microsoft { namespace Azure { namespace IoT { namespace Gateway { interface class IGatewayModule; ref class MessageBus; class InternalGatewayModule : public IInternalGatewayModule { public: InternalGatewayModule(IGatewayModule ^moduleImpl) { _moduleImpl = moduleImpl; } virtual ~InternalGatewayModule() { } void Module_Create(MESSAGE_BUS_HANDLE busHandle, const void* configuration); void Module_Destroy(); void Module_Receive(MODULE_HANDLE moduleHandle, MESSAGE_HANDLE messageHandle); private: IGatewayModule^ _moduleImpl; }; public ref class Gateway sealed { public: Gateway(Windows::Foundation::Collections::IVector<Microsoft::Azure::IoT::Gateway::IGatewayModule^>^ modules); virtual ~Gateway() { Gateway_LL_UwpDestroy(gateway_handle); gateway_handle = nullptr; VECTOR_destroy(modules_handle); } private: VECTOR_HANDLE modules_handle; GATEWAY_HANDLE gateway_handle; MESSAGE_BUS_HANDLE messagebus_handle; std::vector<std::unique_ptr<InternalGatewayModule>> gatewayModulesToDelete; }; }}}};
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #pragma once #include "pch.h" #include "gateway.h" #include "IGatewayModule.h" namespace Microsoft { namespace Azure { namespace IoT { namespace Gateway { interface class IGatewayModule; ref class MessageBus; class InternalGatewayModule : public IInternalGatewayModule { public: InternalGatewayModule(IGatewayModule ^moduleImpl) { _moduleImpl = moduleImpl; } virtual ~InternalGatewayModule() { } void Module_Create(MESSAGE_BUS_HANDLE busHandle, const void* configuration); void Module_Destroy(); void Module_Receive(MODULE_HANDLE moduleHandle, MESSAGE_HANDLE messageHandle); private: IGatewayModule^ _moduleImpl; }; public ref class Gateway sealed { public: Gateway(Windows::Foundation::Collections::IVector<Microsoft::Azure::IoT::Gateway::IGatewayModule^>^ modules); virtual ~Gateway() { Gateway_LL_UwpDestroy(gateway_handle); gateway_handle = nullptr; VECTOR_destroy(modules_handle); } private: VECTOR_HANDLE modules_handle; GATEWAY_HANDLE gateway_handle; MESSAGE_BUS_HANDLE messagebus_handle; std::vector<std::unique_ptr<InternalGatewayModule>> gatewayModulesToDelete; }; }}}};
Fix gateway header path in UWP
Fix gateway header path in UWP
C
mit
yaweiw/azure-iot-gateway-sdk,yaweiw/azure-iot-gateway-sdk,yaweiw/azure-iot-gateway-sdk,yaweiw/azure-iot-gateway-sdk,yaweiw/azure-iot-gateway-sdk
7304ae70f7c369b6dbb47edd3517c4c0c11a0def
webkit/glue/simple_webmimeregistry_impl.h
webkit/glue/simple_webmimeregistry_impl.h
// Copyright (c) 2009 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 WEBMIMEREGISTRY_IMPL_H_ #define WEBMIMEREGISTRY_IMPL_H_ #include "third_party/WebKit/WebKit/chromium/public/WebMimeRegistry.h" namespace webkit_glue { class SimpleWebMimeRegistryImpl : public WebKit::WebMimeRegistry { public: // WebMimeRegistry methods: virtual WebKit::WebMimeRegistry::SupportsType supportsMIMEType( const WebKit::WebString&); virtual WebKit::WebMimeRegistry::SupportsType supportsImageMIMEType( const WebKit::WebString&); virtual WebKit::WebMimeRegistry::SupportsType supportsJavaScriptMIMEType( const WebKit::WebString&); virtual WebKit::WebMimeRegistry::SupportsType supportsMediaMIMEType( const WebKit::WebString&, const WebKit::WebString&); virtual WebKit::WebMimeRegistry::SupportsType supportsNonImageMIMEType( const WebKit::WebString&); virtual WebKit::WebString mimeTypeForExtension(const WebKit::WebString&); virtual WebKit::WebString mimeTypeFromFile(const WebKit::WebString&); virtual WebKit::WebString preferredExtensionForMIMEType( const WebKit::WebString&); }; } // namespace webkit_glue #endif // WEBMIMEREGISTRY_IMPL_H_
// Copyright (c) 2009 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 WEBMIMEREGISTRY_IMPL_H_ #define WEBMIMEREGISTRY_IMPL_H_ #include "third_party/WebKit/WebKit/chromium/public/WebMimeRegistry.h" namespace webkit_glue { class SimpleWebMimeRegistryImpl : public WebKit::WebMimeRegistry { public: SimpleWebMimeRegistryImpl() {} virtual ~SimpleWebMimeRegistryImpl() {} // WebMimeRegistry methods: virtual WebKit::WebMimeRegistry::SupportsType supportsMIMEType( const WebKit::WebString&); virtual WebKit::WebMimeRegistry::SupportsType supportsImageMIMEType( const WebKit::WebString&); virtual WebKit::WebMimeRegistry::SupportsType supportsJavaScriptMIMEType( const WebKit::WebString&); virtual WebKit::WebMimeRegistry::SupportsType supportsMediaMIMEType( const WebKit::WebString&, const WebKit::WebString&); virtual WebKit::WebMimeRegistry::SupportsType supportsNonImageMIMEType( const WebKit::WebString&); virtual WebKit::WebString mimeTypeForExtension(const WebKit::WebString&); virtual WebKit::WebString mimeTypeFromFile(const WebKit::WebString&); virtual WebKit::WebString preferredExtensionForMIMEType( const WebKit::WebString&); }; } // namespace webkit_glue #endif // WEBMIMEREGISTRY_IMPL_H_
Add a virtual destructor to SimpleWebMimeRegistryImpl so that child class destructors get called correctly.
Add a virtual destructor to SimpleWebMimeRegistryImpl so that child class destructors get called correctly. BUG=62828 TEST=No memory leak in TestShellWebMimeRegistryImpl Review URL: http://codereview.chromium.org/4880002 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@65967 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
gavinp/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,adobe/chromium,yitian134/chromium,ropik/chromium,ropik/chromium,adobe/chromium,adobe/chromium,ropik/chromium,adobe/chromium,gavinp/chromium,gavinp/chromium,yitian134/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,ropik/chromium,ropik/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,adobe/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,adobe/chromium
25f8df84acb951f22eb4c7717cc28a74702b3e7b
mud/lib/secretlog.c
mud/lib/secretlog.c
#include <kotaka/paths/system.h> inherit "~System/lib/struct/list"; private mapping buffers; private void append_node(string file, string fragment) { mixed **list; if (!buffers) { buffers = ([ ]); } list = buffers[file]; if (!list) { list = ({ nil, nil }); buffers[file] = list; } list_append_string(list, fragment); } private void write_node(string file) { mixed **list; mixed *info; list = buffers[file]; info = SECRETD->file_info("logs/" + file + ".log"); if (info && info[0] >= 1 << 25) { SECRETD->remove_file("logs/" + file + ".log.old"); SECRETD->rename_file("logs/" + file + ".log", "logs/" + file + ".log.old"); } SECRETD->make_dir("."); SECRETD->make_dir("logs"); SECRETD->write_file("logs/" + file + ".log", list_front(list)); list_pop_front(list); if (list_empty(list)) { buffers[file] = nil; } } static nomask void secret_flush() { while (buffers && map_sizeof(buffers)) { string *files; int sz; files = map_indices(buffers); sz = sizeof(files); write_node(files[random(sz)]); buffers = nil; } } static void flush() { call_out("secret_flush", 0); } static void write_secret_log(string file, string message) { mixed *mtime; string stamp, mstamp; mtime = millitime(); /* ctime format: */ /* Tue Aug 3 14:40:18 1993 */ /* 012345678901234567890123 */ stamp = ctime(mtime[0]); stamp = stamp[0 .. 2] + ", " + stamp[4 .. 9] + ", " + stamp[20 .. 23] + " " + stamp[11 .. 18]; stamp += "."; /* millitime resolution is 1m anyway */ mstamp = "" + floor(mtime[1] * 1000.0 + 0.5); mstamp = "000" + mstamp; mstamp = mstamp[strlen(mstamp) - 3 ..]; stamp += mstamp; append_node(file, stamp + " " + message + "\n"); call_out("secret_flush", 0); }
Add library to make secret logs
Add library to make secret logs
C
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
bb2994d4d628484f1bb1befa0b7098db71d74a4d
random.c
random.c
#include "random.h" #include <stdio.h> #include <stdlib.h> #include <time.h> #include <unistd.h> void seed_random(void) { /* Single iteration of Xorshift to get a good seed. */ unsigned int seed = time(NULL) ^ getpid(); seed ^= (seed << 19); seed ^= (seed >> 11); seed ^= (seed << 9); printf("seed = %u\n", seed); srandom(seed); } int random_range(int min, int max) { int range, bucket, remainder, r; range = max - min; bucket = RAND_MAX / range; remainder = RAND_MAX % range; while ((r = random()) > (RAND_MAX - remainder)) ; return min + (r / bucket); }
#include "random.h" #include <stdio.h> #include <stdlib.h> #include <time.h> #include <unistd.h> void seed_random(void) { /* Single iteration of Xorshift to get a good seed. */ unsigned int seed = time(NULL) ^ getpid(); seed ^= (seed << 19); seed ^= (seed >> 11); seed ^= (seed << 9); fprintf(stderr, "seed = %u\n", seed); srandom(seed); } int random_range(int min, int max) { int range, bucket, remainder, r; range = max - min; bucket = RAND_MAX / range; remainder = RAND_MAX % range; while ((r = random()) > (RAND_MAX - remainder)) ; return min + (r / bucket); }
Print seed to stderr, not stdout.
Print seed to stderr, not stdout.
C
mit
ingramj/dice
9cf8f370f0777a24808b3485f3b5abb8e736d3e8
include/asm-parisc/param.h
include/asm-parisc/param.h
#ifndef _ASMPARISC_PARAM_H #define _ASMPARISC_PARAM_H #ifdef __KERNEL__ # ifdef CONFIG_PA20 # define HZ 1000 /* Faster machines */ # else # define HZ 100 /* Internal kernel timer frequency */ # endif # define USER_HZ 100 /* .. some user interfaces are in "ticks" */ # define CLOCKS_PER_SEC (USER_HZ) /* like times() */ #endif #ifndef HZ #define HZ 100 #endif #define EXEC_PAGESIZE 4096 #ifndef NOGROUP #define NOGROUP (-1) #endif #define MAXHOSTNAMELEN 64 /* max length of hostname */ #endif
#ifndef _ASMPARISC_PARAM_H #define _ASMPARISC_PARAM_H #ifdef __KERNEL__ #define HZ CONFIG_HZ #define USER_HZ 100 /* some user API use "ticks" */ #define CLOCKS_PER_SEC (USER_HZ) /* like times() */ #endif #ifndef HZ #define HZ 100 #endif #define EXEC_PAGESIZE 4096 #ifndef NOGROUP #define NOGROUP (-1) #endif #define MAXHOSTNAMELEN 64 /* max length of hostname */ #endif
Use CONFIG_HZ to determine interval timer rate (aka clock ticks)
[PARISC] Use CONFIG_HZ to determine interval timer rate (aka clock ticks) This isn't likely to be causing problems for other bits of kernel code. I can't find any other user of CONFIG_HZ outside of arch specific code. Signed-off-by: Grant Grundler <[email protected]> Signed-off-by: Kyle McMartin <[email protected]>
C
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
62f68976927c28ad86144c596576d6311a21f2bd
src/argon2_node.h
src/argon2_node.h
#ifndef ARGON2_NODE_H #define ARGON2_NODE_H #include <memory> #include <nan.h> namespace NodeArgon2 { class HashAsyncWorker final: public Nan::AsyncWorker { public: HashAsyncWorker(std::string&& plain, std::string&& salt, std::tuple<uint32_t, uint32_t, uint32_t, argon2_type>&& params); void Execute() override; void HandleOKCallback() override; void HandleErrorCallback() override; private: std::string plain; std::string salt; uint32_t time_cost; uint32_t memory_cost; uint32_t parallelism; argon2_type type; std::unique_ptr<char[]> output; }; class VerifyAsyncWorker final: public Nan::AsyncWorker { public: VerifyAsyncWorker(std::string&& hash, std::string&& plain, argon2_type type); void Execute() override; void HandleOKCallback() override; void HandleErrorCallback() override; private: std::string hash; std::string plain; argon2_type type; bool output; }; NAN_METHOD(Hash); NAN_METHOD(HashSync); NAN_METHOD(Verify); NAN_METHOD(VerifySync); } #endif /* ARGON2_NODE_H */
#ifndef ARGON2_NODE_H #define ARGON2_NODE_H #include <memory> #include <nan.h> namespace NodeArgon2 { class HashAsyncWorker final: public Nan::AsyncWorker { public: explicit HashAsyncWorker(std::string&& plain, std::string&& salt, std::tuple<uint32_t, uint32_t, uint32_t, argon2_type>&& params); void Execute() override; void HandleOKCallback() override; void HandleErrorCallback() override; private: std::string plain; std::string salt; uint32_t time_cost; uint32_t memory_cost; uint32_t parallelism; argon2_type type; std::unique_ptr<char[]> output; }; class VerifyAsyncWorker final: public Nan::AsyncWorker { public: explicit VerifyAsyncWorker(std::string&& hash, std::string&& plain, argon2_type type); void Execute() override; void HandleOKCallback() override; void HandleErrorCallback() override; private: std::string hash; std::string plain; argon2_type type; bool output; }; NAN_METHOD(Hash); NAN_METHOD(HashSync); NAN_METHOD(Verify); NAN_METHOD(VerifySync); } #endif /* ARGON2_NODE_H */
Use explicit constructors for correctness
Use explicit constructors for correctness
C
mit
markfejes/node-argon2,markfejes/node-argon2,markfejes/node-argon2,ranisalt/node-argon2,ranisalt/node-argon2,ranisalt/node-argon2
ff22d76862b24b1ca7152ca624cdd2e9772a23b6
src/math/p_atan.c
src/math/p_atan.c
#include <pal.h> /** * * Calculates inverse tangent (arc tangent) of the input value. The function * returns a value between -pi/2 to pi/2 but does not check for illegal input * values. * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vector. * * @return None * */ #include <math.h> void p_atan_f32(const float *a, float *c, int n) { int i; for (i = 0; i < n; i++) { *(c + i) = atan(*(a + i)); } }
#include <pal.h> /* * -1 <= x <= 1 * atan x = a1 * x + a3 * x^3 + ... + a9 * x^9 + e(x) * |e(x)| <= 10^-5 */ static inline float _p_atan(const float x) { const float a1 = 0.9998660f; const float a3 = -0.3302995f; const float a5 = 0.1801410f; const float a7 = -0.0851330f; const float a9 = 0.0208351f; return a1 * x + a3 * x * x * x + a5 * x * x * x * x * x + a7 * x * x * x * x * x * x * x + a9 * x * x * x * x * x * x * x * x * x; } /** * * Calculates inverse tangent (arc tangent) of the input value. The function * returns a value between -pi/2 to pi/2 but does not check for illegal input * values. * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vector. * * @return None * */ #include <math.h> void p_atan_f32(const float *a, float *c, int n) { int i; for (i = 0; i < n; i++) { c[i] = _p_atan(a[i]); } }
Implement the inverse tangent function.
math:atan: Implement the inverse tangent function. Signed-off-by: Mansour Moufid <[email protected]>
C
apache-2.0
Adamszk/pal3,Adamszk/pal3,aolofsson/pal,eliteraspberries/pal,mateunho/pal,parallella/pal,8l/pal,aolofsson/pal,olajep/pal,mateunho/pal,8l/pal,debug-de-su-ka/pal,olajep/pal,mateunho/pal,Adamszk/pal3,mateunho/pal,parallella/pal,aolofsson/pal,aolofsson/pal,debug-de-su-ka/pal,Adamszk/pal3,parallella/pal,debug-de-su-ka/pal,olajep/pal,parallella/pal,8l/pal,8l/pal,debug-de-su-ka/pal,eliteraspberries/pal,mateunho/pal,eliteraspberries/pal,debug-de-su-ka/pal,eliteraspberries/pal,eliteraspberries/pal,olajep/pal,parallella/pal
033bfcb84aa88dde9779c789e4aefeb20bb899ed
lelib/lelib.h
lelib/lelib.h
// // lelib.h // lelib // // Created by Petr on 27.10.13. // Copyright (c) 2013 JLizard. All rights reserved. // #define LE_DEBUG_LOGS 1 #if LE_DEBUG_LOGS #define LE_DEBUG(...) NSLog(__VA_ARGS__) #else #define LE_DEBUG(...) #endif #import "LELog.h" #import "lecore.h"
// // lelib.h // lelib // // Created by Petr on 27.10.13. // Copyright (c) 2013 JLizard. All rights reserved. // #ifndef LE_DEBUG_LOGS #ifdef DEBUG #define LE_DEBUG_LOGS 1 #else #define LE_DEBUG_LOGS 0 #endif #endif #if LE_DEBUG_LOGS #define LE_DEBUG(...) NSLog(__VA_ARGS__) #else #define LE_DEBUG(...) #endif #import "LELog.h" #import "lecore.h"
Allow logging to be configured at compilation time.
Allow logging to be configured at compilation time.
C
mit
smalltownheroes/le_ios,omgapuppy/le_ios,omgapuppy/le_ios,omgapuppy/le_ios,smalltownheroes/le_ios,logentries/le_ios,JohnLemberger/le_ios,KieranOB/le_ios,smalltownheroes/le_ios
a5b2fb5072ff42d546eea4fd047dd9d3cd72337e
src/gcc/include/libvstring.h
src/gcc/include/libvstring.h
/* VString library header file for GCC */ #include <exec/types.h> APTR AllocVecPooled(__reg("a0") APTR pool, __reg("d0") ULONG size); APTR CloneMem(__reg("a0") const APTR src, __reg("d0") ULONG size); APTR CloneMemPooled(__reg("a0") APTR pool, __reg("a1") const APTR src, __reg("d0") ULONG size); void FreeVecPooled(__reg("a0") APTR pool, __reg("a1") APTR block); UBYTE* StrCopy(__reg("a0") const UBYTE *s, __reg("a1") UBYTE *d); UWORD* StrCopyW(__reg("a0") const UWORD *s, __reg("a1") UWORD *d); ULONG* StrCopyL(__reg("a0") const ULONG *s, __reg("a1") ULONG *d); ULONG Utf8Size(__reg("d0") ULONG cp);
Include file for GCC compiler.
Include file for GCC compiler.
C
mit
grzegorz-kraszewski/libvstring
394d5c9d3ae0f8e3ff40ae98a3eeab43004c85e6
src/interrupts.h
src/interrupts.h
#ifndef INTERRUPTS_H #define INTERRUPTS_H #include "types.h" namespace interrupts { // Enable interrupts on the CPU. inline void enable() { asm volatile("sti"); } // Enable interrupts on the CPU. inline void disable() { asm volatile("cli"); } struct Registers { u32 gs, fs, es, ds; // Segment registers. u32 edi, esi, ebp, esp, ebx, edx, ecx, eax; // From 'pusha' instruction. u32 interruptNum; u32 eip, cs, eflags, useresp, ss; // Pushed by CPU on interrupt. }; using IrqHandlerFn = void (*)(Registers*); void setIrqHandler(u32 irqNum, IrqHandlerFn handlerFn); void init(); void initIsrs(); void initIrqs(); void remapPic(); extern "C" void interruptHandler(Registers* regs); } // namespace interrupts #endif
#ifndef INTERRUPTS_H #define INTERRUPTS_H #include "types.h" namespace interrupts { // Enable interrupts on the CPU. inline void enable() { asm volatile("sti"); } // Enable interrupts on the CPU. inline void disable() { asm volatile("cli"); } struct Registers { u32 gs, fs, es, ds; // Segment registers. u32 edi, esi, ebp, esp, ebx, edx, ecx, eax; // From 'pusha' instruction. u32 interruptNum; u32 eip, cs, eflags, useresp, ss; // Pushed by CPU on interrupt. }; using IrqHandlerFn = void (*)(Registers*); void setIrqHandler(u32 irqNum, IrqHandlerFn handlerFn); void init(); void remapPic(); extern "C" void interruptHandler(Registers* regs); } // namespace interrupts #endif
Remove prototypes for removed functions.
Remove prototypes for removed functions.
C
isc
tsion/spideros,tsion/spideros,tsion/spideros
51d711cd48cd5b6c20474f1cb2e0a91a882d54e4
concept.h
concept.h
template <class Key, class T> struct map { using size_type = std::size_t; map(size_type bucket_count = /* some default */); using value_type = std::pair<const Key, T>; iterator begin(); const_iterator begin() const; iterator end(); const_iterator end() const; // Args are arguments to constructing a value_type template <class... Args> iterator emplace(Args &&...args); iterator find(const Key &); const iterator find(const Key &) const; iterator erase(const_iterator); size_type size() const; size_type bucket_count() const; float load_factor() const; float max_load_factor() const; void max_load_factor(float); };
Write rough interface for a map class template
Write rough interface for a map class template
C
mit
tenyoung795/bu2016-cs375-project,tenyoung795/bu2016-cs375-project,tenyoung795/bu2016-cs375-project
ecb3408d04ba37946ade705c43870c9405b564de
Include.h
Include.h
#ifndef INCLUDE_H #define INCLUDE_H using namespace std; struct LibrarySwitch { bool cstdlib = false; bool csignal = false; bool csetjmp = false; bool cstdarg = false; bool typeinfo = false; bool type_traits = false; bool bitset = false; bool functional = false; bool utility = false; bool ctime = false; bool chrono = false; bool cstddef = false; bool initalizer_list = false; bool tuple = false; bool _new_ = false; bool memory = false; bool scoped_allocator = false; bool climits = false; bool cfloat = false; bool cstdint = false; bool cinttypes = false; bool limits = false; bool exception = false; bool stdexcept = false; bool cassert = false; bool system_error = false; bool cerrno = false; bool cctype = false; bool cwtype = false; bool cstring = false; bool cwchar = false; bool string = false; bool vector = false; bool deque = false; bool list = false; bool forward_list = false; bool set = false; bool map = false; bool unordered_set = false; bool unordered_map = false; bool stack = false; bool queue = false; bool algorithm = false; bool iterator = false; bool cmath = false; bool complex = false; bool valarray = false; bool random = false; bool numeric = false; bool ratio = false; bool cfenv = false; bool iosfwd = false; bool ios = false; bool istream = false; bool ostream = false; bool iostream = false; bool fstream = false; bool sstream = false; bool strstream = false; bool iomanip = false; bool streambuf = false; bool cstdio = false; bool locale = false; bool clocal = false; bool codecvt = false; bool regex = false; bool atomic = false; bool thread = false; bool mutex = false; bool shared_mutex = false; bool future = false; bool condition_variable = false; }; LibrarySwitch Library; // IOSTREAM int CHECKFORIOSTREAM(string ProcessInput) { if (ProcessInput.find("#include <iostream>") != string::npos) { cout << "iostream is now included\n\n"; Library.iostream = true; } return 0; } #endif // !INCLUDE_H
Add interpreter include list and iostream prototype
Add interpreter include list and iostream prototype This will be used for so that the interpreter can check if you included the libraries that your function will need to be able to work. This will be like it would in the compiled version of C++ code. I'm fixing to implement a switch to allow this feature to be disabled as well. That being said I also added another algorithm used to register the include file of iostream. But that was a prototype and because it needs to be universal to work with all of the C++ include libraries. This algorithm will need some touch ups to make it that way.
C
mit
Project-CPP/CPP-Interpreter
9e95b48056e92ab1c67ee15e55e3662727154267
src/components/appio/tests/appio_test_blocking.c
src/components/appio/tests/appio_test_blocking.c
/* * Test case for appio * Author: Tushar Mohan * [email protected] * * Description: This test case reads from standard linux /etc/group * and writes the output to stdout. * Statistics are printed at the end of the run., */ #include <papi.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include "papi_test.h" #define NUM_EVENTS 12 int main(int argc, char** argv) { int Events[NUM_EVENTS]; const char* names[NUM_EVENTS] = {"OPEN_CALLS", "OPEN_FDS", "READ_CALLS", "READ_BYTES", "READ_USEC", "READ_ERR", "READ_INTERRUPTED", "READ_WOULD_BLOCK", "WRITE_CALLS","WRITE_BYTES","WRITE_USEC", "WRITE_WOULD_BLOCK"}; long long values[NUM_EVENTS]; int version = PAPI_library_init (PAPI_VER_CURRENT); if (version != PAPI_VER_CURRENT) { fprintf(stderr, "PAPI_library_init version mismatch\n"); exit(1); } if (!TESTS_QUIET) fprintf(stderr, "This program will read from stdin and echo it to stdout\n"); int retval; int e; for (e=0; e<NUM_EVENTS; e++) { retval = PAPI_event_name_to_code((char*)names[e], &Events[e]); if (retval != PAPI_OK) { fprintf(stderr, "Error getting code for %s\n", names[e]); exit(2); } } /* Start counting events */ if (PAPI_start_counters(Events, NUM_EVENTS) != PAPI_OK) { fprintf(stderr, "Error in PAPI_start_counters\n"); exit(1); } int bytes = 0; char buf[1024]; //if (PAPI_read_counters(values, NUM_EVENTS) != PAPI_OK) // handle_error(1); //printf("After reading the counters: %lld\n",values[0]); while ((bytes = read(0, buf, 1024)) > 0) { write(1, buf, bytes); } /* Stop counting events */ if (PAPI_stop_counters(values, NUM_EVENTS) != PAPI_OK) { fprintf(stderr, "Error in PAPI_stop_counters\n"); } if (!TESTS_QUIET) { printf("----\n"); for (e=0; e<NUM_EVENTS; e++) printf("%s: %lld\n", names[e], values[e]); } test_pass( __FILE__, NULL, 0 ); return 0; }
Use a non-blocking select to determine which reads and writes would block
Use a non-blocking select to determine which reads and writes would block
C
bsd-3-clause
pyrovski/papi,arm-hpc/papi,arm-hpc/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,arm-hpc/papi,pyrovski/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,pyrovski/papi,arm-hpc/papi,pyrovski/papi,arm-hpc/papi
ef0e80e41dafccc5d3b64b37d150b4cee858997e
src/alpha-memory.c
src/alpha-memory.c
#include "papi.h" int get_memory_info( PAPI_mem_info_t * mem_info ){ int retval = 0; return PAPI_OK; } long _papi_hwd_get_dmem_info(int option){ }
#include "papi.h" #include <sys/procfs.h> #include <stdio.h> #include <fcntl.h> int get_memory_info( PAPI_mem_info_t * mem_info ){ int retval = 0; return PAPI_OK; } long _papi_hwd_get_dmem_info(int option){ pid_t pid = getpid(); prpsinfo_t info; char pfile[256]; int fd; sprintf(pfile, "/proc/%05d", pid); if((fd=open(pfile,O_RDONLY)) <0 ) { DBG((stderr,"PAPI_get_dmem_info can't open /proc/%d\n",pid)); return(PAPI_ESYS); } if(ioctl(fd, PIOCPSINFO, &info)<0){ return(PAPI_ESYS); } close(fd); switch(option){ case PAPI_GET_RESSIZE: return(info.pr_rssize); case PAPI_GET_SIZE: return(info.pr_size); default: return(PAPI_EINVAL); } }
Support for dynamic memory information added for Alpha
Support for dynamic memory information added for Alpha
C
bsd-3-clause
pyrovski/papi,arm-hpc/papi,pyrovski/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,arm-hpc/papi,arm-hpc/papi,arm-hpc/papi
613d7f23227b5b763e3ebe58442b5edaefe324ba
lib/debug_msg.c
lib/debug_msg.c
/** * @file debug_msg.c Debug Message function */ /* $Id$ */ #include "gangliaconf.h" int debug_level = 0; /** * @fn void debug_msg(const char *format, ...) * Prints the message to STDERR if DEBUG is #defined * @param format The format of the msg (see printf manpage) * @param ... Optional arguments */ void debug_msg(const char *format, ...) { if (debug_level && format) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); fprintf(stderr,"\n"); va_end(ap); } return; }
/** * @file debug_msg.c Debug Message function */ /* $Id$ */ #include "gangliaconf.h" int debug_level = 0; /** * @fn void debug_msg(const char *format, ...) * Prints the message to STDERR if DEBUG is #defined * @param format The format of the msg (see printf manpage) * @param ... Optional arguments */ void debug_msg(const char *format, ...) { if (debug_level > 1 && format) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); fprintf(stderr,"\n"); va_end(ap); } return; }
Debug level 1 now only shows error messages (and no backgrounding in gmetad).
Debug level 1 now only shows error messages (and no backgrounding in gmetad).
C
bsd-3-clause
phreakocious/monitor-core,phreakocious/monitor-core,mjzhou/monitor-core,lawrencewu/monitor-core,dmourati/monitor-core,phreakocious/monitor-core,fastly/monitor-core,fastly/monitor-core,lawrencewu/monitor-core,ganglia/monitor-core,torkelsson/monitor-core,phreakocious/monitor-core,ganglia/monitor-core,fastly/monitor-core,dmourati/monitor-core,fastly/monitor-core,hinesmr/monitor-core,dmourati/monitor-core,NoodlesNZ/monitor-core,hinesmr/monitor-core,sdgdsffdsfff/monitor-core,torkelsson/monitor-core,NoodlesNZ/monitor-core,torkelsson/monitor-core,mjzhou/monitor-core,lawrencewu/monitor-core,NoodlesNZ/monitor-core,torkelsson/monitor-core,NoodlesNZ/monitor-core,ganglia/monitor-core,phreakocious/monitor-core,hinesmr/monitor-core,torkelsson/monitor-core,NoodlesNZ/monitor-core,phreakocious/monitor-core,sdgdsffdsfff/monitor-core,lawrencewu/monitor-core,mjzhou/monitor-core,hinesmr/monitor-core,sdgdsffdsfff/monitor-core,mjzhou/monitor-core,fastly/monitor-core,mjzhou/monitor-core,torkelsson/monitor-core,ganglia/monitor-core,ganglia/monitor-core,sdgdsffdsfff/monitor-core,ganglia/monitor-core,NoodlesNZ/monitor-core,mjzhou/monitor-core,lawrencewu/monitor-core,ganglia/monitor-core,lawrencewu/monitor-core,sdgdsffdsfff/monitor-core,mjzhou/monitor-core,dmourati/monitor-core,torkelsson/monitor-core,ganglia/monitor-core,sdgdsffdsfff/monitor-core,dmourati/monitor-core,fastly/monitor-core,dmourati/monitor-core,hinesmr/monitor-core,lawrencewu/monitor-core,NoodlesNZ/monitor-core,sdgdsffdsfff/monitor-core,phreakocious/monitor-core,fastly/monitor-core
1c48a973b28eeb5747e5c0780a7bc0a1ad1b3b09
src/config.h
src/config.h
#include "can/canutil.h" namespace openxc { namespace config { typedef struct { int messageSetIndex; } Configuration; Configuration CONFIG; } // namespace config } // namespace openxc
#ifndef _CONFIG_H_ #define _CONFIG_H_ #include "can/canutil.h" namespace openxc { namespace config { typedef struct { int messageSetIndex; } Configuration; static Configuration CONFIG; } // namespace config } // namespace openxc #endif // _CONFIG_H_
Make sure CONFIG is static and only imported once.
Make sure CONFIG is static and only imported once.
C
bsd-3-clause
mgiannikouris/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware,ene-ilies/vi-firmware,mgiannikouris/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware,mgiannikouris/vi-firmware,mgiannikouris/vi-firmware,openxc/vi-firmware
8a879a16cffbd6e379ea041f759d1f7fa1631496
test/C++Frontend/2003-05-22-LocalTypeTest.c
test/C++Frontend/2003-05-22-LocalTypeTest.c
struct sometimes { short offset; short bit; short live_length; short calls_crossed; } Y; int main() { struct sometimes { int X, Y; } S; S.X = 1; return Y.offset; }
#include <stdio.h> struct sometimes { short offset; short bit; short live_length; short calls_crossed; } Y; int main() { int X; { struct sometimes { int X, Y; } S; S.X = 1; X = S.X; } { struct sometimes { char X; } S; S.X = -1; X += S.X; } X += Y.offset; printf("Result is %d\n", X); return X; }
Make the testcase even more insane
Make the testcase even more insane git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@6280 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap
2e2d03c70274bba1fa762e123842994238f68f41
test/Sema/warn-missing-variable-declarations.c
test/Sema/warn-missing-variable-declarations.c
// RUN: %clang -Wmissing-variable-declarations -fsyntax-only -Xclang -verify %s int vbad1; // expected-warning{{no previous extern declaration for non-static variable 'vbad1'}} int vbad2; int vbad2 = 10; // expected-warning{{no previous extern declaration for non-static variable 'vbad2'}} struct { int mgood1; } vbad3; // expected-warning{{no previous extern declaration for non-static variable 'vbad3'}} int vbad4; int vbad4 = 10; // expected-warning{{no previous extern declaration for non-static variable 'vbad4'}} extern int vbad4; extern int vgood1; int vgood1; int vgood1 = 10; // RUN: %clang -Wmissing-variable-declarations -fsyntax-only -Xclang -verify %s int vbad1; // expected-warning{{no previous extern declaration for non-static variable 'vbad1'}} int vbad2; int vbad2 = 10; // expected-warning{{no previous extern declaration for non-static variable 'vbad2'}} struct { int mgood1; } vbad3; // expected-warning{{no previous extern declaration for non-static variable 'vbad3'}} int vbad4; int vbad4 = 10; // expected-warning{{no previous extern declaration for non-static variable 'vbad4'}} extern int vbad4; extern int vgood1; int vgood1; int vgood1 = 10;
// RUN: %clang -Wmissing-variable-declarations -fsyntax-only -Xclang -verify %s int vbad1; // expected-warning{{no previous extern declaration for non-static variable 'vbad1'}} int vbad2; int vbad2 = 10; // expected-warning{{no previous extern declaration for non-static variable 'vbad2'}} struct { int mgood1; } vbad3; // expected-warning{{no previous extern declaration for non-static variable 'vbad3'}} int vbad4; int vbad4 = 10; // expected-warning{{no previous extern declaration for non-static variable 'vbad4'}} extern int vbad4; extern int vgood1; int vgood1; int vgood1 = 10;
Delete junk that snuck into r166498.
Delete junk that snuck into r166498. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@166499 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
8aeecdc8e131ee74d891017b628181409330f509
bincookie.h
bincookie.h
#ifndef _BINCOOKIE_H #define _BINCOOKIE_H #if defined(_MSC_VER) #define uint32_t DWORD #else #include <stdint.h> #endif #define binarycookies_is_secure(cookie_ptr) (cookie_ptr->flags & secure) #define binarycookies_domain_access_full(cookie_ptr) (cookie_ptr->domain[0] == '.') typedef enum { secure = 1, http_only = 1 << 2, } binarycookies_flag; typedef struct { uint32_t size; unsigned char unk1[4]; binarycookies_flag flags; unsigned char unk2[4]; double creation_date; double expiration_date; char *domain; char *name; char *path; char *value; } binarycookies_cookie_t; typedef struct { unsigned char unk1[4]; // always 0x0 0x0 0x1 0x0 uint32_t number_of_cookies; binarycookies_cookie_t **cookies; } binarycookies_page_t; typedef struct { unsigned char magic[4]; // "cook" uint32_t num_pages; uint32_t *page_sizes; char **raw_pages; binarycookies_page_t **pages; } binarycookies_t; binarycookies_t *binarycookies_init(const char *file_path); void binarycookies_free(binarycookies_t *cfile); #endif // _BINCOOKIE_H
#ifndef _BINCOOKIE_H #define _BINCOOKIE_H #if defined(_MSC_VER) #define uint32_t DWORD #else #include <stdint.h> #endif #include <time.h> #define binarycookies_is_secure(cookie_ptr) (cookie_ptr->flags & secure) #define binarycookies_domain_access_full(cookie_ptr) (cookie_ptr->domain[0] == '.') typedef enum { secure = 1, http_only = 1 << 2, } binarycookies_flag; typedef struct { uint32_t size; unsigned char unk1[4]; binarycookies_flag flags; unsigned char unk2[4]; time_t creation_time; time_t expiration_time; char *domain; char *name; char *path; char *value; } binarycookies_cookie_t; typedef struct { unsigned char unk1[4]; // always 0x0 0x0 0x1 0x0 uint32_t number_of_cookies; binarycookies_cookie_t **cookies; } binarycookies_page_t; typedef struct { unsigned char magic[4]; // "cook" uint32_t num_pages; uint32_t *page_sizes; char **raw_pages; binarycookies_page_t **pages; } binarycookies_t; binarycookies_t *binarycookies_init(const char *file_path); void binarycookies_free(binarycookies_t *cfile); #endif // _BINCOOKIE_H
Change time type from double to time_t
Change time type from double to time_t
C
mit
Tatsh/libbinarycookies,Tatsh/libbinarycookies
8080671a54f759e5d3ad8158b56c4db9e295feac
helloworld.c
helloworld.c
#include <stdio.h> // This test program is provided to enable a quick test of PDCLib's console I/O // functions int main(int argc, char** argv) { printf("Hello world\n"); }
Add hello world file which can be used to establish that the I/O routines are working
Add hello world file which can be used to establish that the I/O routines are working
C
cc0-1.0
blanham/PDChickenLib,blanham/PDCLib,blanham/PDChickenLib,blanham/PDCLib,blanham/PDCLib,blanham/PDChickenLib
8beb08cb2432f73348ea370c556f4daeccdcaf36
type-offset.c
type-offset.c
#include <sys/types.h> #include <stdio.h> #include <limits.h> int main (void) { const unsigned long long bits = sizeof (off_t) * CHAR_BIT; const unsigned long long shift_bits = bits - 2; const unsigned long long off_max = 1LL << shift_bits; (void) printf (" type Offset_t is range -%llu .. %llu;\n", off_max, off_max); (void) printf (" for Offset_t'Size use %llu;\n", bits); (void) printf (" pragma Convention (C, Offset_t);\n"); return 0; }
#include <sys/types.h> #include <stdio.h> #include <limits.h> int main (void) { const unsigned long long bits = sizeof (off_t) * CHAR_BIT; const unsigned long long shift_bits = bits - 1; const unsigned long long off_max = 1LL << shift_bits; (void) printf (" type Offset_t is range -%llu .. %llu;\n", off_max, off_max); (void) printf (" for Offset_t'Size use %llu;\n", bits); (void) printf (" pragma Convention (C, Offset_t);\n"); return 0; }
Fix to 64 bit offsets.
Fix to 64 bit offsets.
C
isc
io7m/coreland-posix-ada,io7m/coreland-posix-ada,io7m/coreland-posix-ada
4eb1bb8f4756e8afe1362d1bb95e8491cabdf332
src/posix_clock.c
src/posix_clock.c
#define _POSIX_C_SOURCE 199309L #include <unistd.h> #include <time.h> #include <stdio.h> #ifdef _POSIX_TIMERS static clockid_t clock_type; #endif /** Checks whether we have support for POSIX timers on this system. Sets the clock type and queries the resolution (in seconds). Returns 1 if POSIX timers are supported and 0 otherwise */ int posix_clock_init(double *res){ int ierr; struct timespec ts; #ifdef _POSIX_TIMERS #ifdef _POSIX_MONOTONIC_CLOCK clock_type = CLOCK_MONOTONIC; #else clock_type = CLOCK_REALTIME; #endif ierr = clock_getres(clock_type, &ts); *res = (double)(ts.tv_sec) + 1.0e-9*ts.tv_nsec; return 1; #else /* This system doesn't have support for POSIX timers */ fprintf(stderr, "TIMING: ERROR: POSIX TIMERS not available.\n"); *res = 0.0; return 0; #endif } /** Returns the current time (in seconds) as measured by the clock selected in posix_clock_init() */ double posix_clock(void){ int ierr; struct timespec ts; double tnow; #ifdef _POSIX_TIMERS ierr = clock_gettime(clock_type, &ts); tnow = (double)(ts.tv_sec) + 1.0e-9*ts.tv_nsec; #else tnow = 0.0; #endif return tnow; }
Add source for posix timing
Add source for posix timing
C
mit
schreiberx/perf_regions,schreiberx/perf_regions,schreiberx/perf_regions,schreiberx/perf_regions
16e0b0cb9c40169a646660f492617c037e8acafe
lelib/lelib.h
lelib/lelib.h
// // lelib.h // lelib // // Created by Petr on 27.10.13. // Copyright (c) 2013,2014 Logentries. All rights reserved. // #ifndef LE_DEBUG_LOGS #ifdef DEBUG #define LE_DEBUG_LOGS 1 #else #define LE_DEBUG_LOGS 0 #endif #endif #if LE_DEBUG_LOGS #define LE_DEBUG(...) NSLog(__VA_ARGS__) #else #define LE_DEBUG(...) #endif #import "LELog.h" #import "lecore.h"
// // lelib.h // lelib // // Created by Petr on 27.10.13. // Copyright (c) 2013,2014 Logentries. All rights reserved. // #ifndef LE_DEBUG_LOGS // #ifdef DEBUG // #define LE_DEBUG_LOGS 1 // #else #define LE_DEBUG_LOGS 0 // #endif #endif #if LE_DEBUG_LOGS #define LE_DEBUG(...) NSLog(__VA_ARGS__) #else #define LE_DEBUG(...) #endif #import "LELog.h" #import "lecore.h"
Disable LE's own debug log spam
Disable LE's own debug log spam
C
mit
JohnLemberger/le_ios
ef157b1acb6dbc241b4b9d2f834164e0858f21a9
src/lib/lib.h
src/lib/lib.h
#ifndef __LIB_H #define __LIB_H /* default lib includes */ #ifdef HAVE_CONFIG_H # include "config.h" #endif /* default system includes - keep these at minimum.. */ #include <string.h> /* strcmp() etc. */ #ifdef HAVE_STRINGS_H # include <strings.h> /* strcasecmp() etc. */ #endif #include <stdarg.h> /* va_list is used everywhere */ #include <limits.h> /* INT_MAX, etc. */ #include <errno.h> /* error checking is good */ #include <sys/types.h> /* many other includes want this */ #ifdef HAVE_STDINT_H # include <stdint.h> /* C99 int types, we mostly need uintmax_t */ #endif #include "compat.h" #include "macros.h" #include "failures.h" #include "data-stack.h" #include "mempool.h" #include "imem.h" typedef struct buffer buffer_t; typedef struct buffer string_t; struct istream; struct ostream; #include "array-decl.h" /* ARRAY_DEFINE()s may exist in any header */ #include "strfuncs.h" size_t nearest_power(size_t num); void lib_init(void); void lib_deinit(void); #endif
#ifndef __LIB_H #define __LIB_H /* default lib includes */ #ifdef HAVE_CONFIG_H # include "config.h" #endif /* default system includes - keep these at minimum.. */ #include <stddef.h> /* Solaris defines NULL wrong unless this is used */ #include <string.h> /* strcmp() etc. */ #ifdef HAVE_STRINGS_H # include <strings.h> /* strcasecmp() etc. */ #endif #include <stdarg.h> /* va_list is used everywhere */ #include <limits.h> /* INT_MAX, etc. */ #include <errno.h> /* error checking is good */ #include <sys/types.h> /* many other includes want this */ #ifdef HAVE_STDINT_H # include <stdint.h> /* C99 int types, we mostly need uintmax_t */ #endif #include "compat.h" #include "macros.h" #include "failures.h" #include "data-stack.h" #include "mempool.h" #include "imem.h" typedef struct buffer buffer_t; typedef struct buffer string_t; struct istream; struct ostream; #include "array-decl.h" /* ARRAY_DEFINE()s may exist in any header */ #include "strfuncs.h" size_t nearest_power(size_t num); void lib_init(void); void lib_deinit(void); #endif
Include stddef.h always to make NULL expand correctly in Solaris.
Include stddef.h always to make NULL expand correctly in Solaris.
C
mit
Distrotech/dovecot,damoxc/dovecot,damoxc/dovecot,damoxc/dovecot,Distrotech/dovecot,damoxc/dovecot,Distrotech/dovecot,damoxc/dovecot,Distrotech/dovecot,Distrotech/dovecot
00c99f556862333b85c4e2b6df87f8af95272b22
src/map/map.h
src/map/map.h
/* * Copyright (C) 2015 Luke San Antonio * All rights reserved. */ #pragma once #include "../common/vec.h" #include "structure.h" #include "../gfx/immediate_renderer.h" namespace game { using pos_t = Vec<float>; struct Structure_Instance { Structure_Instance(Structure const&, pos_t pos) noexcept; ~Structure_Instance() noexcept = default; void set_structure_type(Structure const& s) noexcept; Structure const& structure() const noexcept; pos_t position; private: Structure const* s_type_; }; void render_structure(gfx::IDriver& d, Structure const& st, pos_t pos) noexcept; inline void render_structure_instance(gfx::IDriver& d, Structure_Instance const& st) noexcept { render_structure(d, st.structure(), st.position); } struct Map { Map(Vec<float> map_extents) noexcept : extents(map_extents) {} std::vector<Structure_Instance> structures; Vec<float> extents; }; bool try_structure_place(Map& map, Structure const& st, pos_t pos, gfx::Immediate_Renderer* = nullptr) noexcept; }
/* * Copyright (C) 2015 Luke San Antonio * All rights reserved. */ #pragma once #include "../common/vec.h" #include "structure.h" #include "../gfx/immediate_renderer.h" namespace game { using pos_t = Vec<float>; struct Structure_Instance { Structure_Instance(Structure const&, pos_t pos) noexcept; ~Structure_Instance() noexcept = default; void set_structure_type(Structure const& s) noexcept; Structure const& structure() const noexcept; pos_t position; private: Structure const* s_type_; }; void render_structure(gfx::IDriver& d, Structure const& st, pos_t pos) noexcept; inline void render_structure_instance(gfx::IDriver& d, Structure_Instance const& st) noexcept { render_structure(d, st.structure(), st.position); } struct Map { Map(Vec<float> map_extents) noexcept : extents(map_extents) {} boost::optional<Structure_Instance> pending_structure; std::vector<Structure_Instance> structures; Vec<float> extents; }; bool try_structure_place(Map& map, Structure const& st, pos_t pos, gfx::Immediate_Renderer* = nullptr) noexcept; }
Add a member to Map for the pending structure
Add a member to Map for the pending structure
C
bsd-3-clause
RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine
98e5b672422ca1e38ca38ff0357cee6cc936aee0
lang/cpp/src/gpgmepp_export.h
lang/cpp/src/gpgmepp_export.h
#ifndef GPGMEPP_EXPORT_H #define GPGMEPP_EXPORT_H #ifdef GPGMEPP_STATIC_DEFINE # define GPGMEPP_EXPORT # define GPGMEPP_NO_EXPORT #else # ifndef GPGMEPP_EXPORT # ifdef KF5Gpgmepp_EXPORTS /* We are building this library */ # define GPGMEPP_EXPORT __attribute__((visibility("default"))) # else /* We are using this library */ # define GPGMEPP_EXPORT __attribute__((visibility("default"))) # endif # endif # ifndef GPGMEPP_NO_EXPORT # define GPGMEPP_NO_EXPORT __attribute__((visibility("hidden"))) # endif #endif #ifndef GPGMEPP_DEPRECATED # define GPGMEPP_DEPRECATED __attribute__ ((__deprecated__)) #endif #ifndef GPGMEPP_DEPRECATED_EXPORT # define GPGMEPP_DEPRECATED_EXPORT GPGMEPP_EXPORT GPGMEPP_DEPRECATED #endif #ifndef GPGMEPP_DEPRECATED_NO_EXPORT # define GPGMEPP_DEPRECATED_NO_EXPORT GPGMEPP_NO_EXPORT GPGMEPP_DEPRECATED #endif #define DEFINE_NO_DEPRECATED 0 #if DEFINE_NO_DEPRECATED # define GPGMEPP_NO_DEPRECATED #endif #endif
#ifndef GPGMEPP_EXPORT_H #define GPGMEPP_EXPORT_H #ifdef GPGMEPP_STATIC_DEFINE # define GPGMEPP_EXPORT # define GPGMEPP_NO_EXPORT #else # ifndef GPGMEPP_EXPORT # ifdef BUILDING_GPGMEPP /* We are building this library */ # ifdef WIN32 # define GPGMEPP_EXPORT __declspec(dllexport) # else # define GPGMEPP_EXPORT __attribute__((visibility("default"))) # endif # else /* We are using this library */ # ifdef WIN32 # define GPGMEPP_EXPORT __declspec(dllimport) # else # define GPGMEPP_EXPORT __attribute__((visibility("default"))) # endif # endif # endif # ifndef GPGMEPP_NO_EXPORT # ifdef WIN32 # define GPGMEPP_NO_EXPORT # else # define GPGMEPP_NO_EXPORT __attribute__((visibility("hidden"))) # endif # endif #endif #ifndef GPGMEPP_DEPRECATED # define GPGMEPP_DEPRECATED __attribute__ ((__deprecated__)) #endif #ifndef GPGMEPP_DEPRECATED_EXPORT # define GPGMEPP_DEPRECATED_EXPORT GPGMEPP_EXPORT GPGMEPP_DEPRECATED #endif #ifndef GPGMEPP_DEPRECATED_NO_EXPORT # define GPGMEPP_DEPRECATED_NO_EXPORT GPGMEPP_NO_EXPORT GPGMEPP_DEPRECATED #endif #define DEFINE_NO_DEPRECATED 0 #if DEFINE_NO_DEPRECATED # define GPGMEPP_NO_DEPRECATED #endif #endif
Fix export header and windows export macros
Fix export header and windows export macros * lang/cpp/src/gpgme_export.h: Fix variable name. Add Windows ifdefs.
C
lgpl-2.1
gpg/gpgme,gpg/gpgme,gpg/gpgme,gpg/gpgme,gpg/gpgme,gpg/gpgme,gpg/gpgme
1ad4a72ba51234a45e3e3a294676e1ab3e758d0e
lab5-btree-in-c/bTree.h
lab5-btree-in-c/bTree.h
#ifndef __STACK__ #define __STACK__ struct btreeNode { int data; struct btreeNode * left; struct btreeNode * right; }; typedef struct btreeNode * btreeNode_t; typedef struct { btreeNode_t root; }btree; typedef btree * btree_t; btree_t newTree(void); int addNode(btree_t, int); void inOrder(btree_t); #endif
#ifndef __STACK__ #define __STACK__ struct btreeNode { int data; struct btreeNode * left; struct btreeNode * right; }; typedef struct btreeNode * btreeNode_t; typedef struct { btreeNode_t root; }btree; typedef btree * btree_t; btree_t newTree(void); int addNode(btree_t, int); void inOrder(btree_t); void inOrder_iter(btree_t); #endif
Add inOrder_iter() signature to header
Add inOrder_iter() signature to header
C
mit
NirmalL/AlgorithmsLabs,NirmalL/AlgorithmsLabs,NirmalL/AlgorithmsLabs
ff9686efe890dfd8bb0735664582625c1b17b495
lib/neatogen/delaunay.h
lib/neatogen/delaunay.h
/* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (c) 1994-2004 AT&T Corp. * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Corp. * * * * Information and Software Systems Research * * AT&T Research, Florham Park NJ * **********************************************************/ #ifndef DELAUNAY_H #define DELAUNAY_H #include "sparsegraph.h" v_data *delaunay_triangulation(double *x, double *y, int n); int *delaunay_tri (double *x, double *y, int n, int* nedges); v_data *UG_graph(double *x, double *y, int n, int accurate_computation); #endif
Integrate topfish and sfdp into main tree, using GTS for triangulation; remove duplicated code
Integrate topfish and sfdp into main tree, using GTS for triangulation; remove duplicated code
C
epl-1.0
jho1965us/graphviz,jho1965us/graphviz,jho1965us/graphviz,tkelman/graphviz,jho1965us/graphviz,ellson/graphviz,ellson/graphviz,kbrock/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,tkelman/graphviz,MjAbuz/graphviz,pixelglow/graphviz,jho1965us/graphviz,kbrock/graphviz,jho1965us/graphviz,ellson/graphviz,pixelglow/graphviz,MjAbuz/graphviz,ellson/graphviz,kbrock/graphviz,tkelman/graphviz,tkelman/graphviz,kbrock/graphviz,pixelglow/graphviz,jho1965us/graphviz,BMJHayward/graphviz,ellson/graphviz,pixelglow/graphviz,ellson/graphviz,pixelglow/graphviz,ellson/graphviz,pixelglow/graphviz,BMJHayward/graphviz,jho1965us/graphviz,jho1965us/graphviz,MjAbuz/graphviz,tkelman/graphviz,pixelglow/graphviz,tkelman/graphviz,ellson/graphviz,kbrock/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,ellson/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,ellson/graphviz,BMJHayward/graphviz,kbrock/graphviz,kbrock/graphviz,MjAbuz/graphviz,ellson/graphviz,BMJHayward/graphviz,kbrock/graphviz,tkelman/graphviz,tkelman/graphviz,pixelglow/graphviz,jho1965us/graphviz,BMJHayward/graphviz,pixelglow/graphviz,pixelglow/graphviz,kbrock/graphviz,kbrock/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,tkelman/graphviz,tkelman/graphviz,tkelman/graphviz,pixelglow/graphviz,kbrock/graphviz,jho1965us/graphviz,MjAbuz/graphviz
674a7580b153119527f92582465524a09627c1e9
Tools/Parser/UnicodeVersion.h
Tools/Parser/UnicodeVersion.h
/* * Copyright (C) 2015 Muhammad Tayyab Akram * * 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 SHEENBIDI_PARSER_UNICODE_VERSION_H #define SHEENBIDI_PARSER_UNICODE_VERSION_H #include <string> namespace SheenBidi { namespace Parser { class UnicodeVersion { public: UnicodeVersion(const std::string &versionLine); int major() const; int minor() const; int micro() const; const std::string &versionString() const; private: int m_major; int m_minor; int m_micro; std::string m_versionString; }; } } #endif
/* * Copyright (C) 2015 Muhammad Tayyab Akram * * 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 SHEENBIDI_PARSER_UNICODE_VERSION_H #define SHEENBIDI_PARSER_UNICODE_VERSION_H #include <string> #ifdef major #undef major #endif #ifdef minor #undef minor #endif namespace SheenBidi { namespace Parser { class UnicodeVersion { public: UnicodeVersion(const std::string &versionLine); int major() const; int minor() const; int micro() const; const std::string &versionString() const; private: int m_major; int m_minor; int m_micro; std::string m_versionString; }; } } #endif
Fix warnings about major and minor macros
Fix warnings about major and minor macros Tools/Parser/UnicodeVersion.h:29:13: warning: In the GNU C Library, "major" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "major", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "major", you should undefine it after including <sys/types.h>. int major() const; ^~~~~~~~~~ In file included from Tools/Parser/BidiMirroring.h:24:0, from Tools/Tester/MirrorTester.cpp:26: Tools/Parser/UnicodeVersion.h:30:13: warning: In the GNU C Library, "minor" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "minor", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "minor", you should undefine it after including <sys/types.h>. int minor() const; ^~~~~~~~~~
C
apache-2.0
mta452/SheenBidi,mta452/SheenBidi
194dfdea3af930f0e16d5f3f34876cb1d5cc63a9
include/effects/SkArithmeticImageFilter.h
include/effects/SkArithmeticImageFilter.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 SkArithmeticImageFilter_DEFINED #define SkArithmeticImageFilter_DEFINED #include "include/core/SkImageFilter.h" struct ArithmeticFPInputs { ArithmeticFPInputs(float k0, float k1, float k2, float k3, bool enforcePMColor) { memset(this, 0, sizeof(*this)); fK[0] = k0; fK[1] = k1; fK[2] = k2; fK[3] = k3; fEnforcePMColor = enforcePMColor; } float fK[4]; bool fEnforcePMColor; }; // DEPRECATED: Use include/effects/SkImageFilters::Arithmetic class SK_API SkArithmeticImageFilter { public: static sk_sp<SkImageFilter> Make(float k1, float k2, float k3, float k4, bool enforcePMColor, sk_sp<SkImageFilter> background, sk_sp<SkImageFilter> foreground, const SkImageFilter::CropRect* cropRect); static void RegisterFlattenables(); private: SkArithmeticImageFilter(); // can't instantiate }; #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 SkArithmeticImageFilter_DEFINED #define SkArithmeticImageFilter_DEFINED #include "include/core/SkImageFilter.h" struct ArithmeticFPInputs { ArithmeticFPInputs(float k0, float k1, float k2, float k3, bool enforcePMColor) { // We copy instances of this struct as the input data blob for the SkSL FP. The FP // may try to access all of our bytes (for comparison purposes), so be sure to zero out // any padding after the dangling bool. memset(this, 0, sizeof(*this)); fK[0] = k0; fK[1] = k1; fK[2] = k2; fK[3] = k3; fEnforcePMColor = enforcePMColor; } float fK[4]; bool fEnforcePMColor; }; // DEPRECATED: Use include/effects/SkImageFilters::Arithmetic class SK_API SkArithmeticImageFilter { public: static sk_sp<SkImageFilter> Make(float k1, float k2, float k3, float k4, bool enforcePMColor, sk_sp<SkImageFilter> background, sk_sp<SkImageFilter> foreground, const SkImageFilter::CropRect* cropRect); static void RegisterFlattenables(); private: SkArithmeticImageFilter(); // can't instantiate }; #endif
Add comment explaining memset in ArithmeticFPInputs
Add comment explaining memset in ArithmeticFPInputs Change-Id: I1541e3f4629a117eee3f244c0209e442b705b67b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268844 Auto-Submit: Brian Osman <[email protected]> Reviewed-by: Brian Osman <[email protected]> Commit-Queue: Brian Osman <[email protected]>
C
bsd-3-clause
aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia
bedd7a18966bdfc10ec01d64e30aa359f217941a
android/hal-log.h
android/hal-log.h
/* * Copyright (C) 2013 Intel Corporation * * 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. * */ #define LOG_TAG "BlueZ" #ifdef __BIONIC__ #include <cutils/log.h> #else #include <stdio.h> #define LOG_INFO " I" #define LOG_WARN " W" #define LOG_ERROR " E" #define LOG_DEBUG " D" #define ALOG(pri, tag, fmt, arg...) printf(tag pri": " fmt"\n", ##arg) #endif #define info(fmt, arg...) ALOG(LOG_INFO, LOG_TAG, fmt, ##arg) #define warn(fmt, arg...) ALOG(LOG_WARN, LOG_TAG, fmt, ##arg) #define error(fmt, arg...) ALOG(LOG_ERROR, LOG_TAG, fmt, ##arg) #define DBG(fmt, arg...) ALOG(LOG_DEBUG, LOG_TAG, "%s:%s() "fmt, __FILE__, \ __func__, ##arg)
/* * Copyright (C) 2013 Intel Corporation * * 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. * */ #define LOG_TAG "BlueZ" #ifdef __BIONIC__ #include <cutils/log.h> #else #include <stdio.h> #define LOG_INFO " I" #define LOG_WARN " W" #define LOG_ERROR " E" #define LOG_DEBUG " D" #define ALOG(pri, tag, fmt, arg...) fprintf(stderr, tag pri": " fmt"\n", ##arg) #endif #define info(fmt, arg...) ALOG(LOG_INFO, LOG_TAG, fmt, ##arg) #define warn(fmt, arg...) ALOG(LOG_WARN, LOG_TAG, fmt, ##arg) #define error(fmt, arg...) ALOG(LOG_ERROR, LOG_TAG, fmt, ##arg) #define DBG(fmt, arg...) ALOG(LOG_DEBUG, LOG_TAG, "%s:%s() "fmt, __FILE__, \ __func__, ##arg)
Make HAL logging wrapper print to stderr instead of stdout
android/tester: Make HAL logging wrapper print to stderr instead of stdout This is used for testing and for user it makes no difference. This will allow to switch on/off verbose logging from automated android tester.
C
lgpl-2.1
pkarasev3/bluez,pkarasev3/bluez,silent-snowman/bluez,silent-snowman/bluez,pstglia/external-bluetooth-bluez,pkarasev3/bluez,mapfau/bluez,mapfau/bluez,mapfau/bluez,pstglia/external-bluetooth-bluez,ComputeCycles/bluez,mapfau/bluez,silent-snowman/bluez,ComputeCycles/bluez,pkarasev3/bluez,ComputeCycles/bluez,pstglia/external-bluetooth-bluez,ComputeCycles/bluez,silent-snowman/bluez,pstglia/external-bluetooth-bluez
7e8532edeb46a3b40c0260c4e2677e903f988fbd
include/llvm/Testing/Support/SupportHelpers.h
include/llvm/Testing/Support/SupportHelpers.h
//===- Testing/Support/SupportHelpers.h -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_TESTING_SUPPORT_SUPPORTHELPERS_H #define LLVM_TESTING_SUPPORT_SUPPORTHELPERS_H #include "llvm/ADT/StringRef.h" #include "llvm/Support/Error.h" namespace llvm { namespace detail { struct ErrorHolder { bool Success; std::string Message; }; template <typename T> struct ExpectedHolder : public ErrorHolder { Optional<T *> Value; }; inline void PrintTo(const ErrorHolder &Err, std::ostream *Out) { *Out << (Err.Success ? "succeeded" : "failed"); if (!Err.Success) { *Out << " (" << StringRef(Err.Message).trim().str() << ")"; } } template <typename T> void PrintTo(const ExpectedHolder<T> &Item, std::ostream *Out) { if (Item.Success) { *Out << "succeeded with value \"" << testing::PrintToString(**Item.Value) << "\""; } else { PrintTo(static_cast<const ErrorHolder &>(Item), Out); } } } // namespace detail } // namespace llvm #endif
//===- Testing/Support/SupportHelpers.h -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_TESTING_SUPPORT_SUPPORTHELPERS_H #define LLVM_TESTING_SUPPORT_SUPPORTHELPERS_H #include "llvm/ADT/StringRef.h" #include "llvm/Support/Error.h" #include "gtest/gtest-printers.h" namespace llvm { namespace detail { struct ErrorHolder { bool Success; std::string Message; }; template <typename T> struct ExpectedHolder : public ErrorHolder { Optional<T *> Value; }; inline void PrintTo(const ErrorHolder &Err, std::ostream *Out) { *Out << (Err.Success ? "succeeded" : "failed"); if (!Err.Success) { *Out << " (" << StringRef(Err.Message).trim().str() << ")"; } } template <typename T> void PrintTo(const ExpectedHolder<T> &Item, std::ostream *Out) { if (Item.Success) { *Out << "succeeded with value \"" << ::testing::PrintToString(**Item.Value) << "\""; } else { PrintTo(static_cast<const ErrorHolder &>(Item), Out); } } } // namespace detail } // namespace llvm #endif
Add an include of gtest-printers.h to appease the buildbots.
Add an include of gtest-printers.h to appease the buildbots. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@305396 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm
e174f652d9552b5ff5dd9d04ced0e28ba4d274cf
tests/fibonacci.c
tests/fibonacci.c
int fibonacci(int n) { if(n == 1) return 1; if(n == 2) return 1; int x = fibonacci(n - 1); int y = fibonacci(n - 2); return x + y; } void main() { return; }
int fibonacci(int n) { if(n == 1) return 1; if(n == 2) return 1; int x = fibonacci(n - 1); int y = fibonacci(n - 2); return x + y; } void main() { int n = readint(); writeint(fibonacci(n)); return; }
Add readint and writeint call.
Add readint and writeint call.
C
mit
RyanWangGit/scc
da10dd621c699fdccac5c4e618f31ea61a2ebb23
TimerDisplay.h
TimerDisplay.h
#ifndef TIMER_DISPLAY_H #define TIMER_DISPLAY_H #include <SevenSegmentExtended.h> class TimerDisplay : public SevenSegmentExtended { public: TimerDisplay(uint8_t pin_clk, uint8_t pin_dio); void on(); void off(); void start(); void stop(); void refresh(); private: unsigned long start_millis; bool is_running; static const unsigned long millis_per_second = 1000; static const unsigned long millis_per_minute = 60 * millis_per_second; static const unsigned long millis_per_hour = 60 * millis_per_minute; uint8_t millisToSeconds(unsigned long millis); uint8_t millisToMinutes(unsigned long millis); }; #endif
#ifndef TIMER_DISPLAY_H #define TIMER_DISPLAY_H #include <SevenSegmentExtended.h> class TimerDisplay : public SevenSegmentExtended { public: TimerDisplay(uint8_t pin_clk, uint8_t pin_dio); void on(); void off(); void start(); void stop(); void refresh(); private: unsigned long start_millis; bool is_running; static const unsigned long millis_per_second = 1000; static const unsigned long millis_per_minute = 60 * millis_per_second; static const unsigned long millis_per_hour = 60 * millis_per_minute; static uint8_t millisToSeconds(unsigned long millis); static uint8_t millisToMinutes(unsigned long millis); }; #endif
Make static some functions that should be static
Make static some functions that should be static
C
mit
mortenfyhn/coffee-scales
fddc41e81dda0627ccd9b6b998df57d62b8d2460
test/functional/c-shared-library/libtest.c
test/functional/c-shared-library/libtest.c
#ifdef __GNUC__ #define DLL_PUBLIC __attribute__ ((dllexport)) #else #define DLL_PUBLIC __declspec(dllexport) // Note: actually gcc seems to also supports this syntax. #endif DLL_PUBLIC int libtest_main() { return 0; }
#if defined(__GNUC__) || defined(__clang__) # define DLL_PUBLIC __attribute__ ((dllexport)) #else # define DLL_PUBLIC __declspec(dllexport) #endif DLL_PUBLIC int libtest_main() { return 0; }
Use gcc attribute for clang too.
test.functional.c-shared-library: Use gcc attribute for clang too.
C
bsd-3-clause
hotgloupi/configure,hotgloupi/configure,hotgloupi/configure,hotgloupi/configure,hotgloupi/configure
087a15380986981f0fcbab5a529edf355497907e
exercises/005-blink-without-timer.c
exercises/005-blink-without-timer.c
#include <inc/hw_types.h> #include <driverlib/sysctl.h> #include <stdio.h> #include <string.h> #include <inc/hw_memmap.h> #include <inc/hw_sysctl.h> #include <driverlib/gpio.h> #include <driverlib/debug.h> #define DEFAULT_STRENGTH GPIO_STRENGTH_2MA #define DEFAULT_PULL_TYPE GPIO_PIN_TYPE_STD_WPU #define PORT_E GPIO_PORTE_BASE #define PORT_F GPIO_PORTF_BASE #define PIN_0 GPIO_PIN_0 #define PIN_1 GPIO_PIN_1 #define PIN_2 GPIO_PIN_2 #define PIN_3 GPIO_PIN_3 #define HIGH 0xFF #define LOW 0x00 void hackDelay() { int i = 0; for (i = 0; i < 1000000; i++); } void setup() { SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE); GPIOPinTypeGPIOInput(PORT_E, PIN_0 | PIN_1 | PIN_2 | PIN_3); GPIOPadConfigSet(PORT_E, PIN_0 | PIN_1 | PIN_2 | PIN_3, DEFAULT_STRENGTH, DEFAULT_PULL_TYPE); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); GPIOPinTypeGPIOOutput(PORT_F, PIN_0 | PIN_1 | PIN_2 | PIN_3); GPIOPadConfigSet(PORT_F, PIN_0 | PIN_1 | PIN_2 | PIN_3, DEFAULT_STRENGTH, DEFAULT_PULL_TYPE); } int main(){ setup(); while (1) { GPIOPinWrite(PORT_F, PIN_0, HIGH); hackDelay(); GPIOPinWrite(PORT_F, PIN_0, LOW); GPIOPinWrite(PORT_F, PIN_2, LOW); hackDelay(); GPIOPinWrite(PORT_F, PIN_2, HIGH); GPIOPinWrite(PORT_F, PIN_3, LOW); hackDelay(); GPIOPinWrite(PORT_F, PIN_3, HIGH); } }
Add example with hack to delay without timer
feature: Add example with hack to delay without timer
C
mit
marceloboeira/unisinos-microprocessors
36e5254e4de0a03485b51f5b830db0ea65272e38
lib/Target/SparcV9/MappingInfo.h
lib/Target/SparcV9/MappingInfo.h
//===- lib/Target/SparcV9/MappingInfo.h -------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Data structures to support the Reoptimizer's Instruction-to-MachineInstr // mapping information gatherer. // //===----------------------------------------------------------------------===// #ifndef MAPPINGINFO_H #define MAPPINGINFO_H #include <iosfwd> #include <vector> #include <string> namespace llvm { class Pass; Pass *getMappingInfoAsmPrinterPass(std::ostream &out); class MappingInfo { struct byteVector : public std::vector <unsigned char> { void dumpAssembly (std::ostream &Out); }; std::string comment; std::string symbolPrefix; unsigned functionNumber; byteVector bytes; public: void outByte (unsigned char b) { bytes.push_back (b); } MappingInfo (std::string Comment, std::string SymbolPrefix, unsigned FunctionNumber) : comment(Comment), symbolPrefix(SymbolPrefix), functionNumber(FunctionNumber) {} void dumpAssembly (std::ostream &Out); unsigned char *getBytes (unsigned &length) { length = bytes.size(); return &bytes[0]; } }; } // End llvm namespace #endif
//===- lib/Target/SparcV9/MappingInfo.h -------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Data structures to support the Reoptimizer's Instruction-to-MachineInstr // mapping information gatherer. // //===----------------------------------------------------------------------===// #ifndef MAPPINGINFO_H #define MAPPINGINFO_H #include <iosfwd> #include <vector> #include <string> namespace llvm { class Pass; Pass *getMappingInfoAsmPrinterPass(std::ostream &out); Pass *createInternalGlobalMapperPass(); class MappingInfo { struct byteVector : public std::vector <unsigned char> { void dumpAssembly (std::ostream &Out); }; std::string comment; std::string symbolPrefix; unsigned functionNumber; byteVector bytes; public: void outByte (unsigned char b) { bytes.push_back (b); } MappingInfo (std::string Comment, std::string SymbolPrefix, unsigned FunctionNumber) : comment(Comment), symbolPrefix(SymbolPrefix), functionNumber(FunctionNumber) {} void dumpAssembly (std::ostream &Out); unsigned char *getBytes (unsigned &length) { length = bytes.size(); return &bytes[0]; } }; } // End llvm namespace #endif
Add decl. for new mapping info pass factory method.
Add decl. for new mapping info pass factory method. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@13979 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap
ec83646e392933afcd7c7686f6ad157ebe4d2769
os/include/tinyara/seclink_drv.h
os/include/tinyara/seclink_drv.h
#ifndef _SECLINK_DRV_H__ #define _SECLINK_DRV_H__ #include <stdint.h> struct sec_lowerhalf_s; struct sec_upperhalf_s { struct sec_lowerhalf_s *lower; char *path; int32_t refcnt; sem_t su_lock; }; struct sec_ops_s; struct sec_lowerhalf_s { struct sec_ops_s *ops; struct sec_upperhalf_s *parent; }; int se_register(const char *path, struct sec_lowerhalf_s *lower); int se_unregister(struct sec_lowerhalf_s *lower); #endif // _SECLINK_DRV_H__
#ifndef _SECLINK_DRV_H__ #define _SECLINK_DRV_H__ #include <stdint.h> #include <semaphore.h> struct sec_lowerhalf_s; struct sec_upperhalf_s { struct sec_lowerhalf_s *lower; char *path; int32_t refcnt; sem_t su_lock; }; struct sec_ops_s; struct sec_lowerhalf_s { struct sec_ops_s *ops; struct sec_upperhalf_s *parent; }; int se_register(const char *path, struct sec_lowerhalf_s *lower); int se_unregister(struct sec_lowerhalf_s *lower); #endif // _SECLINK_DRV_H__
Resolve build break for rtl8721csm/security_hal_test config.
include/tinyara: Resolve build break for rtl8721csm/security_hal_test config. This patch resolves build break for rtl8721csm/security_hal_test configuration. Signed-off-by: Vidisha <[email protected]>
C
apache-2.0
pillip8282/TizenRT,junmin-kim/TizenRT,jsdosa/TizenRT,junmin-kim/TizenRT,jsdosa/TizenRT,junmin-kim/TizenRT,jeongarmy/TizenRT,an4967/TizenRT,Samsung/TizenRT,pillip8282/TizenRT,junmin-kim/TizenRT,an4967/TizenRT,Samsung/TizenRT,Samsung/TizenRT,an4967/TizenRT,jeongchanKim/TizenRT,pillip8282/TizenRT,sunghan-chang/TizenRT,jeongarmy/TizenRT,jeongchanKim/TizenRT,jsdosa/TizenRT,jeongchanKim/TizenRT,jeongarmy/TizenRT,jsdosa/TizenRT,jeongarmy/TizenRT,Samsung/TizenRT,sunghan-chang/TizenRT,Samsung/TizenRT,Samsung/TizenRT,jeongchanKim/TizenRT,jeongarmy/TizenRT,sunghan-chang/TizenRT,jsdosa/TizenRT,jeongchanKim/TizenRT,jsdosa/TizenRT,an4967/TizenRT,pillip8282/TizenRT,Samsung/TizenRT,an4967/TizenRT,jeongchanKim/TizenRT,pillip8282/TizenRT,jsdosa/TizenRT,pillip8282/TizenRT,sunghan-chang/TizenRT,junmin-kim/TizenRT,jeongchanKim/TizenRT,an4967/TizenRT,pillip8282/TizenRT,jeongarmy/TizenRT,an4967/TizenRT,jeongarmy/TizenRT,sunghan-chang/TizenRT,junmin-kim/TizenRT,sunghan-chang/TizenRT,sunghan-chang/TizenRT,junmin-kim/TizenRT
4e11ac31897512ee8da99bede058c9666f2ed3d8
include/mart-common/exceptions.h
include/mart-common/exceptions.h
#ifndef LIB_MART_COMMON_GUARD_EXPERIMENTAL_NW_EXCEPTIONS_H #define LIB_MART_COMMON_GUARD_EXPERIMENTAL_NW_EXCEPTIONS_H #include <exception> #include "ConstString.h" namespace mart { class RuntimeError : public std::exception { mart::ConstString _msg; public: RuntimeError( mart::ConstString message ) : _msg( std::move( message ).createZStr() ) { } const char* what() const noexcept override { return _msg.c_str(); } }; struct InvalidArgument : RuntimeError { using RuntimeError::RuntimeError; }; } // namespace mart #endif
#ifndef LIB_MART_COMMON_GUARD_EXPERIMENTAL_NW_EXCEPTIONS_H #define LIB_MART_COMMON_GUARD_EXPERIMENTAL_NW_EXCEPTIONS_H #include <exception> #include "ConstString.h" namespace mart { class RuntimeError : public std::exception { mba::im_zstr _msg; public: RuntimeError( mba::im_zstr message ) noexcept : _msg( std::move( message ) ) { } const char* what() const noexcept override { return _msg.c_str(); } }; struct InvalidArgument : RuntimeError { using RuntimeError::RuntimeError; }; struct BlockingOpCanceled : RuntimeError { BlockingOpCanceled() noexcept : RuntimeError( mba::im_zstr( "Blocking operation was canceled" ) ) { } using RuntimeError::RuntimeError; }; } // namespace mart #endif
Add BlockingOpCanceled and use im_zstr
[exception] Add BlockingOpCanceled and use im_zstr
C
mit
tum-ei-rcs/mart-common,tum-ei-rcs/mart-common
9c8944ca89e40772cd3b1f2fe933f428c688221c
gst/dtmf/gstdtmf.c
gst/dtmf/gstdtmf.c
#ifdef HAVE_CONFIG_H #include "config.h" #endif #include "gstdtmfdetect.h" #include "gstdtmfsrc.h" #include "gstrtpdtmfsrc.h" #include "gstrtpdtmfdepay.h" static gboolean plugin_init (GstPlugin * plugin) { if (!gst_dtmf_detect_plugin_init (plugin)) return FALSE; if (!gst_dtmf_src_plugin_init (plugin)) return FALSE; if (!gst_rtp_dtmf_src_plugin_init (plugin)) return FALSE; if (!gst_rtp_dtmf_depay_plugin_init (plugin)) return FALSE; return TRUE; } GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, "dtmf", "DTMF plugins", plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
#ifdef HAVE_CONFIG_H #include "config.h" #endif #include "gstdtmfdetect.h" #include "gstdtmfsrc.h" #include "gstrtpdtmfsrc.h" #include "gstrtpdtmfdepay.h" static gboolean plugin_init (GstPlugin * plugin) { if (!gst_dtmf_detect_plugin_init (plugin)) return FALSE; if (!gst_dtmf_src_plugin_init (plugin)) return FALSE; if (!gst_rtp_dtmf_src_plugin_init (plugin)) return FALSE; if (!gst_rtp_dtmf_depay_plugin_init (plugin)) return FALSE; return TRUE; } GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, dtmf, "DTMF plugins", plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
Update for GST_PLUGIN_DEFINE() API changes
gst: Update for GST_PLUGIN_DEFINE() API changes
C
lgpl-2.1
rawoul/gst-plugins-good,ndufresne/gst-plugins-good,sebras/gst-plugins-good,veo-labs/gst-plugins-good,GrokImageCompression/gst-plugins-good,ariscop/gst-plugins-good,BigBrother-International/gst-plugins-good,shelsonjava/gst-plugins-good,froggatt/gst-plugins-good-m,cablelabs/gst-plugins-good,GStreamer/gst-plugins-good,StreamUtils/gst-plugins-good,lovebug356/gst-plugins-good,sebras/gst-plugins-good,sh0/gst-plugins-good,Kurento/gst-plugins-good,ikonst/gst-plugins-good,StreamUtils/gst-plugins-good,veo-labs/gst-plugins-good,cfoch/gst-plugins-good,freedesktop-unofficial-mirror/gstreamer__gst-plugins-good,krieger-od/gst-plugins-good,ijsf/OpenWebRTC-gst-plugins-good,Lachann/gst-plugins-good,greg80303/gst-plugins-good,pexip/gst-plugins-good,ijsf/OpenWebRTC-gst-plugins-good,ndufresne/gst-plugins-good,jcaden/gst-plugins-good,surround-io/gst-plugins-good,pexip/gst-plugins-good,loshca/gst-plugins-good,cablelabs/gst-plugins-good,sh0/gst-plugins-good,BigBrother-International/gst-plugins-good,wkatsak/gst-plugins-good,davibe/gst-plugins-good-1.0,Lachann/gst-plugins-good,greg80303/gst-plugins-good,jcaden/gst-plugins-good,cfoch/gst-plugins-good,Lachann/gst-plugins-good,reynaldo-samsung/gst-plugins-good,ndufresne/gst-plugins-good,freedesktop-unofficial-mirror/gstreamer__gst-plugins-good,GStreamer/gst-plugins-good,jhodapp/gst-plugins-good,wkatsak/gst-plugins-good,ikonst/gst-plugins-good,greg80303/gst-plugins-good,ikonst/gst-plugins-good,froggatt/gst-plugins-good-m,StreamUtils/gst-plugins-good,shelsonjava/gst-plugins-good,veo-labs/gst-plugins-good,stfl/gst-plugins-good,hizukiayaka/gst-plugins-good,jpakkane/gstreamer-plugins-good,stfl/gst-plugins-good,wkatsak/gst-plugins-good,davibe/gst-plugins-good-1.0,davibe/gst-plugins-good-1.0,Kurento/gst-plugins-good,ikonst/gst-plugins-good,vatavuserban/gst-plugins-good,chamois94/gst-plugins-good,GrokImageCompression/gst-plugins-good,ted-n/gst-plugins-good,reynaldo-samsung/gst-plugins-good,GrokImageCompression/gst-plugins-good,rawoul/gst-plugins-good,collects/gst-plugins-good,pexip/gst-plugins-good,sebras/gst-plugins-good,krieger-od/gst-plugins-good,StreamUtils/gst-plugins-good,ariscop/gst-plugins-good,vatavuserban/gst-plugins-good,reynaldo-samsung/gst-plugins-good,cablelabs/gst-plugins-good,strukturag/gst-plugins-good,hizukiayaka/gst-plugins-good,kittee/gst-plugins-good,davibe/gst-plugins-good-1.0,surround-io/gst-plugins-good,strukturag/gst-plugins-good,collects/gst-plugins-good,ted-n/gst-plugins-good,froggatt/gst-plugins-good-m,loshca/gst-plugins-good,stfl/gst-plugins-good,loshca/gst-plugins-good,cablelabs/gst-plugins-good,Lachann/gst-plugins-good,chamois94/gst-plugins-good,Kurento/gst-plugins-good,surround-io/gst-plugins-good,jhodapp/gst-plugins-good,Kurento/gst-plugins-good,Kurento/gst-plugins-good,GrokImageCompression/gst-plugins-good,GStreamer/gst-plugins-good,ndufresne/gst-plugins-good,freedesktop-unofficial-mirror/gstreamer__gst-plugins-good,jhodapp/gst-plugins-good,lovebug356/gst-plugins-good,pexip/gst-plugins-good,jcaden/gst-plugins-good,veo-labs/gst-plugins-good,cfoch/gst-plugins-good,sh0/gst-plugins-good,froggatt/gst-plugins-good-m,kittee/gst-plugins-good,freedesktop-unofficial-mirror/gstreamer__gst-plugins-good,jcaden/gst-plugins-good,reynaldo-samsung/gst-plugins-good,greg80303/gst-plugins-good,collects/gst-plugins-good,jpakkane/gstreamer-plugins-good,strukturag/gst-plugins-good,jhodapp/gst-plugins-good,ijsf/OpenWebRTC-gst-plugins-good,surround-io/gst-plugins-good,jpakkane/gstreamer-plugins-good,jpakkane/gstreamer-plugins-good,ted-n/gst-plugins-good,chamois94/gst-plugins-good,ted-n/gst-plugins-good,kittee/gst-plugins-good,collects/gst-plugins-good,ijsf/OpenWebRTC-gst-plugins-good,chamois94/gst-plugins-good,rawoul/gst-plugins-good,kittee/gst-plugins-good,hizukiayaka/gst-plugins-good,cfoch/gst-plugins-good,ariscop/gst-plugins-good,ariscop/gst-plugins-good,krieger-od/gst-plugins-good,shelsonjava/gst-plugins-good,hizukiayaka/gst-plugins-good,BigBrother-International/gst-plugins-good,strukturag/gst-plugins-good,stfl/gst-plugins-good,BigBrother-International/gst-plugins-good,sh0/gst-plugins-good,lovebug356/gst-plugins-good,GStreamer/gst-plugins-good,lovebug356/gst-plugins-good,shelsonjava/gst-plugins-good,vatavuserban/gst-plugins-good,krieger-od/gst-plugins-good,loshca/gst-plugins-good,rawoul/gst-plugins-good,sebras/gst-plugins-good,vatavuserban/gst-plugins-good,pexip/gst-plugins-good,wkatsak/gst-plugins-good
5957e7a2fd2ab77b58a301c6c97071b98a5e2648
src/xmlhandler.h
src/xmlhandler.h
#ifndef GPXMLHANDLER_H #define GPXMLHANDlER_H #include <QtXml/QXmlDefaultHandler> #include <QtCore/QDebug> class PlaceContainer; class PlaceMark; class KAtlasXmlHandler : public QXmlDefaultHandler { public: KAtlasXmlHandler(); KAtlasXmlHandler( PlaceContainer* ); bool startDocument(); bool stopDocument(); bool startElement( const QString&, const QString&, const QString &name, const QXmlAttributes& attrs ); bool endElement( const QString&, const QString&, const QString &name ); bool characters( const QString& str ); protected: PlaceContainer* m_placecontainer; PlaceMark* m_placemark; bool m_inKml; bool m_inPlacemark; bool m_inPoint; bool m_coordsset; QString m_currentText; inline int popIdx( int population ); }; #endif // GPXMLHANDLER_H
#ifndef GPXMLHANDLER_H #define GPXMLHANDLER_H #include <QtXml/QXmlDefaultHandler> #include <QtCore/QDebug> class PlaceContainer; class PlaceMark; class KAtlasXmlHandler : public QXmlDefaultHandler { public: KAtlasXmlHandler(); KAtlasXmlHandler( PlaceContainer* ); bool startDocument(); bool stopDocument(); bool startElement( const QString&, const QString&, const QString &name, const QXmlAttributes& attrs ); bool endElement( const QString&, const QString&, const QString &name ); bool characters( const QString& str ); protected: PlaceContainer* m_placecontainer; PlaceMark* m_placemark; bool m_inKml; bool m_inPlacemark; bool m_inPoint; bool m_coordsset; QString m_currentText; inline int popIdx( int population ); }; #endif // GPXMLHANDLER_H
Fix build with enable final
Fix build with enable final svn path=/trunk/kdereview/marble/; revision=665299
C
lgpl-2.1
AndreiDuma/marble,utkuaydin/marble,Earthwings/marble,tzapzoor/marble,quannt24/marble,utkuaydin/marble,oberluz/marble,rku/marble,oberluz/marble,AndreiDuma/marble,utkuaydin/marble,David-Gil/marble-dev,probonopd/marble,quannt24/marble,Earthwings/marble,rku/marble,Earthwings/marble,rku/marble,utkuaydin/marble,David-Gil/marble-dev,tzapzoor/marble,oberluz/marble,adraghici/marble,Earthwings/marble,tucnak/marble,tucnak/marble,tzapzoor/marble,probonopd/marble,tucnak/marble,David-Gil/marble-dev,David-Gil/marble-dev,oberluz/marble,adraghici/marble,tucnak/marble,quannt24/marble,rku/marble,rku/marble,tzapzoor/marble,probonopd/marble,AndreiDuma/marble,quannt24/marble,tucnak/marble,Earthwings/marble,AndreiDuma/marble,quannt24/marble,AndreiDuma/marble,adraghici/marble,quannt24/marble,oberluz/marble,quannt24/marble,utkuaydin/marble,tzapzoor/marble,tucnak/marble,David-Gil/marble-dev,utkuaydin/marble,tzapzoor/marble,oberluz/marble,rku/marble,Earthwings/marble,adraghici/marble,tzapzoor/marble,AndreiDuma/marble,tzapzoor/marble,probonopd/marble,probonopd/marble,adraghici/marble,probonopd/marble,probonopd/marble,tucnak/marble,adraghici/marble,David-Gil/marble-dev
936e55e8fad9394aeee8e4ca4e50c1247ca4d390
libgo/runtime/yield.c
libgo/runtime/yield.c
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "config.h" #include <stddef.h> #include <sys/types.h> #include <sys/time.h> #include <sched.h> #include <unistd.h> #ifdef HAVE_SYS_SELECT_H #include <sys/select.h> #endif #include "runtime.h" /* Spin wait. */ void runtime_procyield (uint32 cnt) { volatile uint32 i; for (i = 0; i < cnt; ++i) { #if defined (__i386__) || defined (__x86_64__) __builtin_ia32_pause (); #endif } } /* Ask the OS to reschedule this thread. */ void runtime_osyield (void) { sched_yield (); } /* Sleep for some number of microseconds. */ void runtime_usleep (uint32 us) { struct timeval tv; tv.tv_sec = us / 1000000; tv.tv_usec = us % 1000000; select (0, NULL, NULL, NULL, &tv); }
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "config.h" #include <stddef.h> #include <sys/types.h> #include <sys/time.h> #include <sched.h> #include <unistd.h> #ifdef HAVE_SYS_SELECT_H #include <sys/select.h> #endif #if defined (__i386__) || defined (__x86_64__) #include <xmmintrin.h> #endif #include "runtime.h" /* Spin wait. */ void runtime_procyield (uint32 cnt) { volatile uint32 i; for (i = 0; i < cnt; ++i) { #if defined (__i386__) || defined (__x86_64__) _mm_pause (); #endif } } /* Ask the OS to reschedule this thread. */ void runtime_osyield (void) { sched_yield (); } /* Sleep for some number of microseconds. */ void runtime_usleep (uint32 us) { struct timeval tv; tv.tv_sec = us / 1000000; tv.tv_usec = us % 1000000; select (0, NULL, NULL, NULL, &tv); }
Use _mm_pause rather than __builtin_ia32_pause.
runtime: Use _mm_pause rather than __builtin_ia32_pause. Based on a patch from Peter Collingbourne. R=iant CC=gofrontend-dev https://golang.org/cl/102920043
C
bsd-3-clause
anlhord/gofrontend,golang/gofrontend,golang/gofrontend,qskycolor/gofrontend,anlhord/gofrontend,anlhord/gofrontend,qskycolor/gofrontend,qskycolor/gofrontend,anlhord/gofrontend,anlhord/gofrontend,golang/gofrontend,golang/gofrontend,qskycolor/gofrontend,anlhord/gofrontend,anlhord/gofrontend,qskycolor/gofrontend,qskycolor/gofrontend,qskycolor/gofrontend
6fdc8bc13b4b71d9285009f996863aad8af046b2
io/block_channel.h
io/block_channel.h
#ifndef BLOCK_CHANNEL_H #define BLOCK_CHANNEL_H class Action; class Buffer; class BlockChannel { protected: BlockChannel(void) { } public: virtual ~BlockChannel() { } virtual Action *close(EventCallback *) = 0; virtual Action *read(off_t, EventCallback *) = 0; virtual Action *write(off_t, Buffer *, EventCallback *) = 0; }; #endif /* !BLOCK_CHANNEL_H */
#ifndef BLOCK_CHANNEL_H #define BLOCK_CHANNEL_H class Action; class Buffer; class BlockChannel { protected: size_t bsize_; BlockChannel(size_t bsize) : bsize_(bsize) { } public: virtual ~BlockChannel() { } virtual Action *close(EventCallback *) = 0; virtual Action *read(off_t, EventCallback *) = 0; virtual Action *write(off_t, Buffer *, EventCallback *) = 0; }; #endif /* !BLOCK_CHANNEL_H */
Make block size a protected member of a block channel.
Make block size a protected member of a block channel.
C
bsd-2-clause
wanproxy/wanproxy,wanproxy/wanproxy,wanproxy/wanproxy
31e81b47fe1982b5fe8bdf22c5820943317832f4
src/util/std.c
src/util/std.c
#include <string.h> #include "std.h" int std_from_str(const char *std, enum c_std *penu, int *gnu) { if(!strcmp(std, "-ansi")) goto std_c90; if(strncmp(std, "-std=", 5)) return 1; std += 5; if(!strncmp(std, "gnu", 3)){ if(gnu) *gnu = 1; std += 3; }else if(*std == 'c'){ if(gnu) *gnu = 0; std++; }else{ return 1; } if(!strcmp(std, "99")){ *penu = STD_C99; }else if(!strcmp(std, "90")){ std_c90: *penu = STD_C90; }else if(!strcmp(std, "89")){ *penu = STD_C89; }else if(!strcmp(std, "11")){ *penu = STD_C11; }else if(!strcmp(std, "17") || !strcmp(std, "18")){ *penu = STD_C18; }else{ return 1; } return 0; }
#include <string.h> #include "std.h" int std_from_str(const char *std, enum c_std *penu, int *gnu) { if(!strcmp(std, "-ansi")){ if(gnu) *gnu = 0; goto std_c90; } if(strncmp(std, "-std=", 5)) return 1; std += 5; if(!strncmp(std, "gnu", 3)){ if(gnu) *gnu = 1; std += 3; }else if(*std == 'c'){ if(gnu) *gnu = 0; std++; }else{ return 1; } if(!strcmp(std, "99")){ *penu = STD_C99; }else if(!strcmp(std, "90")){ std_c90: *penu = STD_C90; }else if(!strcmp(std, "89")){ *penu = STD_C89; }else if(!strcmp(std, "11")){ *penu = STD_C11; }else if(!strcmp(std, "17") || !strcmp(std, "18")){ *penu = STD_C18; }else{ return 1; } return 0; }
Fix uninitialised gnu output for "-ansi" flag
Fix uninitialised gnu output for "-ansi" flag
C
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
43e53ff9f64e521eafefecf79e8694231aa80021
src/c++11/value.h
src/c++11/value.h
// -*- Mode: C++ -*- #include "mapbox_variant/variant.hpp" #include <cstdint> #include <string> #include <vector> #include <unordered_map> // Variant value types for span tags and log payloads. #ifndef __LIGHTSTEP_VALUE_H__ #define __LIGHTSTEP_VALUE_H__ namespace lightstep { class Value; typedef std::unordered_map<std::string, Value> Dictionary; typedef std::vector<Value> Values; typedef mapbox::util::variant<bool, double, int64_t, uint64_t, std::string, std::nullptr_t, Values, Dictionary> variant_type; class Value : public variant_type { public: Value() : variant_type(nullptr) { } template <typename T> Value(T&& t) : variant_type(t) { } std::string to_string() const; }; } // namespace lighstep #endif // __LIGHTSTEP_VALUE_H__
// -*- Mode: C++ -*- #include "mapbox_variant/variant.hpp" #include <cstdint> #include <string> #include <vector> #include <unordered_map> // Variant value types for span tags and log payloads. #ifndef __LIGHTSTEP_VALUE_H__ #define __LIGHTSTEP_VALUE_H__ namespace lightstep { class Value; typedef std::unordered_map<std::string, Value> Dictionary; typedef std::vector<Value> Values; typedef mapbox::util::variant<bool, double, int64_t, uint64_t, std::string, std::nullptr_t, mapbox::util::recursive_wrapper<Values>, mapbox::util::recursive_wrapper<Dictionary>> variant_type; class Value : public variant_type { public: Value() : variant_type(nullptr) { } template <typename T> Value(T&& t) : variant_type(t) { } std::string to_string() const; }; } // namespace lighstep #endif // __LIGHTSTEP_VALUE_H__
Fix for recursive template (which somehow builds on Apple LLVM version 7.3.0 (clang-703.0.31)
Fix for recursive template (which somehow builds on Apple LLVM version 7.3.0 (clang-703.0.31)
C
mit
lightstep/lightstep-tracer-cpp,lightstep/lightstep-tracer-cpp,lightstep/lightstep-tracer-cpp,lightstep/lightstep-tracer-cpp,lightstep/lightstep-tracer-cpp
0b3b2c730aa260f1d060f5f70cf871174da28fc8
src/pam_unshare.c
src/pam_unshare.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <security/pam_appl.h> #include <security/pam_modules.h> PAM_EXTERN int pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv) { return PAM_SUCCESS; } PAM_EXTERN int pam_sm_close_session(pam_handle_t *pamh, int flags, int argc, const char **argv) { return PAM_SUCCESS; }
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <security/pam_appl.h> #include <security/pam_modules.h> PAM_EXTERN int pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv) { printf("pam_unshare pam_sm_open_session\n"); return PAM_SUCCESS; } PAM_EXTERN int pam_sm_close_session(pam_handle_t *pamh, int flags, int argc, const char **argv) { printf("pam_unshare pam_sm_close_session\n"); return PAM_SUCCESS; }
Make it print something on session open/close
Make it print something on session open/close
C
mit
gpjt/pam-unshare
5ee374583520de994200ea3ddbaa05b4dab71e32
bst.h
bst.h
#include <stdlib.h> #ifndef __BST_H__ #define __BST_H__ struct BSTNode; struct BST; typedef struct BSTNode BSTNode; typedef struct BST BST; BST* BST_Create(void); BSTNode* BSTNode_Create(void* k); void BST_Inorder_Tree_Walk(BST* T, void (f)(void*)); void BST_Preorder_Tree_Walk(BST* T, void (f)(void*)); void BST_Postorder_Tree_Walk(BST* T, void (f)(void*)); BSTNode* BST_Tree_Search(BST* T, void* k, int (f)(void*, void*), int (g)(void*, void*)); BSTNode* BST_Iterative_Tree_Search(BST* T, void* k, int (f)(void*, void*), int (g)(void*, void*)); BSTNode* BST_Tree_Minimum(BSTNode* n); BSTNode* BST_Tree_Maximum(BSTNode* n); BSTNode* BST_Tree_Root(BST* T); #endif
#include <stdlib.h> #ifndef __BST_H__ #define __BST_H__ struct BSTNode; struct BST; typedef struct BSTNode BSTNode; typedef struct BST BST; BST* BST_Create(void); BSTNode* BSTNode_Create(void* k); void BST_Inorder_Tree_Walk(BST* T, void (f)(void*)); void BST_Preorder_Tree_Walk(BST* T, void (f)(void*)); void BST_Postorder_Tree_Walk(BST* T, void (f)(void*)); BSTNode* BST_Tree_Search(BST* T, void* k, int (f)(void*, void*), int (g)(void*, void*)); BSTNode* BST_Iterative_Tree_Search(BST* T, void* k, int (f)(void*, void*), int (g)(void*, void*)); BSTNode* BST_Tree_Minimum(BSTNode* n); BSTNode* BST_Tree_Maximum(BSTNode* n); BSTNode* BST_Tree_Root(BST* T); BSTNode* BST_Tree_Successor(BSTNode* n); BSTNode* BST_Tree_Predecessor(BSTNode* n); #endif
Add BST Predecessor/Successor func declaration
Add BST Predecessor/Successor func declaration
C
mit
MaxLikelihood/CADT
cf4397b954e8a1cfe777708f26dee8ad43ece917
src/core/map/block/SimpleBlock.h
src/core/map/block/SimpleBlock.h
// // Created by dar on 11/25/15. // #ifndef C003_SIMPLEBLOCK_H #define C003_SIMPLEBLOCK_H #pragma once #include "Block.h" class SimpleBlock : public Block { public: SimpleBlock(Map *map, int texPos, int x, int y) : Block(map, x, y), texPos(texPos) { shape.SetAsBox(0.5, 0.5); b2FixtureDef fixDef; fixDef.shape = &shape; fixDef.isSensor = true; body->CreateFixture(&fixDef); }; int getTexPos() const { return texPos; } private: int texPos; }; #endif //C003_SIMPLEBLOCK_H
// // Created by dar on 11/25/15. // #ifndef C003_SIMPLEBLOCK_H #define C003_SIMPLEBLOCK_H #pragma once #include "Block.h" class SimpleBlock : public Block { public: SimpleBlock(Map *map, int texPos, int x, int y) : Block(map, x, y), texPos(texPos) { shape.SetAsBox(0.5, 0.5); b2FixtureDef fixDef; fixDef.shape = &shape; fixDef.isSensor = texPos >= 13 * 16; body->CreateFixture(&fixDef); }; int getTexPos() const { return texPos; } private: int texPos; }; #endif //C003_SIMPLEBLOCK_H
Undo commit: "Made all blocks sensors"
Undo commit: "Made all blocks sensors"
C
mit
darsto/spooky,darsto/spooky
164fe0f58855721bd10abc4498e993443665b6fb
src/node.h
src/node.h
#ifndef SRC_NODE_H_ #define SRC_NODE_H_ #include <boost/serialization/serialization.hpp> #include <boost/serialization/access.hpp> #include <boost/serialization/nvp.hpp> #include <memory> #include "./render_data.h" #include "./math/obb.h" class Gl; /** * \brief Base class for nodes which are managed by the * Nodes class * * The only virtual method which must be implemented is * Node::render. */ class Node { public: virtual ~Node() { } virtual void render(Gl *gl, RenderData renderData) = 0; virtual std::shared_ptr<Math::Obb> getObb() { return std::shared_ptr<Math::Obb>(); } protected: Node() { } private: friend class boost::serialization::access; template <class Archive> void serialize(Archive &ar, unsigned int version) const { } }; #endif // SRC_NODE_H_
#ifndef SRC_NODE_H_ #define SRC_NODE_H_ #include <boost/serialization/serialization.hpp> #include <boost/serialization/access.hpp> #include <boost/serialization/nvp.hpp> #include <memory> #include "./render_data.h" #include "./math/obb.h" class Gl; /** * \brief Base class for nodes which are managed by the * Nodes class * * The only virtual method which must be implemented is * Node::render. */ class Node { public: virtual ~Node() { } virtual void render(Gl *gl, RenderData renderData) = 0; virtual std::shared_ptr<Math::Obb> getObb() { return std::shared_ptr<Math::Obb>(); } bool isPersistable() { return persistable; } protected: Node() { } bool persistable = true; private: friend class boost::serialization::access; template <class Archive> void serialize(Archive &ar, unsigned int version) const { } }; #endif // SRC_NODE_H_
Add protected persistable property to Node base class.
Add protected persistable property to Node base class.
C
mit
Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller
9a9fe830340cd70d490325f70ef46c2736d953df
Engine/Entity.h
Engine/Entity.h
#ifndef __ENTITY_H__ #define __ENTITY_H__ #include "ModuleCollision.h" class Entity { public: Entity() : Parent(nullptr) {} Entity(Entity* parent) : Parent(parent) {} virtual ~Entity() {} // Entity lifecycle methods virtual bool Start() { return true; } virtual bool Start(bool active) { this->_active = active; return true; } bool Enable() { if (!_active) return _active = Start(); return true; } bool Disable() { if (_active) return _active = !CleanUp(); return false; } bool IsEnabled() { return _active; } virtual void PreUpdate() {} virtual void Update() {} virtual void PostUpdate() {} virtual bool CleanUp() { return true; } // Callbacks virtual bool OnCollision(Collider origin, Collider other) { return true; } public: Entity* Parent; private: bool _active = true; }; #endif // __ENTITY_H__
#ifndef __ENTITY_H__ #define __ENTITY_H__ #include "ModuleCollision.h" #include "Point3.h" class Entity { public: Entity() : Parent(nullptr) {} Entity(Entity* parent) : Parent(parent) {} virtual ~Entity() {} // Entity lifecycle methods virtual bool Start() { return true; } bool Enable() { if (!_active) return _active = Start(); return true; } bool Disable() { if (_active) return _active = !CleanUp(); return false; } bool IsEnabled() { return _active; } virtual void PreUpdate() {} virtual void Update() {} virtual void PostUpdate() {} virtual bool CleanUp() { return true; } // Callbacks virtual bool OnCollision(Collider& origin, Collider& other) { return true; } public: Entity* Parent; iPoint3 _position; private: bool _active = true; }; #endif // __ENTITY_H__
Fix calling by reference in entity
Fix calling by reference in entity
C
mit
jowie94/The-Simpsons-Arcade,jowie94/The-Simpsons-Arcade
af94158c6819f384f0f5b88dd00b0dc696a04d73
src/util.h
src/util.h
#ifndef UTIL_H #define UTIL_H /*** Utility functions ***/ #define true 1 #define false 0 #define ALLOC(type) ALLOC_N(type, 1) #define ALLOC_N(type, n) ((type*) xmalloc(sizeof(type) * (n))) #define MEMCPY(dst, src, type) MEMCPY_N(dst, src, type, 1) #define MEMCPY_N(dst, src, type, n) (memcpy((dst), (src), sizeof(type) * (n))) void *xmalloc(size_t); char *hextoa(const char *, int); char *strclone(const char *string); #define STARTS_WITH(x, y) (strncmp((x), (y), strlen(y)) == 0) #endif /* UTIL_H */
#ifndef UTIL_H #define UTIL_H /*** Utility functions ***/ #define true 1 #define false 0 #define ALLOC(type) ALLOC_N(type, 1) #define ALLOC_N(type, n) ((type*) xmalloc(sizeof(type) * (n))) #define MEMCPY(dst, src, type) MEMCPY_N(dst, src, type, 1) #define MEMCPY_N(dst, src, type, n) (memcpy((dst), (src), sizeof(type) * (n))) void *xmalloc(size_t); char *hextoa(const char *, int); char *strclone(const char *string); #define STARTS_WITH(x, y) (strncmp((x), (y), strlen(y)) == 0) #define DEFINE_REFCOUNTERS_FOR(type) \ void sp_##type##_add_ref(sp_##type *x) {} \ void sp_##type##_release(sp_##type *x) {} #define DEFINE_READER(return_type, kind, field) \ return_type sp_##kind##_##field(sp_##kind *x) \ { \ return x->field; \ } #define DEFINE_SESSION_READER(return_type, kind, field) \ return_type sp_##kind##_##field(sp_session *x, sp_##kind *y) \ { \ return y->field; \ } #endif /* UTIL_H */
Add DEFINE_X macros, for ref counters, readers and session readers
Add DEFINE_X macros, for ref counters, readers and session readers
C
apache-2.0
mopidy/libmockspotify,mopidy/libmockspotify,mopidy/libmockspotify
3e742910e8b89a2c006c2d3ec90eda68212916f1
library/util.c
library/util.c
#include <mqtt3.h> const char *mqtt_command_to_string(uint8_t command) { switch(command){ case CONNACK: return "CONNACK"; case CONNECT: return "CONNECT"; case DISCONNECT: return "DISCONNECT"; case PINGREQ: return "PINGREQ"; case PINGRESP: return "PINGRESP"; case PUBACK: return "PUBACK"; case PUBCOMP: return "PUBCOMP"; case PUBLISH: return "PUBLISH"; case PUBREC: return "PUBREC"; case PUBREL: return "PUBREL"; case SUBACK: return "SUBACK"; case SUBSCRIBE: return "SUBSCRIBE"; case UNSUBACK: return "UNSUBACK"; case UNSUBSCRIBE: return "UNSUBSCRIBE"; } return "UNKNOWN"; }
Add missing code for command to string conversion.
Add missing code for command to string conversion.
C
bsd-3-clause
zlargon/mosquitto,tempbottle/mosquitto,zlargon/mosquitto,tempbottle/mosquitto,tempbottle/mosquitto,tempbottle/mosquitto,tempbottle/mosquitto,zlargon/mosquitto,zlargon/mosquitto,zlargon/mosquitto
a4a5d761f9cee11c229b9a10189505ead3324bc5
cmd/lefty/str.h
cmd/lefty/str.h
/* $Id$ $Revision$ */ /* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (c) 1994-2004 AT&T Corp. * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Corp. * * * * Information and Software Systems Research * * AT&T Research, Florham Park NJ * **********************************************************/ #ifdef __cplusplus extern "C" { #endif /* Lefteris Koutsofios - AT&T Bell Laboratories */ #ifndef _STR_H #define _STR_H void Sinit(void); void Sterm(void); char *Spath(char *, Tobj); char *Sseen(Tobj, char *); char *Sabstract(Tobj, Tobj); char *Stfull(Tobj); char *Ssfull(Tobj, Tobj); char *Scfull(Tobj, int, int); #endif /* _STR_H */ #ifdef __cplusplus } #endif
/* $Id$ $Revision$ */ /* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (c) 1994-2004 AT&T Corp. * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Corp. * * * * Information and Software Systems Research * * AT&T Research, Florham Park NJ * **********************************************************/ #ifdef __cplusplus extern "C" { #endif /* Lefteris Koutsofios - AT&T Labs Research */ #ifndef _STR_H #define _STR_H void Sinit (void); void Sterm (void); char *Spath (char *, Tobj); char *Sseen (Tobj, char *); char *Sabstract (Tobj, Tobj); char *Stfull (Tobj); char *Ssfull (Tobj, Tobj); char *Scfull (Tobj, int, int); #endif /* _STR_H */ #ifdef __cplusplus } #endif
Update with new lefty, fixing many bugs and supporting new features
Update with new lefty, fixing many bugs and supporting new features
C
epl-1.0
MjAbuz/graphviz,jho1965us/graphviz,BMJHayward/graphviz,ellson/graphviz,ellson/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,ellson/graphviz,MjAbuz/graphviz,jho1965us/graphviz,tkelman/graphviz,pixelglow/graphviz,jho1965us/graphviz,kbrock/graphviz,pixelglow/graphviz,kbrock/graphviz,MjAbuz/graphviz,tkelman/graphviz,ellson/graphviz,kbrock/graphviz,jho1965us/graphviz,kbrock/graphviz,ellson/graphviz,tkelman/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,kbrock/graphviz,jho1965us/graphviz,jho1965us/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,tkelman/graphviz,ellson/graphviz,kbrock/graphviz,ellson/graphviz,jho1965us/graphviz,pixelglow/graphviz,tkelman/graphviz,ellson/graphviz,MjAbuz/graphviz,pixelglow/graphviz,BMJHayward/graphviz,pixelglow/graphviz,BMJHayward/graphviz,ellson/graphviz,pixelglow/graphviz,MjAbuz/graphviz,tkelman/graphviz,kbrock/graphviz,kbrock/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,ellson/graphviz,kbrock/graphviz,pixelglow/graphviz,MjAbuz/graphviz,tkelman/graphviz,tkelman/graphviz,pixelglow/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,kbrock/graphviz,tkelman/graphviz,tkelman/graphviz,ellson/graphviz,MjAbuz/graphviz,jho1965us/graphviz,jho1965us/graphviz,kbrock/graphviz,jho1965us/graphviz,pixelglow/graphviz,pixelglow/graphviz,pixelglow/graphviz,jho1965us/graphviz,BMJHayward/graphviz,tkelman/graphviz,BMJHayward/graphviz
0a8dfb109eb3b3fd7a4efb9f39cca70ae44c31f8
payload/Bmp180.h
payload/Bmp180.h
#ifndef RCR_LEVEL1PAYLOAD_BMP180_H_ #define RCR_LEVEL1PAYLOAD_BMP180_H_ #if defined(ARDUINO) && ARDUINO >= 100 #include "arduino.h" #else #include "WProgram.h" #endif namespace rcr { namespace level1payload { } // namespace level1_payload } // namespace rcr #endif // RCR_LEVEL1PAYLOAD_BMP180_H_
#ifndef RCR_LEVEL1PAYLOAD_BMP180_H_ #define RCR_LEVEL1PAYLOAD_BMP180_H_ #if defined(ARDUINO) && ARDUINO >= 100 #include "arduino.h" #else #include "WProgram.h" #endif #include <Adafruit_BMP085_Library\Adafruit_BMP085.h> namespace rcr { namespace level1payload { // Encapsulates a BMP180 sensor and providing selected access to its interface. // Compatable with (at least) the BMP085 and BMP180. class Bmp180 { public: Bmp180(); // Temperature. // // UNIT: degrees Celcius float temperature(void); // Pressure at the sensor. // UNIT: pascal (N/m^2) int32_t ambient_pressure(void); // Pressure altitude: altitude with altimeter setting at 101325 Pascals == 1013.25 millibars // == 29.92 inches mercury (i.e., std. pressure) // For pressure conversions, visit NOAA // at: https://www.weather.gov/media/epz/wxcalc/pressureConversion.pdf. // (Pressure altitude is NOT correct for non-standard pressure or temperature.) // UNIT: meters float pressure_altitude(void); // Only if a humidity sensor is viable, TODO (Nolan Holden): // Add density altitude: // pressure altitude corrected for nonstandard temperature. // Remember: higher density altitude (High, Hot, and Humid) means decreased performance. // Disallow copying and moving. Bmp180(const Bmp180&) = delete; Bmp180& operator=(const Bmp180&) = delete; private: Adafruit_BMP085 bmp; }; } // namespace level1_payload } // namespace rcr #endif // RCR_LEVEL1PAYLOAD_BMP180_H_
Define the BMP180 container class
Define the BMP180 container class
C
mit
nolanholden/geovis,nolanholden/geovis,nolanholden/geovis,nolanholden/payload-level1-rocket
1a09fbfebd6cf3361b29cf1386a402560c7c7b3b
registryd/event-source.h
registryd/event-source.h
/* * AT-SPI - Assistive Technology Service Provider Interface * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap) * * Copyright 2009 Nokia. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef SPI_EVENT_SOURCE_H_ #define SPI_EVENT_SOURCE_H_ #ifdef HAVE_X11 #include <X11/Xlib.h> void spi_events_init (Display *display); void spi_set_filter (void (*filter) (XEvent*, void*), void* data); #endif /* HAVE_X11 */ void spi_events_uninit (); void spi_set_events (long event_mask); #endif /* SPI_EVENT_SOURCE_H_ */
/* * AT-SPI - Assistive Technology Service Provider Interface * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap) * * Copyright 2009 Nokia. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef SPI_EVENT_SOURCE_H_ #define SPI_EVENT_SOURCE_H_ #include <config.h> #ifdef HAVE_X11 #include <X11/Xlib.h> void spi_events_init (Display *display); void spi_set_filter (void (*filter) (XEvent*, void*), void* data); #endif /* HAVE_X11 */ void spi_events_uninit (); void spi_set_events (long event_mask); #endif /* SPI_EVENT_SOURCE_H_ */
Include config.h before checking HAVE_X11
registryd: Include config.h before checking HAVE_X11 https://bugzilla.gnome.org/show_bug.cgi?id=773710
C
lgpl-2.1
GNOME/at-spi2-core,GNOME/at-spi2-core,GNOME/at-spi2-core
1798b634514a8b35a47e3936cce7ce31ceb2e93e
shapes/map/map_6.c
shapes/map/map_6.c
int f(int); int main(void) { int *x, *y; // CHECK: Found // CHECK: line [[@LINE+1]] for(int i = 0; i < 100; i++) { x[9] = 45; x[i] = f(y[i]); } }
int f(int); int main(void) { int *x, *y; // CHECK: Near miss for(int i = 0; i < 100; i++) { x[9] = 45; x[i] = f(y[i]); } }
Change filecheck line for map 6
Change filecheck line for map 6
C
mit
Baltoli/skeletons,Baltoli/skeletons,Baltoli/skeletons
38fb8a117b47f4cf229ab15cfc5fdb1a27b09853
snake.c
snake.c
#include <stdlib.h> /** * @author: Hendrik Werner */ #define BOARD_HEIGHT 50 #define BOARD_WIDTH 50 typedef struct Position { int row; int col; } Position; typedef enum Cell { EMPTY ,SNAKE ,FOOD } Cell; int main() { return EXIT_SUCCESS; }
#include <stdlib.h> /** * @author: Hendrik Werner */ #define BOARD_HEIGHT 50 #define BOARD_WIDTH 50 typedef struct Position { int row; int col; } Position; typedef enum Cell { EMPTY ,SNAKE ,FOOD } Cell; typedef Cell Board[BOARD_HEIGHT][BOARD_WIDTH]; int main() { return EXIT_SUCCESS; }
Define a type alias to represent boards.
Define a type alias to represent boards.
C
mit
Hendrikto/Snake
a61d97549cffa81b1949ec6baacef77d71e0a896
desc.c
desc.c
#include <stdio.h> #include "dbg.h" #include "stats.h" int main(int argc, char *argv[]) { dataset *ds = read_data_file(argv[1]); if (!ds) return 1; printf("count %zu\n", ds->n); printf("min %.5g\n", min(ds)); printf("Q1 %.5g\n", first_quartile(ds)); printf("mean %.5g\n", mean(ds)); printf("median %.5g\n", median(ds)); printf("Q3 %.5g\n", third_quartile(ds)); printf("max %.5g\n", max(ds)); printf("IQR %.5g\n", interquartile_range(ds)); printf("var %.5g\n", var(ds)); printf("sd %.5g\n", sd(ds)); return 0; }
Add source for main executable
Add source for main executable
C
mit
loicseguin/desc
2b40e170deeb97055d4a1ffb27de0ec38c212712
list.h
list.h
#include <stdlib.h> #ifndef __LIST_H__ #define __LIST_H__ struct ListNode; struct List; typedef struct ListNode ListNode; typedef struct List List; List* List_Create(void); void List_Destroy(List* l); ListNode* ListNode_Create(void *); void ListNode_Destroy(ListNode* n); ListNode* List_Search(List* l, void* k, int (f)(void*, void*)); void List_Insert(List* l, ListNode* n); #endif
#include <stdlib.h> #ifndef __LIST_H__ #define __LIST_H__ struct ListNode; struct List; typedef struct ListNode ListNode; typedef struct List List; List* List_Create(void); void List_Destroy(List* l); ListNode* ListNode_Create(void *); void ListNode_Destroy(ListNode* n); ListNode* List_Search(List* l, void* k, int (f)(void*, void*)); void List_Insert(List* l, ListNode* n); void List_Delete(List* l, ListNode* n); #endif
Add List Delete function declaration
Add List Delete function declaration
C
mit
MaxLikelihood/CADT
b45768b1321048d323fe762319a21e2da928142b
main.c
main.c
#include <stdio.h> int main(void) { return 0; }
#include <stdio.h> #include <stdlib.h> #define SETUP_HANDLER 0 short int CURRENT_STATE = SETUP_HANDLER; void setupHandler() { // Hardware definitions // Setup next state } void loop() { while(1) { switch(CURRENT_STATE) { case SETUP_HANDLER: setupHandler(); break; } } } int main(void) { loop(); return 0; }
Add base `state machine` from the scratch
feature: Add base `state machine` from the scratch
C
mit
marceloboeira/miller-urey
677be8e05b8fc5ccffa9035c0c39e4292a672803
cbits/win32.c
cbits/win32.c
/* ---------------------------------------------------------------------------- (c) The University of Glasgow 2006 Useful Win32 bits ------------------------------------------------------------------------- */ #if defined(_WIN32) #include "HsBase.h" int get_unique_file_info(int fd, HsWord64 *dev, HsWord64 *ino) { HANDLE h = (HANDLE)_get_osfhandle(fd); BY_HANDLE_FILE_INFORMATION info; if (GetFileInformationByHandle(h, &info)) { *dev = info.dwVolumeSerialNumber; *ino = info.nFileIndexLow | ((HsWord64)info.nFileIndexHigh << 32); return 0; } return -1; } #endif
/* ---------------------------------------------------------------------------- (c) The University of Glasgow 2006 Useful Win32 bits ------------------------------------------------------------------------- */ #if defined(_WIN32) #include "HsBase.h" #endif
Remove our customed `get_unique_file_info` on Windows platform.
Remove our customed `get_unique_file_info` on Windows platform. The function `get_unique_file_info` was added into base 5 years ago, https://github.com/ghc/ghc/blame/ba597c1dd1daf9643b72dc7aeace8d6b3fce84eb/libraries/base/cbits/Win32Utils.c#L128, and first appeared in base-4.6.0. Signed-off-by: Tao He <[email protected]>
C
bsd-3-clause
winterland1989/stdio,winterland1989/stdio,winterland1989/stdio
79b4591da81535d9820bda788e0acf15f07e9120
src/main.h
src/main.h
#pragma once #include "config.h" #define BOOST_LOG_DYN_LINK #include <boost/log/sources/severity_logger.hpp> #include <boost/log/trivial.hpp> int main(int argc, char **argv); boost::log::sources::severity_logger<boost::log::trivial::severity_level> &get_global_logger(void); // TOOD: Make const
#pragma once #include "config.h" #define BOOST_LOG_DYN_LINK #include <boost/log/sources/severity_logger.hpp> #include <boost/log/trivial.hpp> int main(int argc, char **argv); boost::log::sources::severity_logger<boost::log::trivial::severity_level> &get_global_logger(void);
Remove comment which is impossible :(
Remove comment which is impossible :(
C
mit
durandj/simplicity,durandj/simplicity
1ca2092e54d1b1c06daf79eaf76710889a7eda2d
RobotC/MotorTest.c
RobotC/MotorTest.c
#pragma config(Hubs, S1, HTMotor, none, none, none) #pragma config(Sensor, S1, , sensorI2CMuxController) #pragma config(Motor, mtr_S1_C1_1, leftMotor, tmotorTetrix, openLoop) #pragma config(Motor, mtr_S1_C1_2, rightMotor, tmotorTetrix, openLoop) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// task main() { motor[leftMotor] =100; motor[rightMotor] = -100; wait1Msec(1000); for(int i=0;i<kNumbOfRealMotors;i++) { motor[i] = 0; } }
#pragma config(Hubs, S1, HTMotor, none, none, none) #pragma config(Sensor, S1, , sensorI2CMuxController) #pragma config(Motor, mtr_S1_C1_1, Michelangelo_FR, tmotorTetrix, PIDControl, reversed, encoder) #pragma config(Motor, mtr_S1_C1_2, Donatello_FL, tmotorTetrix, PIDControl, encoder) #pragma config(Motor, mtr_S1_C2_2, Raphael_BR, tmotorTetrix, PIDControl, reversed, encoder) #pragma config(Motor, mtr_S1_C2_1, Leonardo_BL, tmotorTetrix, PIDControl, encoder) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// //If none of these work, I will be very sad. #define TOTAL_MOTORS kNumbOfTotalMotors //#define TOTAL_MOTORS kNumbOfRealMotors //#define TOTAL_MOTORS kNumbOfVirtualMotors task main() { for(int i=0;i<TOTAL_MOTORS;i++) { motor[i] = 50; } wait1Msec(2000); motor[Michelangelo_FR] = 0; motor[Donatello_FL] = 0; motor[Raphael_BR] = 0; motor[Leonardo_BL] = 0; }
Add motor loop tester to see once and for all if possible
Add motor loop tester to see once and for all if possible
C
mit
RMRobotics/FTC_5421_2014-2015,RMRobotics/FTC_5421_2014-2015
0201012a54285c9851dfe8b23045f0d99a8175cd
RMUniversalAlert.h
RMUniversalAlert.h
// // RMUniversalAlert.h // RMUniversalAlert // // Created by Ryan Maxwell on 19/11/14. // Copyright (c) 2014 Ryan Maxwell. All rights reserved. // @class RMUniversalAlert; typedef void(^RMUniversalAlertCompletionBlock)(RMUniversalAlert *alert, NSInteger buttonIndex); @interface RMUniversalAlert : NSObject + (instancetype)showAlertInViewController:(UIViewController *)viewController withTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle destructiveButtonTitle:(NSString *)destructiveButtonTitle otherButtonTitles:(NSArray *)otherButtonTitles tapBlock:(RMUniversalAlertCompletionBlock)tapBlock; + (instancetype)showActionSheetInViewController:(UIViewController *)viewController withTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle destructiveButtonTitle:(NSString *)destructiveButtonTitle otherButtonTitles:(NSArray *)otherButtonTitles tapBlock:(RMUniversalAlertCompletionBlock)tapBlock; @property (readonly, nonatomic) BOOL visible; @property (readonly, nonatomic) NSInteger cancelButtonIndex; @property (readonly, nonatomic) NSInteger firstOtherButtonIndex; @property (readonly, nonatomic) NSInteger destructiveButtonIndex; @end
// // RMUniversalAlert.h // RMUniversalAlert // // Created by Ryan Maxwell on 19/11/14. // Copyright (c) 2014 Ryan Maxwell. All rights reserved. // #import <UIKit/UIKit.h> @class RMUniversalAlert; typedef void(^RMUniversalAlertCompletionBlock)(RMUniversalAlert *alert, NSInteger buttonIndex); @interface RMUniversalAlert : NSObject + (instancetype)showAlertInViewController:(UIViewController *)viewController withTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle destructiveButtonTitle:(NSString *)destructiveButtonTitle otherButtonTitles:(NSArray *)otherButtonTitles tapBlock:(RMUniversalAlertCompletionBlock)tapBlock; + (instancetype)showActionSheetInViewController:(UIViewController *)viewController withTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle destructiveButtonTitle:(NSString *)destructiveButtonTitle otherButtonTitles:(NSArray *)otherButtonTitles tapBlock:(RMUniversalAlertCompletionBlock)tapBlock; @property (readonly, nonatomic) BOOL visible; @property (readonly, nonatomic) NSInteger cancelButtonIndex; @property (readonly, nonatomic) NSInteger firstOtherButtonIndex; @property (readonly, nonatomic) NSInteger destructiveButtonIndex; @end
Add in UIKit import into header.
Add in UIKit import into header.
C
mit
lijie121210/RMUniversalAlert,ranshon/RMUniversalAlert,RockyZ/RMUniversalAlert,ryanmaxwell/RMUniversalAlert
4ea319b6ff2c1bf38adafdb8c9128ab48d3eb9ee
common/platform/api/quiche_export.h
common/platform/api/quiche_export.h
// Copyright 2019 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 THIRD_PARTY_QUICHE_PLATFORM_API_QUICHE_EXPORT_H_ #define THIRD_PARTY_QUICHE_PLATFORM_API_QUICHE_EXPORT_H_ #include "net/quiche/common/platform/impl/quiche_export_impl.h" // quiche_export_impl.h defines the following macros: // - QUICHE_EXPORT is not meant to be used. // - QUICHE_EXPORT_PRIVATE is meant for QUICHE functionality that is built in // Chromium as part of //net, and not fully contained in headers. // - QUICHE_NO_EXPORT is meant for QUICHE functionality that is either fully // defined in a header, or is built in Chromium as part of tests or tools. #endif // THIRD_PARTY_QUICHE_PLATFORM_API_QUICHE_EXPORT_H_
// Copyright 2019 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 THIRD_PARTY_QUICHE_PLATFORM_API_QUICHE_EXPORT_H_ #define THIRD_PARTY_QUICHE_PLATFORM_API_QUICHE_EXPORT_H_ #include "quiche_platform_impl/quiche_export_impl.h" // QUICHE_EXPORT is not meant to be used. #define QUICHE_EXPORT QUICHE_EXPORT_IMPL // QUICHE_EXPORT_PRIVATE is meant for QUICHE functionality that is built in // Chromium as part of //net, and not fully contained in headers. #define QUICHE_EXPORT_PRIVATE QUICHE_EXPORT_PRIVATE_IMPL // QUICHE_NO_EXPORT is meant for QUICHE functionality that is either fully // defined in a header, or is built in Chromium as part of tests or tools. #define QUICHE_NO_EXPORT QUICHE_NO_EXPORT_IMPL #endif // THIRD_PARTY_QUICHE_PLATFORM_API_QUICHE_EXPORT_H_
Make QUICHE export use new-style default impl.
Make QUICHE export use new-style default impl. PiperOrigin-RevId: 354510465 Change-Id: I3b55187e2a2e8af8e5870dc24b608ebb5a5ff865
C
bsd-3-clause
google/quiche,google/quiche,google/quiche,google/quiche
ffddc9d9b570116a0d0acc3c6309794cb68db085
src/libbitcoind.h
src/libbitcoind.h
#include "main.h" #include "addrman.h" #include "alert.h" #include "base58.h" #include "init.h" #include "noui.h" #include "rpcserver.h" #include "txdb.h" #include <boost/thread.hpp> #include <boost/filesystem.hpp> #include "nan.h" #include "scheduler.h" #include "core_io.h" #include "script/bitcoinconsensus.h" #include "consensus/validation.h" NAN_METHOD(StartBitcoind); NAN_METHOD(OnBlocksReady); NAN_METHOD(OnTipUpdate); NAN_METHOD(IsStopping); NAN_METHOD(IsStopped); NAN_METHOD(StopBitcoind); NAN_METHOD(GetBlock); NAN_METHOD(GetTransaction); NAN_METHOD(GetInfo); NAN_METHOD(IsSpent); NAN_METHOD(GetBlockIndex); NAN_METHOD(GetMempoolOutputs); NAN_METHOD(AddMempoolUncheckedTransaction); NAN_METHOD(VerifyScript); NAN_METHOD(SendTransaction); NAN_METHOD(EstimateFee); NAN_METHOD(StartTxMon); NAN_METHOD(GetProgress);
#include "main.h" #include "addrman.h" #include "alert.h" #include "base58.h" #include "init.h" #include "noui.h" #include "rpcserver.h" #include "txdb.h" #include <boost/thread.hpp> #include <boost/filesystem.hpp> #include "nan.h" #include "scheduler.h" #include "core_io.h" #include "script/bitcoinconsensus.h" #include "consensus/validation.h" NAN_METHOD(StartBitcoind); NAN_METHOD(OnBlocksReady); NAN_METHOD(OnTipUpdate); NAN_METHOD(IsStopping); NAN_METHOD(IsStopped); NAN_METHOD(StopBitcoind); NAN_METHOD(GetBlock); NAN_METHOD(GetTransaction); NAN_METHOD(GetInfo); NAN_METHOD(IsSpent); NAN_METHOD(GetBlockIndex); NAN_METHOD(GetMempoolOutputs); NAN_METHOD(AddMempoolUncheckedTransaction); NAN_METHOD(VerifyScript); NAN_METHOD(SendTransaction); NAN_METHOD(EstimateFee); NAN_METHOD(StartTxMon); NAN_METHOD(SyncPercentage); NAN_METHOD(IsSynced);
Fix declarations for IsSynced and SyncPercentage
Fix declarations for IsSynced and SyncPercentage
C
mit
isghe/bitcore-node,braydonf/bitcore-node,CryptArc/bitcore-node,jameswalpole/bitcore-node,wzrdtales/bitcore-node,zcoinrocks/bitcore-node,wzrdtales/bitcore-node,jameswalpole/bitcore-node,snogcel/bitcore-node-dash,phplaboratory/psiacore-node,jameswalpole/bitcore-node,wzrdtales/bitcore-node,wzrdtales/bitcore-node,isghe/bitcore-node,CryptArc/bitcore-node,isghe/bitcore-node,wzrdtales/bitcore-node,snogcel/bitcore-node-dash,zcoinrocks/bitcore-node,isghe/bitcore-node,jameswalpole/bitcore-node,CryptArc/bitcore-node,CryptArc/bitcore-node,fanatid/bitcore-node,kleetus/bitcore-node,kleetus/bitcore-node,fanatid/bitcore-node,fanatid/bitcore-node,jameswalpole/bitcore-node,phplaboratory/psiacore-node,fanatid/bitcore-node,phplaboratory/psiacore-node,CryptArc/bitcore-node,phplaboratory/psiacore-node,fanatid/bitcore-node,phplaboratory/psiacore-node,isghe/bitcore-node,braydonf/bitcore-node
acb99f7d6b709a7dc88344c36de7c4866e455035
src/wrap.h
src/wrap.h
#ifndef BF_WRAP_H #define BF_WRAP_H #include <type_traits> #include "object.h" namespace bf { template < typename T, typename std::enable_if<std::is_integral<T>::value>::type > object wrap(T const& x) { return {&x, sizeof(T)}; } template <typename Sequence> object wrap(Sequence const& s) { return {s.data(), s.size()}; } } // namespace bf #endif
#ifndef BF_WRAP_H #define BF_WRAP_H #include <type_traits> #include <vector> #include "object.h" namespace bf { template < typename T, typename = typename std::enable_if<std::is_arithmetic<T>::value>::type > object wrap(T const& x) { return {&x, sizeof(T)}; } template < typename T, size_t N, typename = typename std::enable_if<std::is_arithmetic<T>::value>::type > object wrap(T const (&str)[N]) { return {&str, N * sizeof(T)}; } template < typename T, typename = typename std::enable_if<std::is_arithmetic<T>::value>::type > object wrap(std::vector<T> const& s) { return {s.data(), s.size()}; } inline object wrap(std::string const& str) { return {str.data(), str.size()}; } } // namespace bf #endif
Fix SFINAE default arg and add array overload.
Fix SFINAE default arg and add array overload.
C
bsd-3-clause
mavam/libbf,nicolacdnll/libbf,nicolacdnll/libbf
c7b9e854fbd3008f3120a69f385781e2598b33fd
src/media/delivery/irtpstreamer.h
src/media/delivery/irtpstreamer.h
#pragma once #include "media/processing/filter.h" #include <QHostAddress> class IRTPStreamer { public: virtual ~IRTPStreamer(); virtual void init(StatisticsInterface *stats) = 0; virtual void uninit() = 0; virtual void run() = 0; virtual void stop() = 0; // init a session with sessionID to use with add/remove functions // returns whether operation was successful virtual bool addPeer(QHostAddress address, uint32_t sessionID) = 0; // Returns filter to be attached to filter graph. ownership is not transferred. // removing the peer or stopping the streamer destroys these filters. virtual std::shared_ptr<Filter> addSendStream(uint32_t peer, uint16_t port, QString codec, uint8_t rtpNum) = 0; virtual std::shared_ptr<Filter> addReceiveStream(uint32_t peer, uint16_t port, QString codec, uint8_t rtpNum) = 0; virtual void removeSendVideo(uint32_t sessionID) = 0; virtual void removeSendAudio(uint32_t sessionID) = 0; virtual void removeReceiveVideo(uint32_t sessionID) = 0; virtual void removeReceiveAudio(uint32_t sessionID) = 0; // removes everything related to this peer virtual void removePeer(uint32_t sessionID) = 0; virtual void removeAllPeers() = 0; };
Create Interface for RTP Streamers
feature(Delivery): Create Interface for RTP Streamers
C
isc
ultravideo/kvazzup,ultravideo/kvazzup
643e5ab48ace0512b036e8b65deb36ce2a6565f6
QERY.c
QERY.c
#! /usr/bin/tcc -run /* a simple keypress decoder */ #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <termios.h> #include <unistd.h> #include <string.h> struct termios orig_termios; void disableRawMode() { tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios); } void enableRawMode() { tcgetattr(STDIN_FILENO, &orig_termios); atexit(disableRawMode); struct termios raw = orig_termios; raw.c_lflag &= ~(ECHO | ICANON); tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw); } char c1 = ' '; char c2 = ' '; char c3 = ' '; char c4 = ' '; int test(char c) { c4=c3; c3=c2; c2=c1; c1=c; int t4 = 27; int t3 = 91; int t2 = 50; int t1 = 126; char s4 = t4; char s3 = t3; char s2 = t2; char s1 = t1; int test = (c4==s4) && (c3==s3) && (c2==s2) && (c1==s1); return test; } int main() { enableRawMode(); char c; while (read(STDIN_FILENO, &c, 1) == 1 && c != 'q') { if (iscntrl(c)) { printf("%d\n", c); } else { printf("%d ('%c')\n", c, c); } if (test(c)) {printf("insert\n");} char buf[32]; unsigned int i = 0; /* Query screen for cursor location */ if (write(1, "\x1b[6n", 4) != 4) return 0; while (i < sizeof(buf)-1) { if (read(0,buf+i,1) != 1) break; if (buf[i] == 'R') break; i++; } printf("i = %d\n",i); buf[i] = '\0'; int x; int y; if (buf[0] != 27 || buf[1] != '[') return -1; int leng = strlen(buf); printf("string length = %d\n",leng); printf("<esc>[24;80\n"); int j ; for ( j = 2; j < 7; j++) printf("j = %d buf[%d] = %d\n", j, j, buf + j); // sscanf(buf+2,"%d;%d",x,y); // if (sscanf(buf+2,"%d;%d",x,y) != 2) return -1; // printf("x = %d , y = %d \n", x,y); } return 0; }
Add coding to query the screen to KEYP.c
Add coding to query the screen to KEYP.c
C
bsd-2-clause
eingaeph/pip.imbue.hood,eingaeph/pip.imbue.hood
6493bb2e8d68e7862a9841807073c5a507c9c8e3
defs.c
defs.c
#include <stdio.h> void putStr(const char *str) { fputs(str, stdout); }
#include <stdio.h> #include <gmp.h> void putStr(const char *str) { fputs(str, stdout); } void mpz_set_ull(mpz_t n, unsigned long long ull) { mpz_set_ui(n, (unsigned int)(ull >> 32)); /* n = (unsigned int)(ull >> 32) */ mpz_mul_2exp(n, n, 32); /* n <<= 32 */ mpz_add_ui(n, n, (unsigned int)ull); /* n += (unsigned int)ull */ } unsigned long long mpz_get_ull(mpz_t n) { unsigned int lo, hi; mpz_t tmp; mpz_init( tmp ); mpz_mod_2exp( tmp, n, 64 ); /* tmp = (lower 64 bits of n) */ lo = mpz_get_ui( tmp ); /* lo = tmp & 0xffffffff */ mpz_div_2exp( tmp, tmp, 32 ); /* tmp >>= 32 */ hi = mpz_get_ui( tmp ); /* hi = tmp & 0xffffffff */ mpz_clear( tmp ); return (((unsigned long long)hi) << 32) + lo; }
Fix comparison return values and implement Integer truncation
Fix comparison return values and implement Integer truncation
C
bsd-3-clause
melted/idris-llvm,melted/idris-llvm,idris-hackers/idris-llvm,idris-hackers/idris-llvm
5301e87a423ec2095955328c78b350e14b38a6bc
source/tid/enums.h
source/tid/enums.h
#pragma once #include <string_view> namespace tid { enum level : int { parent = -1, normal = 0, detail = 1, pedant = 2, }; constexpr std::string_view level2sv(level l) noexcept { switch(l) { case normal: return "normal"; case detail: return "detail"; case pedant: return "pedant"; case parent: return "parent"; default: return "unknown"; } } } template<typename T> extern constexpr std::string_view enum2sv(const T &item); template<typename T> extern constexpr auto sv2enum(std::string_view item); template<> constexpr std::string_view enum2sv(const tid::level &item) { switch(item) { case(tid::level::normal): return "normal"; case(tid::level::detail): return "detail"; case(tid::level::pedant): return "pedant"; case(tid::level::parent): return "parent"; default: throw std::runtime_error("Unrecognized tid::level enum"); } } template<> constexpr auto sv2enum<tid::level>(std::string_view item) { if(item == "normal") return tid::level::normal; if(item == "detail") return tid::level::detail; if(item == "pedant") return tid::level::pedant; if(item == "parent") return tid::level::parent; throw std::runtime_error("Given item is not a tid::level enum: " + std::string(item)); }
#pragma once #include <exception> #include <string_view> namespace tid { enum level : int { parent = -1, normal = 0, detail = 1, pedant = 2, }; constexpr std::string_view level2sv(level l) noexcept { switch(l) { case normal: return "normal"; case detail: return "detail"; case pedant: return "pedant"; case parent: return "parent"; default: return "unknown"; } } } template<typename T> extern constexpr std::string_view enum2sv(const T &item); template<typename T> extern constexpr auto sv2enum(std::string_view item); template<> constexpr std::string_view enum2sv(const tid::level &item) { switch(item) { case(tid::level::normal): return "normal"; case(tid::level::detail): return "detail"; case(tid::level::pedant): return "pedant"; case(tid::level::parent): return "parent"; default: throw std::runtime_error("Unrecognized tid::level enum"); } } template<> constexpr auto sv2enum<tid::level>(std::string_view item) { if(item == "normal") return tid::level::normal; if(item == "detail") return tid::level::detail; if(item == "pedant") return tid::level::pedant; if(item == "parent") return tid::level::parent; throw std::runtime_error("Given item is not a tid::level enum"); }
Fix include headers after refactor
Fix include headers after refactor Former-commit-id: 7570681cb07311ab05e4f039e6c023fb3fe5f5a5
C
mit
DavidAce/DMRG,DavidAce/DMRG,DavidAce/DMRG,DavidAce/DMRG
1432cf072b1fb914e514603ea5a65677a450d3fc
src/blobsBack.c
src/blobsBack.c
#include <stdlib.h> #include "blobsBack.h" int requestCmd(int player, typeCommand* command) { command = NULL; //if() return 1; }
#include <stdlib.h> #include "blobsBack.h" int canMove(int player, typeBoard* board) { int i, j; for(i = 0; i < board->h; i++) { for(j = 0; j < board->w; j++) { if(board->get[i][j].owner == player && board->get[i][j].canMove) { return 1; } } } return 0; } char* getCommand(typeCommand* command) { } int isInside(int x, int y, int w, int h) { if(x >= 0 && x < w && y >= 0 && y < h) return 1; else return 0; } int validCommand(typeCommand* command, typeBoard* board, int player) { if(!isInside(command->source.x, command->source.y, board->w, board->h)) return 0; else if(!isInside(command->target.x, command->target.y, board->w, board->h)) return 0; else if(abs(command->source.x - command->target.x) > 2 || abs(command->source.y - command->target.y) > 2) return 0; else if(board->get[command->source.y][command->source.x].owner != player) return 0; else if(board->get[command->target.y][command->target.x].owner != 0) return 0; else return 1; }
Add canMove, isInside and validCommand
Add canMove, isInside and validCommand
C
mit
lucas-emery/TPE
bfb029f6ff779c828039be7f0d1eb061376d5006
tests/testCaseSingleton.h
tests/testCaseSingleton.h
#ifndef TESTCASESINGLETON_H #define TESTCASESINGLETON_H #include "CppDiFactory.h" class IEngine { public: virtual double getVolume() const = 0; virtual ~IEngine() = default; }; class Engine : public IEngine { public: virtual double getVolume() const override { return 10.5; } }; TEST_CASE( "Singleton Test", "Check if two instances of a registered singleton are equal" ){ CppDiFactory::DiFactory myFactory; myFactory.registerSingleton<Engine>().withInterfaces<IEngine>(); auto engine = myFactory.getInstance<IEngine>(); auto engine2 = myFactory.getInstance<IEngine>(); CHECK(engine == engine2); } #endif // TESTCASESINGLETON_H
#ifndef TESTCASESINGLETON_H #define TESTCASESINGLETON_H #include "CppDiFactory.h" namespace testCaseSingleton { class IEngine { public: virtual double getVolume() const = 0; virtual ~IEngine() = default; }; class Engine : public IEngine { private: static bool _valid; public: Engine() { _valid = true; } virtual ~Engine () { _valid = false; } virtual double getVolume() const override { return 10.5; } static bool isValid() { return _valid; } }; bool Engine::_valid = false; TEST_CASE( "Singleton Test", "Check if two instances of a registered singleton are equal" ){ CppDiFactory::DiFactory myFactory; myFactory.registerSingleton<Engine>().withInterfaces<IEngine>(); auto engine = myFactory.getInstance<IEngine>(); auto engine2 = myFactory.getInstance<IEngine>(); CHECK(engine == engine2); } TEST_CASE( "Singleton Lifetime test", "Check that the lifetime of the singleton is correct (alive while used)" ){ CppDiFactory::DiFactory myFactory; myFactory.registerSingleton<Engine>().withInterfaces<IEngine>(); std::shared_ptr<IEngine> spEngine; std::weak_ptr<IEngine> wpEngine; // no request yet --> Engine shouldn't exist yet. CHECK(!Engine::isValid()); //NOTE: use sub-block to ensure that no temporary shared-pointers remain alive { //First call to getInstance should create the engine spEngine = myFactory.getInstance<IEngine>(); CHECK(Engine::isValid()); } //shared pointer is alive --> engine should still exist //NOTE: use sub-block to ensure that no temporary shared-pointers remain alive { CHECK(Engine::isValid()); //second call should get same instance wpEngine = myFactory.getInstance<IEngine>(); CHECK(wpEngine.lock() == spEngine); } //remove the only shared pointer to the engine (--> engine should get destroyed) spEngine.reset(); //shared pointer is not alive anymore --> engine should have been destroyed. CHECK(wpEngine.expired()); CHECK(!Engine::isValid()); } } #endif // TESTCASESINGLETON_H
Add tests for singleton lifetime
Add tests for singleton lifetime
C
apache-2.0
bbvch/CppDiFactory