commit
stringlengths
40
40
old_file
stringlengths
4
237
new_file
stringlengths
4
237
old_contents
stringlengths
1
4.24k
new_contents
stringlengths
1
4.87k
subject
stringlengths
15
778
message
stringlengths
15
8.75k
lang
stringclasses
266 values
license
stringclasses
13 values
repos
stringlengths
5
127k
f622310d2f63f1842f986448a67483be9aefdec1
webkit/fileapi/quota_file_util.h
webkit/fileapi/quota_file_util.h
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_ #define WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_ #include "webkit/fileapi/file_system_file_util.h" #include "webkit/fileapi/file_system_operation_context.h" #pragma once namespace fileapi { class QuotaFileUtil : public FileSystemFileUtil { public: static QuotaFileUtil* GetInstance(); ~QuotaFileUtil() {} static const int64 kNoLimit; base::PlatformFileError CopyOrMoveFile( FileSystemOperationContext* fs_context, const FilePath& src_file_path, const FilePath& dest_file_path, bool copy); // TODO(dmikurube): Charge some amount of quota for directories. base::PlatformFileError Truncate( FileSystemOperationContext* fs_context, const FilePath& path, int64 length); friend struct DefaultSingletonTraits<QuotaFileUtil>; DISALLOW_COPY_AND_ASSIGN(QuotaFileUtil); protected: QuotaFileUtil() {} }; } // namespace fileapi #endif // WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_ #define WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_ #include "webkit/fileapi/file_system_file_util.h" #include "webkit/fileapi/file_system_operation_context.h" #pragma once namespace fileapi { class QuotaFileUtil : public FileSystemFileUtil { public: static QuotaFileUtil* GetInstance(); ~QuotaFileUtil() {} static const int64 kNoLimit; virtual base::PlatformFileError CopyOrMoveFile( FileSystemOperationContext* fs_context, const FilePath& src_file_path, const FilePath& dest_file_path, bool copy); // TODO(dmikurube): Charge some amount of quota for directories. virtual base::PlatformFileError Truncate( FileSystemOperationContext* fs_context, const FilePath& path, int64 length); friend struct DefaultSingletonTraits<QuotaFileUtil>; DISALLOW_COPY_AND_ASSIGN(QuotaFileUtil); protected: QuotaFileUtil() {} }; } // namespace fileapi #endif // WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_
Add virtual in QuitaFileUtil to fix the compilation error in r82441.
Add virtual in QuitaFileUtil to fix the compilation error in r82441. TBR=dmikurube,kinuko BUG=none TEST=none Review URL: http://codereview.chromium.org/6882112 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@82445 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
ChromiumWebApps/chromium,nacl-webkit/chrome_deps,dushu1203/chromium.src,zcbenz/cefode-chromium,hujiajie/pa-chromium,robclark/chromium,dednal/chromium.src,M4sse/chromium.src,littlstar/chromium.src,Jonekee/chromium.src,dednal/chromium.src,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,junmin-zhu/chromium-rivertrail,robclark/chromium,anirudhSK/chromium,anirudhSK/chromium,timopulkkinen/BubbleFish,keishi/chromium,dushu1203/chromium.src,keishi/chromium,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,fujunwei/chromium-crosswalk,patrickm/chromium.src,ltilve/chromium,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,hujiajie/pa-chromium,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,markYoungH/chromium.src,dednal/chromium.src,mogoweb/chromium-crosswalk,anirudhSK/chromium,mogoweb/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,Jonekee/chromium.src,Chilledheart/chromium,pozdnyakov/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,axinging/chromium-crosswalk,jaruba/chromium.src,keishi/chromium,robclark/chromium,rogerwang/chromium,dushu1203/chromium.src,junmin-zhu/chromium-rivertrail,anirudhSK/chromium,hgl888/chromium-crosswalk,anirudhSK/chromium,PeterWangIntel/chromium-crosswalk,keishi/chromium,rogerwang/chromium,Pluto-tv/chromium-crosswalk,rogerwang/chromium,Fireblend/chromium-crosswalk,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,fujunwei/chromium-crosswalk,Just-D/chromium-1,patrickm/chromium.src,keishi/chromium,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,markYoungH/chromium.src,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,robclark/chromium,dednal/chromium.src,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,junmin-zhu/chromium-rivertrail,krieger-od/nwjs_chromium.src,hujiajie/pa-chromium,jaruba/chromium.src,mogoweb/chromium-crosswalk,anirudhSK/chromium,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,chuan9/chromium-crosswalk,mogoweb/chromium-crosswalk,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,zcbenz/cefode-chromium,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,ChromiumWebApps/chromium,ltilve/chromium,axinging/chromium-crosswalk,littlstar/chromium.src,fujunwei/chromium-crosswalk,Just-D/chromium-1,ChromiumWebApps/chromium,Chilledheart/chromium,rogerwang/chromium,markYoungH/chromium.src,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,ondra-novak/chromium.src,junmin-zhu/chromium-rivertrail,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,Just-D/chromium-1,zcbenz/cefode-chromium,nacl-webkit/chrome_deps,chuan9/chromium-crosswalk,markYoungH/chromium.src,Chilledheart/chromium,M4sse/chromium.src,robclark/chromium,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,Just-D/chromium-1,crosswalk-project/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,Just-D/chromium-1,junmin-zhu/chromium-rivertrail,chuan9/chromium-crosswalk,keishi/chromium,mohamed--abdel-maksoud/chromium.src,rogerwang/chromium,ondra-novak/chromium.src,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,zcbenz/cefode-chromium,krieger-od/nwjs_chromium.src,Just-D/chromium-1,nacl-webkit/chrome_deps,ondra-novak/chromium.src,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,nacl-webkit/chrome_deps,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,jaruba/chromium.src,keishi/chromium,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,anirudhSK/chromium,zcbenz/cefode-chromium,bright-sparks/chromium-spacewalk,pozdnyakov/chromium-crosswalk,nacl-webkit/chrome_deps,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,M4sse/chromium.src,hgl888/chromium-crosswalk,ondra-novak/chromium.src,jaruba/chromium.src,littlstar/chromium.src,hujiajie/pa-chromium,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,rogerwang/chromium,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,M4sse/chromium.src,ondra-novak/chromium.src,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,hujiajie/pa-chromium,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,junmin-zhu/chromium-rivertrail,nacl-webkit/chrome_deps,crosswalk-project/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,littlstar/chromium.src,Just-D/chromium-1,patrickm/chromium.src,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,robclark/chromium,rogerwang/chromium,littlstar/chromium.src,Pluto-tv/chromium-crosswalk,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,bright-sparks/chromium-spacewalk,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,patrickm/chromium.src,dednal/chromium.src,dednal/chromium.src,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,ltilve/chromium,pozdnyakov/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,littlstar/chromium.src,axinging/chromium-crosswalk,ltilve/chromium,TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,Fireblend/chromium-crosswalk,Fireblend/chromium-crosswalk,nacl-webkit/chrome_deps,PeterWangIntel/chromium-crosswalk,anirudhSK/chromium,hgl888/chromium-crosswalk,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,keishi/chromium,zcbenz/cefode-chromium,fujunwei/chromium-crosswalk,robclark/chromium,markYoungH/chromium.src,ondra-novak/chromium.src,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,chuan9/chromium-crosswalk,M4sse/chromium.src,junmin-zhu/chromium-rivertrail,patrickm/chromium.src,markYoungH/chromium.src,ChromiumWebApps/chromium,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,anirudhSK/chromium,ltilve/chromium,ChromiumWebApps/chromium,littlstar/chromium.src,ondra-novak/chromium.src,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,junmin-zhu/chromium-rivertrail,dednal/chromium.src,PeterWangIntel/chromium-crosswalk,hujiajie/pa-chromium,ltilve/chromium,Jonekee/chromium.src,axinging/chromium-crosswalk,M4sse/chromium.src,zcbenz/cefode-chromium,ondra-novak/chromium.src,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,robclark/chromium,nacl-webkit/chrome_deps,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,robclark/chromium,zcbenz/cefode-chromium,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,robclark/chromium,mogoweb/chromium-crosswalk,timopulkkinen/BubbleFish,timopulkkinen/BubbleFish,Chilledheart/chromium,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,anirudhSK/chromium,Jonekee/chromium.src,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,dushu1203/chromium.src,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,Jonekee/chromium.src,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,ltilve/chromium,chuan9/chromium-crosswalk,mogoweb/chromium-crosswalk,jaruba/chromium.src,ltilve/chromium,rogerwang/chromium,junmin-zhu/chromium-rivertrail,jaruba/chromium.src,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,mogoweb/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,hgl888/chromium-crosswalk,dednal/chromium.src,jaruba/chromium.src,bright-sparks/chromium-spacewalk,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,jaruba/chromium.src,patrickm/chromium.src,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,M4sse/chromium.src,hgl888/chromium-crosswalk,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,anirudhSK/chromium,keishi/chromium,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,keishi/chromium,rogerwang/chromium,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,ltilve/chromium,rogerwang/chromium,Jonekee/chromium.src,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,Chilledheart/chromium,krieger-od/nwjs_chromium.src,keishi/chromium,Just-D/chromium-1,M4sse/chromium.src,dednal/chromium.src,zcbenz/cefode-chromium,jaruba/chromium.src,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,patrickm/chromium.src,hujiajie/pa-chromium
5edb41c49e77f1174d177c18765117d95d8fe626
Settings/Updater/Version.h
Settings/Updater/Version.h
#pragma once #include <string> struct Version { public: Version(int major = 0, int minor = 0, int revision = 0) : _major(major), _minor(minor), _revision(revision) { } const int Major() { return _major; } const int Minor() { return _minor; } const int Revision() { return _revision; } } std::wstring ToString() { return std::to_wstring(_major) + L"." + std::to_wstring(_minor) + L"." + std::to_wstring(_revision); } private: int _major; int _minor; int _revision; };
#pragma once #include <string> struct Version { public: Version(int major = 0, int minor = 0, int revision = 0) : _major(major), _minor(minor), _revision(revision) { } const int Major() { return _major; } const int Minor() { return _minor; } const int Revision() { return _revision; } unsigned int ToInt() { return (_major << 16) | (_minor << 8) | (_revision); } std::wstring ToString() { return std::to_wstring(_major) + L"." + std::to_wstring(_minor) + L"." + std::to_wstring(_revision); } private: int _major; int _minor; int _revision; };
Add convenience function to calculate the integer representation of the version
Add convenience function to calculate the integer representation of the version
C
bsd-2-clause
malensek/3RVX,malensek/3RVX,malensek/3RVX
6124cff77065f8dbc06ba9a381286155d199ce6a
config.h
config.h
#ifndef CJET_CONFIG_H #define CJET_CONFIG_H #define SERVER_PORT 7899 #define LISTEN_BACKLOG 40 #define MAX_MESSAGE_SIZE 128 /* Linux specific configs */ #define MAX_EPOLL_EVENTS 100 #endif
#ifndef CJET_CONFIG_H #define CJET_CONFIG_H #define SERVER_PORT 11122 #define LISTEN_BACKLOG 40 #define MAX_MESSAGE_SIZE 128 /* Linux specific configs */ #define MAX_EPOLL_EVENTS 100 #endif
Change server port to the correct jet port.
Change server port to the correct jet port.
C
mit
gatzka/cjet,gatzka/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,mloy/cjet
58891e06f5ecae32726cd126ca5e66f5f9e33485
core/core.c
core/core.c
#include <uEye.h> #include "core.h" #if PY_MAJOR_VERSION >= 3 /* * This is only needed for Python3 * IDS module initialization * Based on https://docs.python.org/3/extending/extending.html#the-module-s-method-table-and-initialization-function */ static struct PyModuleDef idsModule = { PyModuleDef_HEAD_INIT, "ids", /* name of module */ NULL, /* module documentation */ -1, /* size of perinterpreter state of the module, or -1 if the module keeps state in global variables. */ idsMethods }; #endif #if PY_MAJOR_VERSION >= 3 PyMODINIT_FUNC PyInit_ids(void) { return PyModule_Create(&idsModule); } #else PyMODINIT_FUNC initids(void) { (void) Py_InitModule("ids", idsMethods); } #endif int main(int argc, char *argv[]) { #if PY_MAJOR_VERSION >= 3 wchar_t name[128]; mbstowcs(name, argv[0], 128); #else char name[128]; strncpy(name, argv[0], 128); #endif /* Pass argv[0] to the Pythin interpreter */ Py_SetProgramName(name); /* Initialize the Python interpreter */ Py_Initialize(); /* Add a static module */ #if PY_MAJOR_VERSION >= 3 PyInit_ids(); #else initids(); #endif }
#include <uEye.h> #include "core.h" #if PY_MAJOR_VERSION >= 3 /* * This is only needed for Python3 * IDS module initialization * Based on https://docs.python.org/3/extending/extending.html#the-module-s-method-table-and-initialization-function */ static struct PyModuleDef idsModule = { PyModuleDef_HEAD_INIT, "ids", /* name of module */ NULL, /* module documentation */ -1, /* size of perinterpreter state of the module, or -1 if the module keeps state in global variables. */ idsMethods }; #endif #if PY_MAJOR_VERSION >= 3 PyMODINIT_FUNC PyInit_core(void) { return PyModule_Create(&idsModule); } #else PyMODINIT_FUNC initcore(void) { (void) Py_InitModule("core", idsMethods); } #endif int main(int argc, char *argv[]) { #if PY_MAJOR_VERSION >= 3 wchar_t name[128]; mbstowcs(name, argv[0], 128); #else char name[128]; strncpy(name, argv[0], 128); #endif /* Pass argv[0] to the Pythin interpreter */ Py_SetProgramName(name); /* Initialize the Python interpreter */ Py_Initialize(); /* Add a static module */ #if PY_MAJOR_VERSION >= 3 PyInit_core(); #else initcore(); #endif }
Fix linker error by changing init function names to represent module names
Fix linker error by changing init function names to represent module names
C
mit
FrostadResearchGroup/IDS,FrostadResearchGroup/IDS
a0cf73a4f8db9c8c292831902ec2ea60d0c58cae
firmware/usb.h
firmware/usb.h
#ifndef USB_H #define USB_H void setup_usb(); void usb_interrupt_handler(); #endif
#ifndef USB_H #define USB_H #define PHYS_ADDR(VIRTUAL_ADDR) (unsigned int)(VIRTUAL_ADDR) #define EP0_BUFLEN 8 #define EP1_BUFLEN 8 #define USB_PID_SETUP 0x0d #define USB_REQ_GET_DESCRIPTOR 0x06 #define USB_GET_DEVICE_DESCRIPTOR 0x01 #define USB_GET_CONFIG_DESCRIPTOR 0x02 #define USB_GET_STRING_DESCRIPTOR 0x03 #define USB_REQ_GET_STATUS 0x00 #define USB_REQ_SET_ADDRESS 0x05 #define USB_REQ_SET_CONFIGURATION 0x09 void reset_usb ( ); void usb_interrupt_handler ( ); bool usb_in_endpoint_busy ( uint8_t ep ); void usb_arm_in_transfert ( ); #endif
Add macros for setting Endpoint buffers length,
Add macros for setting Endpoint buffers length, Define some USB magic values Export two fonctions for the main loop
C
mit
macareux-labs/hyg-usb_firmware,macareux-labs/hyg-usb_firmware
63eaf55f3ec45366e1ef5dab02f1d98a096d1ea2
dashboard.h
dashboard.h
#ifndef DASHBOARD_H #define DASHBOARD_H #include <sys/types.h> #include "src/process/process.h" #include "src/system/sys_stats.h" typedef struct { int max_x; int max_y; int prev_x; int prev_y; char *fieldbar; sysaux *system; ps_node *process_list; Tree *process_tree; } Board; void print_usage(void); char set_sort_option(char *opt); void dashboard_mainloop(char attr_sort); void update_process_stats(Tree *ps_tree, ps_node *ps, sysaux *sys); static int calculate_ln_diff(Board *board, int ln, int prev_ln); Board *init_board(void); void free_board(Board *board); #endif
#ifndef DASHBOARD_H #define DASHBOARD_H #include <sys/types.h> #include "src/process/process.h" #include "src/system/sys_stats.h" typedef struct { int max_x; int max_y; int prev_x; int prev_y; char *fieldbar; sysaux *system; ps_node *process_list; Tree *process_tree; } Board; void print_usage(void); char set_sort_option(char *opt); void dashboard_mainloop(char attr_sort); void update_process_stats(Tree *ps_tree, ps_node *ps, sysaux *sys); Board *init_board(void); void free_board(Board *board); #endif
Remove static declaration of line diff
Remove static declaration of line diff
C
mit
tijko/dashboard
c24576e6e6c440898788d5874f80e8ca74316f08
src/public/WRLDRoutingService.h
src/public/WRLDRoutingService.h
#pragma once #import "WRLDRoutingQuery.h" #import "WRLDRoutingQueryOptions.h" NS_ASSUME_NONNULL_BEGIN /*! A service which allows you to find routes between locations. Created by the createRoutingService method of the WRLDMapView object. This is an Objective-c interface to the WRLD Routing REST API (https://github.com/wrld3d/wrld-routing-api). */ @interface WRLDRoutingService : NSObject /*! Asynchronously query the routing service. The results of the query will be passed as a WRLDRoutingQueryResponse to the routingQueryDidComplete method in WRLDMapViewDelegate. @param options The parameters of the routing query. @returns A handle to the ongoing query, which can be used to cancel it. */ - (WRLDRoutingQuery*)findRoutes:(WRLDRoutingQueryOptions*)options; @end NS_ASSUME_NONNULL_END
#pragma once #import "WRLDRoutingQuery.h" #import "WRLDRoutingQueryOptions.h" NS_ASSUME_NONNULL_BEGIN /*! A service which allows you to find routes between locations. Created by the createRoutingService method of the WRLDMapView object. This is an Objective-c interface to the [WRLD Routing REST API](https://github.com/wrld3d/wrld-routing-api). */ @interface WRLDRoutingService : NSObject /*! Asynchronously query the routing service. The results of the query will be passed as a WRLDRoutingQueryResponse to the routingQueryDidComplete method in WRLDMapViewDelegate. @param options The parameters of the routing query. @returns A handle to the ongoing query, which can be used to cancel it. */ - (WRLDRoutingQuery*)findRoutes:(WRLDRoutingQueryOptions*)options; @end NS_ASSUME_NONNULL_END
Fix for [MPLY-9800]. Doc string didn't link correctly. Buddy: Sam A.
Fix for [MPLY-9800]. Doc string didn't link correctly. Buddy: Sam A.
C
bsd-2-clause
wrld3d/ios-api,wrld3d/ios-api,wrld3d/ios-api,wrld3d/ios-api
af6a25f0e1ec0265c267e6ee4513925eaba6d0ed
arch/x86/include/asm/mmu.h
arch/x86/include/asm/mmu.h
#ifndef _ASM_X86_MMU_H #define _ASM_X86_MMU_H #include <linux/spinlock.h> #include <linux/mutex.h> /* * The x86 doesn't have a mmu context, but * we put the segment information here. */ typedef struct { void *ldt; int size; struct mutex lock; void *vdso; #ifdef CONFIG_X86_64 /* True if mm supports a task running in 32 bit compatibility mode. */ unsigned short ia32_compat; #endif } mm_context_t; #ifdef CONFIG_SMP void leave_mm(int cpu); #else static inline void leave_mm(int cpu) { } #endif #endif /* _ASM_X86_MMU_H */
#ifndef _ASM_X86_MMU_H #define _ASM_X86_MMU_H #include <linux/spinlock.h> #include <linux/mutex.h> /* * The x86 doesn't have a mmu context, but * we put the segment information here. */ typedef struct { void *ldt; int size; #ifdef CONFIG_X86_64 /* True if mm supports a task running in 32 bit compatibility mode. */ unsigned short ia32_compat; #endif struct mutex lock; void *vdso; } mm_context_t; #ifdef CONFIG_SMP void leave_mm(int cpu); #else static inline void leave_mm(int cpu) { } #endif #endif /* _ASM_X86_MMU_H */
Reorder mm_context_t to remove x86_64 alignment padding and thus shrink mm_struct
x86: Reorder mm_context_t to remove x86_64 alignment padding and thus shrink mm_struct Reorder mm_context_t to remove alignment padding on 64 bit builds shrinking its size from 64 to 56 bytes. This allows mm_struct to shrink from 840 to 832 bytes, so using one fewer cache lines, and getting more objects per slab when using slub. slabinfo mm_struct reports before :- Sizes (bytes) Slabs ----------------------------------- Object : 840 Total : 7 SlabObj: 896 Full : 1 SlabSiz: 16384 Partial: 4 Loss : 56 CpuSlab: 2 Align : 64 Objects: 18 after :- Sizes (bytes) Slabs ---------------------------------- Object : 832 Total : 7 SlabObj: 832 Full : 1 SlabSiz: 16384 Partial: 4 Loss : 0 CpuSlab: 2 Align : 64 Objects: 19 Signed-off-by: Richard Kennedy <320bca71fc381a4a025636043ca86e734e31cf8b@rsk.demon.co.uk> Cc: 3d378e0efa9324a1bec5e3bea0c8445f2cc384d0@start.ca Cc: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org> Cc: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org> Cc: Pekka Enberg <add4fcd06328a394f0ad91feda7ee057316dc5ed@kernel.org> Link: f96f24409da09dd8fdaa8f3abbce8686f58ad694@castor.rsk Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>
C
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
a8053f72e54e41011cad782cb37801dc26af6251
src/xenia/base/platform_linux.h
src/xenia/base/platform_linux.h
/** ****************************************************************************** * Xenia : Xbox 360 Emulator Research Project * ****************************************************************************** * Copyright 2015 Ben Vanik. All rights reserved. * * Released under the BSD license - see LICENSE in the root for more details. * ****************************************************************************** */ #ifndef XENIA_BASE_PLATFORM_X11_H_ #define XENIA_BASE_PLATFORM_X11_H_ // NOTE: if you're including this file it means you are explicitly depending // on Linux headers. Including this file outside of linux platform specific // source code will break portability #include "xenia/base/platform.h" // Xlib is used only for GLX interaction, the window management and input // events are done with gtk/gdk #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xos.h> //Used for window management. Gtk is for GUI and wigets, gdk is for lower //level events like key presses, mouse events, etc #include <gtk/gtk.h> #include <gdk/gdk.h> #endif // XENIA_BASE_PLATFORM_X11_H_
/** ****************************************************************************** * Xenia : Xbox 360 Emulator Research Project * ****************************************************************************** * Copyright 2015 Ben Vanik. All rights reserved. * * Released under the BSD license - see LICENSE in the root for more details. * ****************************************************************************** */ #ifndef XENIA_BASE_PLATFORM_X11_H_ #define XENIA_BASE_PLATFORM_X11_H_ // NOTE: if you're including this file it means you are explicitly depending // on Linux headers. Including this file outside of linux platform specific // source code will break portability #include "xenia/base/platform.h" // Xlib/Xcb is used only for GLX/Vulkan interaction, the window management // and input events are done with gtk/gdk #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xos.h> #include <xcb/xcb.h> //Used for window management. Gtk is for GUI and wigets, gdk is for lower //level events like key presses, mouse events, etc #include <gtk/gtk.h> #include <gdk/gdk.h> #endif // XENIA_BASE_PLATFORM_X11_H_
Add xcb headers to linux platform, needed for vulkan
Add xcb headers to linux platform, needed for vulkan
C
bsd-3-clause
sephiroth99/xenia,sephiroth99/xenia,sephiroth99/xenia
a2b4a2dcb9d2b009347a838c6f2c3895eb7e23b9
src/graphics/buffer_lock_manager.h
src/graphics/buffer_lock_manager.h
#ifndef SRC_GRAPHICS_BUFFER_LOCK_MANAGER_H_ #define SRC_GRAPHICS_BUFFER_LOCK_MANAGER_H_ #include <vector> #include "./gl.h" namespace Graphics { struct BufferRange { size_t startOffset; size_t length; size_t endOffset() const { return startOffset + length; } bool overlaps(const BufferRange &other) const { return startOffset < other.endOffset() && other.startOffset < endOffset(); } }; struct BufferLock { BufferRange range; GLsync syncObject; }; /** * \brief * * */ class BufferLockManager { public: explicit BufferLockManager(bool runUpdatesOnCPU); ~BufferLockManager(); void initialize(Gl *gl); void waitForLockedRange(size_t lockBeginBytes, size_t lockLength); void lockRange(size_t lockBeginBytes, size_t lockLength); private: void wait(GLsync *syncObject); void cleanup(BufferLock *bufferLock); std::vector<BufferLock> bufferLocks; bool runUpdatesOnCPU; Gl *gl; }; } // namespace Graphics #endif // SRC_GRAPHICS_BUFFER_LOCK_MANAGER_H_
#ifndef SRC_GRAPHICS_BUFFER_LOCK_MANAGER_H_ #define SRC_GRAPHICS_BUFFER_LOCK_MANAGER_H_ #include <vector> #include "./gl.h" namespace Graphics { /** * \brief Encapsulates a locked buffer range * * It stores the start offset in the buffer and the length of the range. * The end offset can be retrieved with #endOffset(). * * The method #overlaps() checks if the range overlaps with the * given range. */ struct BufferRange { size_t startOffset; size_t length; size_t endOffset() const { return startOffset + length; } bool overlaps(const BufferRange &other) const { return startOffset < other.endOffset() && other.startOffset < endOffset(); } }; /** * \brief Lock on a buffer determined by \link BufferRange range \endlink and * a sync object */ struct BufferLock { BufferRange range; GLsync syncObject; }; /** * \brief Manages locks for a buffer * * Locks can be acquired with #lockRange() and #waitForLockedRange() waits until * the range is free again. */ class BufferLockManager { public: explicit BufferLockManager(bool runUpdatesOnCPU); ~BufferLockManager(); void initialize(Gl *gl); void waitForLockedRange(size_t lockBeginBytes, size_t lockLength); void lockRange(size_t lockBeginBytes, size_t lockLength); private: void wait(GLsync *syncObject); void cleanup(BufferLock *bufferLock); std::vector<BufferLock> bufferLocks; bool runUpdatesOnCPU; Gl *gl; }; } // namespace Graphics #endif // SRC_GRAPHICS_BUFFER_LOCK_MANAGER_H_
Add Documentation for BufferLockManger, BufferRange and BufferLock.
Add Documentation for BufferLockManger, BufferRange and BufferLock.
C
mit
Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller
229ee65b7c5274857b4bb320231c46dc4c9e828a
pyobjus/_runtime.h
pyobjus/_runtime.h
#include <objc/runtime.h> #include <objc/message.h> #include <stdio.h> #include <dlfcn.h> #include <string.h> static void pyobjc_internal_init() { static void *foundation = NULL; if ( foundation == NULL ) { foundation = dlopen( "/Groups/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation", RTLD_LAZY); if ( foundation == NULL ) { printf("Got dlopen error on Foundation\n"); return; } } } id allocAndInitAutoreleasePool() { Class NSAutoreleasePoolClass = (Class)objc_getClass("NSAutoreleasePool"); id pool = class_createInstance(NSAutoreleasePoolClass, 0); return objc_msgSend(pool, sel_registerName("init")); } void drainAutoreleasePool(id pool) { (void)objc_msgSend(pool, sel_registerName("drain")); }
#include <objc/runtime.h> #include <objc/message.h> #include <stdio.h> #include <dlfcn.h> #include <string.h> static void pyobjc_internal_init() { static void *foundation = NULL; if ( foundation == NULL ) { foundation = dlopen( "/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation", RTLD_LAZY); if ( foundation == NULL ) { foundation = dlopen( "/Groups/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation", RTLD_LAZY); if ( foundation == NULL ) { printf("Got dlopen error on Foundation\n"); return; } } } } id allocAndInitAutoreleasePool() { Class NSAutoreleasePoolClass = (Class)objc_getClass("NSAutoreleasePool"); id pool = class_createInstance(NSAutoreleasePoolClass, 0); return objc_msgSend(pool, sel_registerName("init")); } void drainAutoreleasePool(id pool) { (void)objc_msgSend(pool, sel_registerName("drain")); }
Add fallback path for Foundation lookup
Add fallback path for Foundation lookup
C
mit
kivy/pyobjus,kivy/pyobjus,kivy/pyobjus
bd345a5053f310aaeefcd9653470a6fbca847340
Pod/Classes/Internal/STMRecordingOverlayViewController.h
Pod/Classes/Internal/STMRecordingOverlayViewController.h
// // STMRecordingOverlayViewController.h // Pods // // Created by Tyler Clemens on 9/14/15. // // #import <UIKit/UIKit.h> #import "VoiceCmdView.h" @protocol STMRecordingOverlayDelegate; @interface STMRecordingOverlayViewController : UIViewController<VoiceCmdViewDelegate, SendShoutDelegate> @property (atomic) id<STMRecordingOverlayDelegate> delegate; @property double MaxListeningSeconds; @property NSString *tags; @property NSString *topic; -(void)userRequestsStopListening; -(id)initWithTags:(NSString *)tags andTopic:(NSString *)topic; @end @protocol STMRecordingOverlayDelegate <NSObject> -(void)shoutCreated:(STMShout*)shout error:(NSError*)err; -(void)overlayClosed:(BOOL)bDismissed; @end
// // STMRecordingOverlayViewController.h // Pods // // Created by Tyler Clemens on 9/14/15. // // #import <UIKit/UIKit.h> #import "VoiceCmdView.h" @protocol STMRecordingOverlayDelegate <CreateShoutDelegate> -(void)overlayClosed:(BOOL)bDismissed; @end @interface STMRecordingOverlayViewController : UIViewController<VoiceCmdViewDelegate, SendShoutDelegate> @property (atomic) id<STMRecordingOverlayDelegate> delegate; @property double MaxListeningSeconds; @property NSString *tags; @property NSString *topic; -(void)userRequestsStopListening; -(id)initWithTags:(NSString *)tags andTopic:(NSString *)topic; @end
Refactor STMRecordingOverlayDelegate to inherit from CreateShoutDelegate
Refactor STMRecordingOverlayDelegate to inherit from CreateShoutDelegate
C
mit
ShoutToMe/stm-sdk-ios,ShoutToMe/stm-sdk-ios
9173e91787fdce959346fd338c1e668f6d11e18f
test/Sema/builtin-object-size.c
test/Sema/builtin-object-size.c
// RUN: clang -fsyntax-only -verify %s // RUN: clang -fsyntax-only -triple x86_64-apple-darwin9 -verify %s int a[10]; int f0() { return __builtin_object_size(&a); // expected-error {{too few arguments to function}} } int f1() { return (__builtin_object_size(&a, 0) + __builtin_object_size(&a, 1) + __builtin_object_size(&a, 2) + __builtin_object_size(&a, 3)); } int f2() { return __builtin_object_size(&a, -1); // expected-error {{argument should be a value from 0 to 3}} } int f3() { return __builtin_object_size(&a, 4); // expected-error {{argument should be a value from 0 to 3}} } // rdar://6252231 - cannot call vsnprintf with va_list on x86_64 void f4(const char *fmt, ...) { __builtin_va_list args; __builtin___vsnprintf_chk (0, 42, 0, 11, fmt, args); }
// RUN: clang -fsyntax-only -verify %s && // RUN: clang -fsyntax-only -triple x86_64-apple-darwin9 -verify %s int a[10]; int f0() { return __builtin_object_size(&a); // expected-error {{too few arguments to function}} } int f1() { return (__builtin_object_size(&a, 0) + __builtin_object_size(&a, 1) + __builtin_object_size(&a, 2) + __builtin_object_size(&a, 3)); } int f2() { return __builtin_object_size(&a, -1); // expected-error {{argument should be a value from 0 to 3}} } int f3() { return __builtin_object_size(&a, 4); // expected-error {{argument should be a value from 0 to 3}} } // rdar://6252231 - cannot call vsnprintf with va_list on x86_64 void f4(const char *fmt, ...) { __builtin_va_list args; __builtin___vsnprintf_chk (0, 42, 0, 11, fmt, args); }
Append the test runs with '&&'.
Append the test runs with '&&'. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@57085 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/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
1bf280c8b908c724a08260f785e60899f891e35b
Tests/AsyncTesting.h
Tests/AsyncTesting.h
// // AsyncTesting.h // ContentfulSDK // // Created by Boris Bügling on 05/03/14. // // // Set the flag for a block completion handler #define StartBlock() __block BOOL waitingForBlock = YES // Set the flag to stop the loop #define EndBlock() waitingForBlock = NO // Wait and loop until flag is set #define WaitUntilBlockCompletes() WaitWhile(waitingForBlock) // Macro - Wait for condition to be NO/false in blocks and asynchronous calls #define WaitWhile(condition) \ do { \ NSDate* __startTime = [NSDate date]; \ while(condition) { \ [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; \ if ([[NSDate date] timeIntervalSinceDate:__startTime] > 20.0) { \ XCTAssertFalse(true, @"Asynchronous test timed out."); \ break; \ } \ } \ } while(0)
// // AsyncTesting.h // ContentfulSDK // // Created by Boris Bügling on 05/03/14. // // // Set the flag for a block completion handler #define StartBlock() __block BOOL waitingForBlock = YES // Set the flag to stop the loop #define EndBlock() waitingForBlock = NO // Wait and loop until flag is set #define WaitUntilBlockCompletes() WaitWhile(waitingForBlock) // Macro - Wait for condition to be NO/false in blocks and asynchronous calls #define WaitWhile(condition) \ do { \ NSDate* __startTime = [NSDate date]; \ while(condition) { \ [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; \ if ([[NSDate date] timeIntervalSinceDate:__startTime] > 30.0) { \ XCTAssertFalse(true, @"Asynchronous test timed out."); \ break; \ } \ } \ } while(0)
Increase the asynchronous testing timeout
Increase the asynchronous testing timeout Hopefully will resolve Travis issues.
C
mit
contentful/contentful.objc,davidmdavis/contentful.objc,contentful/contentful.objc,davidmdavis/contentful.objc,contentful/contentful.objc,davidmdavis/contentful.objc
05e3fd2ae7f1d03eeb8338639d0380482d3949f1
lib/radio.h
lib/radio.h
#ifndef RADIO_H_INCLUDED #define RADIO_H_INCLUDED #include <stdint.h> #define RADIO_PACKET_MAX_LEN 64 #define RADIO_PACKET_BUFFER_SIZE 1 typedef enum { PACKET_RECEIVED, } radio_evt_type_t; typedef struct { uint8_t len; uint8_t data[RADIO_PACKET_MAX_LEN]; } radio_packet_t; typedef struct { radio_evt_type_t type; union { radio_packet_t packet; }; } radio_evt_t; typedef void (radio_evt_handler_t)(radio_evt_t * evt); uint32_t radio_init(radio_evt_handler_t * evt_handler); uint32_t radio_send(radio_packet_t * packet); uint32_t radio_receive_start(void); #endif
#ifndef RADIO_H_INCLUDED #define RADIO_H_INCLUDED #include <stdint.h> #define RADIO_PACKET_MAX_LEN 64 #define RADIO_PACKET_BUFFER_SIZE 1 typedef enum { PACKET_RECEIVED, } radio_evt_type_t; typedef struct { uint8_t len; struct __attribute__((packed)) { uint8_t padding : 7; uint8_t ack : 1; } flags; uint8_t data[RADIO_PACKET_MAX_LEN]; } radio_packet_t; typedef struct { radio_evt_type_t type; union { radio_packet_t packet; }; } radio_evt_t; typedef void (radio_evt_handler_t)(radio_evt_t * evt); uint32_t radio_init(radio_evt_handler_t * evt_handler); uint32_t radio_send(radio_packet_t * packet); uint32_t radio_receive_start(void); #endif
Add flag byte to packet structure.
Add flag byte to packet structure.
C
bsd-3-clause
hlnd/nrf51-simple-radio,hlnd/nrf51-simple-radio
ba720db1b44374db3f31647ab1f159e7ce4b115d
test/CodeGen/ffp-contract-option.c
test/CodeGen/ffp-contract-option.c
// RUN: %clang_cc1 -O3 -ffp-contract=fast -triple=powerpc-apple-darwin10 -S -o - %s | FileCheck %s // REQUIRES: powerpc-registered-target float fma_test1(float a, float b, float c) { // CHECK: fmadds float x = a * b; float y = x + c; return y; }
// RUN: %clang_cc1 -O3 -ffp-contract=fast -triple=aarch64-apple-darwin -S -o - %s | FileCheck %s // REQUIRES: aarch64-registered-target float fma_test1(float a, float b, float c) { // CHECK: fmadd float x = a * b; float y = x + c; return y; }
Change -ffp-contract=fast test to run on Aarch64
Change -ffp-contract=fast test to run on Aarch64 (I don't have powerpc enabled in my build and I am changing how -ffp-contract=fast works.) git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@298468 91177308-0d34-0410-b5e6-96231b3b80d8 (cherry picked from commit fa33394bb70481412493fcf40d53ebdb2e738058)
C
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang
45abc5865c967100e72e603102ceb6393a7530ea
tests/class_construction_tracker.h
tests/class_construction_tracker.h
/* * Copyright 2014 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable 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 FRUIT_CLASS_CONSTRUCTION_TRACKER_H #define FRUIT_CLASS_CONSTRUCTION_TRACKER_H /** * This class is useful to keep track of how many instances of a given type are created during the entire program * execution. * * Example use: * class Foo : public ConstructionTracker<Foo> { * ... * }; * * int main() { * ... * assert(Foo::num_objects_constructed == 3); * } */ template <typename T> struct ConstructionTracker { static std::size_t num_objects_constructed; ConstructionTracker() { ++num_objects_constructed; } }; template <typename T> std::size_t ConstructionTracker<T>::num_objects_constructed = 0; #endif // FRUIT_CLASS_CONSTRUCTION_TRACKER_H
/* * Copyright 2014 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable 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 FRUIT_CLASS_CONSTRUCTION_TRACKER_H #define FRUIT_CLASS_CONSTRUCTION_TRACKER_H #include <cstddef> /** * This class is useful to keep track of how many instances of a given type are created during the entire program * execution. * * Example use: * class Foo : public ConstructionTracker<Foo> { * ... * }; * * int main() { * ... * assert(Foo::num_objects_constructed == 3); * } */ template <typename T> struct ConstructionTracker { static std::size_t num_objects_constructed; ConstructionTracker() { ++num_objects_constructed; } }; template <typename T> std::size_t ConstructionTracker<T>::num_objects_constructed = 0; #endif // FRUIT_CLASS_CONSTRUCTION_TRACKER_H
Add a missing import to fix compilation of Fruit tests.
Add a missing import to fix compilation of Fruit tests.
C
apache-2.0
google/fruit,google/fruit,google/fruit
4aa31926c882067cf65c9230e9cfa61d575ae1aa
inc/cc.h
inc/cc.h
/* See LICENSE file for copyright and license details. */ #include <sys/types.h> #ifndef NDEBUG extern int debug; #define DBG(fmt, ...) dbg(fmt, __VA_ARGS__) #define DBGON() (debug = 1) #else #define DBG(...) #define DBGON() #endif #ifndef PREFIX #define PREFIX "/usr/local/" #endif #define TINT long long #define TUINT unsigned long long #define TFLOAT double struct items { char **s; unsigned n; }; extern void die(const char *fmt, ...); extern void dbg(const char *fmt, ...); extern void newitem(struct items *items, char *item); extern void *xmalloc(size_t size); extern void *xcalloc(size_t nmemb, size_t size); extern char *xstrdup(const char *s); extern void *xrealloc(void *buff, register size_t size);
/* See LICENSE file for copyright and license details. */ #include <sys/types.h> #ifndef NDEBUG extern int debug; #define DBG(...) dbg(__VA_ARGS__) #define DBGON() (debug = 1) #else #define DBG(...) #define DBGON() #endif #ifndef PREFIX #define PREFIX "/usr/local/" #endif #define TINT long long #define TUINT unsigned long long #define TFLOAT double struct items { char **s; unsigned n; }; extern void die(const char *fmt, ...); extern void dbg(const char *fmt, ...); extern void newitem(struct items *items, char *item); extern void *xmalloc(size_t size); extern void *xcalloc(size_t nmemb, size_t size); extern char *xstrdup(const char *s); extern void *xrealloc(void *buff, register size_t size);
Remove first parameter of DBG()
Remove first parameter of DBG() This first parameter was disallowing use of DBG() without a second parameter.
C
isc
k0gaMSX/scc,k0gaMSX/scc,k0gaMSX/scc
0c746fc3c3b99b09d0a437f434bbade0640dc9c2
src/dict_example.c
src/dict_example.c
// cc dict_example.c dict.c #include <assert.h> #include <stdio.h> #include <string.h> #include "bool.h" #include "dict.h" int main(int argc, const char *argv[]) { /* allocate a new dict */ struct dict *dict = dict(); /* set key and values to dict */ char *key1 = "key1"; char *key2 = "key2"; char *val1 = "val1"; char *val2 = "val2"; assert(dict_set(dict, key1, strlen(key1), val1) == DICT_OK); assert(dict_set(dict, key2, strlen(key2), val2) == DICT_OK); /* get dict length */ assert(dict_len(dict) == 2); /* get data by key */ assert(dict_get(dict, key1, strlen(key1)) == val1); assert(dict_get(dict, key2, strlen(key2)) == val2); /* iterate dict */ struct dict_iter *iter = dict_iter(dict); struct dict_node *node = NULL; while ((node = dict_iter_next(iter)) != NULL) { printf("%.*s => %s\n", (int)node->len, node->key, node->val); } /* free dict iterator */ dict_iter_free(iter); /* free the dict */ dict_free(dict); return 0; }
// cc dict_example.c dict.c md5.c #include <assert.h> #include <stdio.h> #include <string.h> #include "bool.h" #include "dict.h" int main(int argc, const char *argv[]) { /* allocate a new dict */ struct dict *dict = dict(); /* set key and values to dict */ char *key1 = "key1"; char *key2 = "key2"; char *val1 = "val1"; char *val2 = "val2"; assert(dict_set(dict, key1, strlen(key1), val1) == DICT_OK); assert(dict_set(dict, key2, strlen(key2), val2) == DICT_OK); /* get dict length */ assert(dict_len(dict) == 2); /* get data by key */ assert(dict_get(dict, key1, strlen(key1)) == val1); assert(dict_get(dict, key2, strlen(key2)) == val2); /* iterate dict */ struct dict_iter *iter = dict_iter(dict); struct dict_node *node = NULL; while ((node = dict_iter_next(iter)) != NULL) { printf("%.*s => %s\n", (int)node->len, node->key, (char *)node->val); } /* free dict iterator */ dict_iter_free(iter); /* free the dict */ dict_free(dict); return 0; }
Fix void * casting to char * warning
Fix void * casting to char * warning
C
bsd-2-clause
hit9/C-Snip,hit9/C-Snip
8c2a82270ecc5d88350ca75511ba68f21e42993a
include/core/SkMilestone.h
include/core/SkMilestone.h
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 100 #endif
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 101 #endif
Update Skia milestone to 101
Update Skia milestone to 101 Change-Id: I78fd07c10a8dd3ff76b6040109afdf4b47b69eb0 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510656 Reviewed-by: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com> Auto-Submit: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com> Reviewed-by: Eric Boren <0e499112533c8544f0505ea0d08394fb5ad7d8fa@google.com> Commit-Queue: Eric Boren <0e499112533c8544f0505ea0d08394fb5ad7d8fa@google.com>
C
bsd-3-clause
google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia
62eb7949cb5a593f262a881337474a3012fa8f1c
Source/Private.h
Source/Private.h
#ifndef BUGSNAG_PRIVATE_H #define BUGSNAG_PRIVATE_H #import "Bugsnag.h" #import "BugsnagBreadcrumb.h" @interface BugsnagBreadcrumbs () /** * Reads and return breadcrumb data currently stored on disk */ - (NSArray *_Nullable)cachedBreadcrumbs; @end @interface Bugsnag () /** Get the current Bugsnag configuration. * * This method returns nil if called before +startBugsnagWithApiKey: or * +startBugsnagWithConfiguration:, and otherwise returns the current * configuration for Bugsnag. * * @return The configuration, or nil. */ + (BugsnagConfiguration *_Nullable)configuration; @end #endif // BUGSNAG_PRIVATE_H
/** * Exposes non-public interfaces between the components of the library for * internal use */ #ifndef BUGSNAG_PRIVATE_H #define BUGSNAG_PRIVATE_H #import "Bugsnag.h" #import "BugsnagBreadcrumb.h" @interface BugsnagBreadcrumbs () /** * Reads and return breadcrumb data currently stored on disk */ - (NSArray *_Nullable)cachedBreadcrumbs; @end @interface Bugsnag () /** Get the current Bugsnag configuration. * * This method returns nil if called before +startBugsnagWithApiKey: or * +startBugsnagWithConfiguration:, and otherwise returns the current * configuration for Bugsnag. * * @return The configuration, or nil. */ + (BugsnagConfiguration *_Nullable)configuration; @end #endif // BUGSNAG_PRIVATE_H
Add description to internal header
doc: Add description to internal header
C
mit
bugsnag/bugsnag-cocoa,bugsnag/bugsnag-cocoa,bugsnag/bugsnag-cocoa,bugsnag/bugsnag-cocoa
668205545defd3dea025c55c57f7a5da6ce0408a
HLSpriteKit/HLError.h
HLSpriteKit/HLError.h
// // HLError.h // HLSpriteKit // // Created by Karl Voskuil on 6/6/14. // Copyright (c) 2014 Hilo Games. All rights reserved. // #import <Foundation/Foundation.h> /** The error level for logging non-critical errors using `HLError()`. */ typedef NS_ENUM(NSInteger, HLErrorLevel) { /** Errors. */ HLLevelError, /** Warnings. */ HLLevelWarning, /** Information. */ HLLevelInfo, }; /** Logs a non-critical error. */ static void HLError(HLErrorLevel level, NSString *message) { // TODO: This is a placeholder for a better mechanism for non-critical error logging, // e.g. CocoaLumberjack. NSString *levelLabel; switch (level) { case HLLevelInfo: levelLabel = @"INFO"; break; case HLLevelWarning: levelLabel = @"WARNING"; break; case HLLevelError: levelLabel = @"ERROR"; break; } NSLog(@"%@: %@", levelLabel, message); }
// // HLError.h // HLSpriteKit // // Created by Karl Voskuil on 6/6/14. // Copyright (c) 2014 Hilo Games. All rights reserved. // #import <Foundation/Foundation.h> /** The error level for logging non-critical errors using `HLError()`. */ typedef NS_ENUM(NSInteger, HLErrorLevel) { /** Errors. */ HLLevelError, /** Warnings. */ HLLevelWarning, /** Information. */ HLLevelInfo, }; /** Logs a non-critical error. */ static inline void HLError(HLErrorLevel level, NSString *message) { // TODO: This is a placeholder for a better mechanism for non-critical error logging, // e.g. CocoaLumberjack. NSString *levelLabel; switch (level) { case HLLevelInfo: levelLabel = @"INFO"; break; case HLLevelWarning: levelLabel = @"WARNING"; break; case HLLevelError: levelLabel = @"ERROR"; break; } NSLog(@"%@: %@", levelLabel, message); }
Fix compiler warning for unused function.
Fix compiler warning for unused function.
C
mit
hilogames/HLSpriteKit,hilogames/HLSpriteKit
607a98e1038ac8cfda62e6b9b00d1e1387cfeca3
Set/Set.h
Set/Set.h
// // Set.h // Set // // Created by Rob Rix on 2014-06-22. // Copyright (c) 2014 Rob Rix. All rights reserved. // #import <Cocoa/Cocoa.h> //! Project version number for Set. FOUNDATION_EXPORT double SetVersionNumber; //! Project version string for Set. FOUNDATION_EXPORT const unsigned char SetVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <Set/PublicHeader.h>
// Copyright (c) 2014 Rob Rix. All rights reserved. /// Project version number for Set. extern double SetVersionNumber; /// Project version string for Set. extern const unsigned char SetVersionString[];
Tidy up the umbrella header.
Tidy up the umbrella header.
C
mit
IngmarStein/Set,IngmarStein/Set,madbat/Set,IngmarStein/Set,robrix/Set,robrix/Set,natecook1000/Set,natecook1000/Set,natecook1000/Set,madbat/Set,madbat/Set,robrix/Set
0359b53645d2e067d4b41cb1c41396946ad6de7c
src/core/types.c
src/core/types.c
#include <ljit/types.h> ljit_value ljit_new_value(ljit_types type) { ljit_value val = NULL; if ((val = malloc(sizeof(ljit_value))) == NULL) return NULL; val->type = type; val->is_cst = 0; val->is_tmp = 0; val->index = 0; val->data = NULL; return val; } void ljit_free_value(ljit_value value) { if (!value) return; free(value->data); free(value); } ljit_value ljit_new_uchar_cst(ljit_uchar value) { ljit_value cst = ljit_new_value(LJIT_UCHAR); ljit_uchar *val = NULL; if (!cst) return NULL; if ((val = malloc(sizeof(ljit_uchar))) == NULL) { ljit_free_value(cst); return NULL; } *val = value; cst->data = val; cst->is_cst = 1; return cst; }
#include <ljit/types.h> ljit_value ljit_new_value(ljit_types type) { ljit_value val = NULL; if ((val = malloc(sizeof(struct ljit_value_s))) == NULL) return NULL; val->type = type; val->is_cst = 0; val->is_tmp = 0; val->index = 0; val->data = NULL; return val; } void ljit_free_value(ljit_value value) { if (!value) return; free(value->data); free(value); } ljit_value ljit_new_uchar_cst(ljit_uchar value) { ljit_value cst = ljit_new_value(LJIT_UCHAR); ljit_uchar *val = NULL; if (!cst) return NULL; if ((val = malloc(sizeof(ljit_uchar))) == NULL) { ljit_free_value(cst); return NULL; } *val = value; cst->data = val; cst->is_cst = 1; return cst; }
Fix allocation issues on ljit_new_value()
[CORE] Fix allocation issues on ljit_new_value()
C
mit
Nakrez/LiteJit,Nakrez/LiteJit
a9c85baedcdb73a4f72ec1dd7dc05a8a93ea56d9
src/binding.h
src/binding.h
/* Copyright (c) 2017 Rolf Timmermans */ #pragma once #include <napi.h> #include <zmq.h> #include <node.h> #include <cassert> #include <iostream> #include "inline/arguments.h" #include "inline/error.h" #include "inline/util.h" #ifdef __MSVC__ #define force_inline inline __forceinline #else #define force_inline inline __attribute__((always_inline)) #endif
/* Copyright (c) 2017 Rolf Timmermans */ #pragma once #include <napi.h> #include <zmq.h> #if ZMQ_VERSION < ZMQ_MAKE_VERSION(4,1,0) # include <zmq_utils.h> #endif #include <node.h> #include <cassert> #include "inline/arguments.h" #include "inline/error.h" #include "inline/util.h" #ifdef __MSVC__ #define force_inline inline __forceinline #else #define force_inline inline __attribute__((always_inline)) #endif
Include zmq utils if necessary.
Include zmq utils if necessary.
C
mit
rolftimmermans/zeromq-ng,rolftimmermans/zeromq-ng
64bd95f2799cdcaa44d58e2e1d3650477c2bd793
include/tasm/asm.h
include/tasm/asm.h
#pragma once #include <stddef.h> // size_t definition #include <tasm/bytes.h> #include <tasm/private/execute.h> #include <tasm/private/byte_string.h> #include <tasm/private/foldable.h> #include <tasm/private/label.h> #include <tasm/private/state.h> namespace tasm { /** Convert an Asm program into machine code. */ template <typename program> using assemble = typename details::call< program, state::pass2state<typename details::call<program, state::pass1state>::first>>::second; /** Assembly function wrapper. */ template <typename R, typename P> struct AsmProgram { using program = P; template <typename... Args> R operator()(Args... args) { return ((R(*)(std::decay_t<Args>...))P::data)(args...); } }; /** Block of assembly code. */ template <typename x, typename... xs> constexpr auto block(x, xs...) { return execute::seq<x, xs...>{}; } /** Create a top level assembly function. */ template <typename R, typename x, typename... xs> constexpr auto Asm(x, xs...) { return AsmProgram<R, assemble<execute::seq<x, xs...>>>(); } } // tasm
#pragma once #include <stddef.h> // size_t definition #include <tasm/bytes.h> #include <tasm/private/execute.h> #include <tasm/private/byte_string.h> #include <tasm/private/foldable.h> #include <tasm/private/label.h> #include <tasm/private/state.h> namespace tasm { /** Convert an Asm program into machine code. */ template <typename program> using assemble = typename details::call< program, state::pass2state<typename details::call<program, state::pass1state>::first>>::second; /** Assembly function wrapper. */ template <typename R, typename P> struct AsmProgram { using program = P; template <typename... Args> R operator()(Args... args) { return reinterpret_cast<R(*)(std::decay_t<Args>...)>(const_cast<char*>(P::data))(args...); } }; /** Block of assembly code. */ template <typename x, typename... xs> constexpr auto block(x, xs...) { return execute::seq<x, xs...>{}; } /** Create a top level assembly function. */ template <typename R, typename x, typename... xs> constexpr auto Asm(x, xs...) { return AsmProgram<R, assemble<execute::seq<x, xs...>>>(); } } // tasm
Fix remaining cast alignment warnings through the magic of casting
Fix remaining cast alignment warnings through the magic of casting
C
mit
mattbierner/Template-Assembly,mattbierner/Template-Assembly,izissise/Template-Assembly,izissise/Template-Assembly
ab2597957bad0f23068435799bcdfe246e1c8a61
SSPSolution/GraphicsDLL/GraphicsComponent.h
SSPSolution/GraphicsDLL/GraphicsComponent.h
#ifndef GRAPHICSDLL_GRAPHICSCOMPONENT_H #define GRAPHICSDLL_GRAPHICSCOMPONENT_H #include <DirectXMath.h> struct GraphicsComponent { int active = 0; int modelID = -1; DirectX::XMMATRIX worldMatrix; }; struct penis { int active = 0; int modelID = -1; int joints = 0; DirectX::XMMATRIX worldMatrix; DirectX::XMMATRIX finalTransforms[32]; }; struct UIComponent { int active = 0; int spriteID = -1; bool wasClicked = false; DirectX::XMFLOAT2 position = DirectX::XMFLOAT2(0.0f, 0.0f); DirectX::XMFLOAT2 size = DirectX::XMFLOAT2(10.0f, 10.0f); }; #endif
#ifndef GRAPHICSDLL_GRAPHICSCOMPONENT_H #define GRAPHICSDLL_GRAPHICSCOMPONENT_H #include <d3d11.h> #include <DirectXMath.h> struct GraphicsComponent { int active = 0; int modelID = -1; DirectX::XMMATRIX worldMatrix; }; struct penis { int active = 0; int modelID = -1; int joints = 0; DirectX::XMMATRIX worldMatrix; DirectX::XMMATRIX finalTransforms[32]; }; struct UIComponent { int active = 0; int spriteID = -1; bool wasClicked = false; DirectX::XMFLOAT2 position = DirectX::XMFLOAT2(0.0f, 0.0f); DirectX::XMFLOAT2 size = DirectX::XMFLOAT2(10.0f, 10.0f); void UpdateClicked(DirectX::XMFLOAT2 mousePos, DirectX::XMFLOAT2 windowSize) { float mouseX = mousePos.x - (GetSystemMetrics(SM_CXSCREEN) - windowSize.x) / 2; float mouseY = mousePos.y - (GetSystemMetrics(SM_CYSCREEN) - windowSize.y) / 2; if ((mouseX > this->position.x - this->size.x && mouseX < this->position.x + this->size.x) && (mouseY > this->position.y - this->size.y && mouseY < this->position.y + this->size.y)) { this->wasClicked = true; } } bool CheckClicked() { if (this->wasClicked) { this->wasClicked = false; return true; } else { return false; } } }; #endif
ADD clicked functionallity in UIComponent
ADD clicked functionallity in UIComponent
C
apache-2.0
Chringo/SSP,Chringo/SSP
1bdefe79332fc5c1b325b2ebe6e1a8dccebe026d
hecuba_core/src/debug.h
hecuba_core/src/debug.h
#ifndef __DEBUG_H__ #define __DEBUG_H__ #undef ENABLE_DEBUG #ifdef ENABLE_DEBUG #include <sstream> #define DBG(x...) \ do {\ std::cout<< "DBG " << x << std::endl;\ } while(0) #define DBGHEXTOSTRING(_b, _size) \ do { \ char *b = (char*)(_b);\ uint64_t size = (uint64_t) (_size);\ DBG(" size: "<< size); \ std::stringstream stream; \ for (uint64_t i = 0; i<size; i++) { \ stream << std::hex << int(b[i]); \ } \ DBG( stream.str() ); \ } while(0) #else #define DBG(x...) #define DBGHEXTOSTRING(b,size) #endif #endif /* __DEBUG_H__ */
#ifndef __DEBUG_H__ #define __DEBUG_H__ #undef ENABLE_DEBUG #ifdef ENABLE_DEBUG #include <sstream> #if __STDC_VERSION__ < 199901L # if __GNUC__ >= 2 # define __func__ __FUNCTION__ # else # define __func__ "<unknown>" # endif #endif #define DBG(x...) \ do {\ std::cout<< "DBG " << __func__ << ": " << x << std::endl;\ } while(0) #define DBGHEXTOSTRING(_b, _size) \ do { \ char *b = (char*)(_b);\ uint64_t size = (uint64_t) (_size);\ DBG(" size: "<< size); \ std::stringstream stream; \ for (uint64_t i = 0; i<size; i++) { \ stream << std::hex << int(b[i]); \ } \ DBG( stream.str() ); \ } while(0) #else #define DBG(x...) #define DBGHEXTOSTRING(b,size) #endif #endif /* __DEBUG_H__ */
Print function name at DBG
Print function name at DBG
C
apache-2.0
bsc-dd/hecuba,bsc-dd/hecuba,bsc-dd/hecuba,bsc-dd/hecuba
bcd31eb1e53d9008d0cb84032bfa7da7ba565f02
RosApp/app/src/main/jni/include/tango_helper.h
RosApp/app/src/main/jni/include/tango_helper.h
// Copyright 2016 Intermodalics All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include <jni.h> namespace tango_helper { // The minimum Tango Core version required from this application. const int TANGO_CORE_MINIMUM_VERSION = 11926; // Yildun release. // Checks the installed version of the TangoCore. If it is too old, then // it will not support the most up to date features. // @return returns true if tango version if supported. bool IsTangoVersionOk(JNIEnv* env, jobject activity); // Binds to the tango service. // @return returns true if setting the binder ended successfully. bool SetBinder(JNIEnv* env, jobject binder); } // tango_helper
// Copyright 2016 Intermodalics All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include <jni.h> // Helper functions that need to be separated from the tango_ros_native package to get rif of the // jni dependency, so that the tango_ros_native package can be used for Android and Linux. namespace tango_helper { // The minimum Tango Core version required from this application. const int TANGO_CORE_MINIMUM_VERSION = 11926; // Yildun release. // Checks the installed version of the TangoCore. If it is too old, then // it will not support the most up to date features. // @return returns true if tango version if supported. bool IsTangoVersionOk(JNIEnv* env, jobject activity); // Binds to the tango service. // @return returns true if setting the binder ended successfully. bool SetBinder(JNIEnv* env, jobject binder); } // tango_helper
Add comment to explain need of separate helper functions
Add comment to explain need of separate helper functions
C
apache-2.0
Intermodalics/tango_ros,Intermodalics/tango_ros,Intermodalics/tango_ros,Intermodalics/tango_ros
359e5083fc07f2634112af82f48189cb49b30a01
src/util/serde.h
src/util/serde.h
#pragma once #include <cstddef> namespace util { // The interface is tuned for reuse and avoids boilerplate length calculations. // Looking at implementation examples helps understand the decisions behind it. // Serialization functions should not throw. // Upon success, serialize functions shall return end of serialized data. // Otherwise, nullptr shall be returned, indicating insufficinet destination capacity. using serializeFunc = void* (*)(void* dest, const void* destEnd, const void* obj); // Upon success, deserialize function shall return end of consumed src. Otherwise, nullptr shall be returned. using deserializeFunc = const void* (*)(void* sharedDest, const void* src, const void* srcEnd); } // namespace util
#pragma once namespace util { namespace serde { // The interface is tuned for reuse and avoids boilerplate length calculations. // Looking at implementation examples helps understand the decisions behind it. // Serialization functions should not throw. // Upon success, serialize functions shall return end of serialized data. // Otherwise, nullptr shall be returned, indicating insufficinet destination capacity. using serializeFun = void* (*)(void* dest, const void* destEnd, const void* obj); // Upon success, deserialize function shall return end of consumed src. Otherwise, nullptr shall be returned. using deserializeFun = const void* (*)(void* sharedDest, const void* src, const void* srcEnd); } // namespace serde } // namespace util
Move serialization interface into sub namespace
Move serialization interface into sub namespace
C
mit
isrvoid/utilcpp,isrvoid/utilcpp
7c966839040bd186a6239d6f6d7c21dc34b34436
include/Genes/Gene.h
include/Genes/Gene.h
#ifndef GENE_H #define GENE_H #include <map> #include <string> #include <iosfwd> class Board; class Piece_Strength_Gene; class Gene { public: Gene(); virtual ~Gene() = default; void read_from(std::istream& is); void mutate(); double evaluate(const Board& board) const; virtual Gene* duplicate() const = 0; virtual std::string name() const = 0; void print(std::ostream& os) const; virtual void reset_piece_strength_gene(const Piece_Strength_Gene* psg); protected: mutable std::map<std::string, double> properties; // used to simplify reading/writing from/to files virtual void reset_properties() const; virtual void load_properties(); void make_priority_non_negative(); private: virtual double score_board(const Board& board) const = 0; void throw_on_invalid_line(const std::string& line, const std::string& reason) const; virtual void gene_specific_mutation(); double priority; bool priority_non_negative; }; #endif // GENE_H
#ifndef GENE_H #define GENE_H #include <map> #include <string> #include <iosfwd> class Board; class Piece_Strength_Gene; class Gene { public: Gene(); virtual ~Gene() = default; void read_from(std::istream& is); void mutate(); double evaluate(const Board& board) const; virtual Gene* duplicate() const = 0; virtual std::string name() const = 0; void print(std::ostream& os) const; virtual void reset_piece_strength_gene(const Piece_Strength_Gene* psg); protected: mutable std::map<std::string, double> properties; // used to simplify reading/writing from/to files virtual void reset_properties() const; virtual void load_properties(); void make_priority_non_negative(); private: virtual double score_board(const Board& board) const = 0; [[noreturn]] void throw_on_invalid_line(const std::string& line, const std::string& reason) const; virtual void gene_specific_mutation(); double priority; bool priority_non_negative; }; #endif // GENE_H
Add [[noreturn]] to pure throwing method
Add [[noreturn]] to pure throwing method
C
mit
MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess
1e5191053d844c86f21cd2b82e4bc09ae0340634
include/xglIntelExt.h
include/xglIntelExt.h
/* IN DEVELOPMENT. DO NOT SHIP. */ #ifndef __XGLINTELEXT_H__ #define __XGLINTELEXT_H__ #include <xcb/xcb.h> #include <xcb/randr.h> #include "xgl.h" #ifdef __cplusplus extern "C" { #endif // __cplusplus typedef enum _XGL_INTEL_STRUCTURE_TYPE { XGL_INTEL_STRUCTURE_TYPE_SHADER_CREATE_INFO = 1000, } XGL_INTEL_STRUCTURE_TYPE; #ifdef __cplusplus } // extern "C" #endif // __cplusplus #endif // __XGLINTELEXT_H__
/* IN DEVELOPMENT. DO NOT SHIP. */ #ifndef __XGLINTELEXT_H__ #define __XGLINTELEXT_H__ #include <xcb/xcb.h> #include <xcb/randr.h> #include "xgl.h" #ifdef __cplusplus extern "C" { #endif // __cplusplus typedef enum _XGL_INTEL_STRUCTURE_TYPE { XGL_INTEL_STRUCTURE_TYPE_SHADER_CREATE_INFO = 1000, } XGL_INTEL_STRUCTURE_TYPE; typedef struct _XGL_INTEL_COMPILE_GLSL { XGL_PIPELINE_SHADER_STAGE stage; const char *pCode; } XGL_INTEL_COMPILE_GLSL; #ifdef __cplusplus } // extern "C" #endif // __cplusplus #endif // __XGLINTELEXT_H__
Add shader structure for GLSL compile extension
intel: Add shader structure for GLSL compile extension
C
apache-2.0
KhronosGroup/Vulkan-Tools,KhronosGroup/Vulkan-Tools,KhronosGroup/Vulkan-Tools,KhronosGroup/Vulkan-Tools
99e8bd7b02314af8fc801e1e1bb3eab4a3cb8ccd
Classes/LJSStop.h
Classes/LJSStop.h
// // LJSStop.h // LJSYourNextBus // // Created by Luke Stringer on 29/01/2014. // Copyright (c) 2014 Luke Stringer. All rights reserved. // #import <Foundation/Foundation.h> @interface LJSStop : NSObject <NSCopying> @property (nonatomic, copy, readonly) NSString *NaPTANCode; @property (nonatomic, copy, readonly) NSString *title; @property (nonatomic, copy, readonly) NSDate *liveDate; @property (nonatomic, copy, readonly) NSArray *services; - (BOOL)isEqualToStop:(LJSStop *)stop; @end
// // LJSStop.h // LJSYourNextBus // // Created by Luke Stringer on 29/01/2014. // Copyright (c) 2014 Luke Stringer. All rights reserved. // #import <Foundation/Foundation.h> @interface LJSStop : NSObject <NSCopying> /** * An 8 digit stop number starting with e.g. 450 for West Yorkshire or 370 for South Yorkshire */ @property (nonatomic, copy, readonly) NSString *NaPTANCode; @property (nonatomic, copy, readonly) NSString *title; @property (nonatomic, copy, readonly) NSDate *liveDate; @property (nonatomic, copy, readonly) NSArray *services; - (BOOL)isEqualToStop:(LJSStop *)stop; @end
Comment explaining what a valid NaPTAN code is.
Comment explaining what a valid NaPTAN code is.
C
mit
lukestringer90/LJSYourNextBus,lukestringer90/LJSYourNextBus
3305c8719532631857182b481fccdafa76142044
include/xglIntelExt.h
include/xglIntelExt.h
/* IN DEVELOPMENT. DO NOT SHIP. */ #ifndef __XGLINTELEXT_H__ #define __XGLINTELEXT_H__ #include <xcb/xcb.h> #include <xcb/randr.h> #include "xgl.h" #ifdef __cplusplus extern "C" { #endif // __cplusplus typedef enum _XGL_INTEL_STRUCTURE_TYPE { XGL_INTEL_STRUCTURE_TYPE_SHADER_CREATE_INFO = 1000, } XGL_INTEL_STRUCTURE_TYPE; #ifdef __cplusplus } // extern "C" #endif // __cplusplus #endif // __XGLINTELEXT_H__
/* IN DEVELOPMENT. DO NOT SHIP. */ #ifndef __XGLINTELEXT_H__ #define __XGLINTELEXT_H__ #include <xcb/xcb.h> #include <xcb/randr.h> #include "xgl.h" #ifdef __cplusplus extern "C" { #endif // __cplusplus typedef enum _XGL_INTEL_STRUCTURE_TYPE { XGL_INTEL_STRUCTURE_TYPE_SHADER_CREATE_INFO = 1000, } XGL_INTEL_STRUCTURE_TYPE; typedef struct _XGL_INTEL_COMPILE_GLSL { XGL_PIPELINE_SHADER_STAGE stage; const char *pCode; } XGL_INTEL_COMPILE_GLSL; #ifdef __cplusplus } // extern "C" #endif // __cplusplus #endif // __XGLINTELEXT_H__
Add shader structure for GLSL compile extension
intel: Add shader structure for GLSL compile extension
C
apache-2.0
KhronosGroup/Vulkan-LoaderAndValidationLayers,Radamanthe/VulkanSamples,Radamanthe/VulkanSamples,sashinde/VulkanTools,Radamanthe/VulkanSamples,KhronosGroup/Vulkan-LoaderAndValidationLayers,sashinde/VulkanTools,elongbug/Vulkan-LoaderAndValidationLayers,Radamanthe/VulkanSamples,critsec/Vulkan-LoaderAndValidationLayers,critsec/Vulkan-LoaderAndValidationLayers,critsec/Vulkan-LoaderAndValidationLayers,elongbug/Vulkan-LoaderAndValidationLayers,elongbug/Vulkan-LoaderAndValidationLayers,Radamanthe/VulkanSamples,sashinde/VulkanTools,Radamanthe/VulkanSamples,critsec/Vulkan-LoaderAndValidationLayers,KhronosGroup/Vulkan-LoaderAndValidationLayers,elongbug/Vulkan-LoaderAndValidationLayers,KhronosGroup/Vulkan-LoaderAndValidationLayers,sashinde/VulkanTools
20182dd263312db9fad52042fc92c33331ec6904
base/metrics/histogram_functions.h
base/metrics/histogram_functions.h
// Copyright 2016 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 MINI_CHROMIUM_BASE_METRICS_HISTOGRAM_FUNCTIONS_H_ #define MINI_CHROMIUM_BASE_METRICS_HISTOGRAM_FUNCTIONS_H_ #include <string> // These are no-op stub versions of a subset of the functions from Chromium's // base/metrics/histogram_functions.h. This allows us to instrument the Crashpad // code as necessary, while not affecting out-of-Chromium builds. namespace base { void UmaHistogramSparse(const std::string& name, int sample) {} } // namespace base #endif // MINI_CHROMIUM_BASE_METRICS_HISTOGRAM_FUNCTIONS_H_
// Copyright 2016 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 MINI_CHROMIUM_BASE_METRICS_HISTOGRAM_FUNCTIONS_H_ #define MINI_CHROMIUM_BASE_METRICS_HISTOGRAM_FUNCTIONS_H_ #include <string> // These are no-op stub versions of a subset of the functions from Chromium's // base/metrics/histogram_functions.h. This allows us to instrument the Crashpad // code as necessary, while not affecting out-of-Chromium builds. namespace base { void UmaHistogramSparse(const std::string& name, int sample) {} } // namespace base #endif // MINI_CHROMIUM_BASE_METRICS_HISTOGRAM_FUNCTIONS_H_
Add missing newline at EOF after d1943e187f47
Add missing newline at EOF after d1943e187f47 Change-Id: I7d7735791aa565edca162d8c683bd272bbcfaa52 Reviewed-on: https://chromium-review.googlesource.com/827592 Reviewed-by: Mark Mentovai <f1b5a91d4d6ad523f2610114591c007e75d15084@chromium.org>
C
bsd-3-clause
chromium/mini_chromium,chromium/mini_chromium,chromium/mini_chromium
64d0d495f19cf3b2e071001b0197758dbf53d7fc
util.h
util.h
#ifndef MICROPYTHON_WRAP_UTIL_H #define MICROPYTHON_WRAP_UTIL_H #include "detail/micropython.h" namespace upywrap { inline std::string ExceptionToString( mp_obj_t ex ) { std::string exMessage; const mp_print_t mp_my_print{ &exMessage, [] ( void* data, const char* str, mp_uint_t len ) { ( (std::string*) data )->append( str, len ); } }; mp_obj_print_exception( &mp_my_print, ex ); return exMessage; } } #endif //#ifndef MICROPYTHON_WRAP_UTIL_H
#ifndef MICROPYTHON_WRAP_UTIL_H #define MICROPYTHON_WRAP_UTIL_H #include "detail/micropython.h" namespace upywrap { inline mp_print_t PrintToString( std::string& dest ) { return mp_print_t{ &dest, [] ( void* data, const char* str, mp_uint_t len ) { ( (std::string*) data )->append( str, len ); } }; } inline std::string ExceptionToString( mp_obj_t ex ) { std::string exMessage; const auto mp_my_print( PrintToString( exMessage ) ); mp_obj_print_exception( &mp_my_print, ex ); return exMessage; } inline std::string VariableValueToString( mp_obj_t obj, mp_print_kind_t kind = PRINT_REPR ) { std::string var; const auto mp_my_print( PrintToString( var ) ); mp_obj_print_helper( &mp_my_print, obj, kind ); return var; } } #endif //#ifndef MICROPYTHON_WRAP_UTIL_H
Add function for getting a variable's string representation
Add function for getting a variable's string representation
C
mit
stinos/micropython-wrap,stinos/micropython-wrap,stinos/micropython-wrap
ac19a88b463c7899f3aeffd283d0a42923449e0e
src/explicit_scoped_lock.h
src/explicit_scoped_lock.h
// Copyright 2014 Tanel Lebedev #ifndef SRC_EXPLICIT_SCOPED_LOCK_H_ #define SRC_EXPLICIT_SCOPED_LOCK_H_ #include <string> #include <sstream> #include "Poco/Logger.h" namespace kopsik { class ExplicitScopedLock : public Poco::Mutex::ScopedLock { public: ExplicitScopedLock( const std::string context, Poco::Mutex& mutex) : Poco::Mutex::ScopedLock(mutex), context_(context) { std::stringstream text; text << context_ << " locking"; logger().debug(text.str()); } ~ExplicitScopedLock() { std::stringstream text; text << context_ << " unlocking"; logger().debug(text.str()); } private: Poco::Logger &logger() { return Poco::Logger::get("lock"); } std::string context_; }; } // namespace kopsik #endif // SRC_EXPLICIT_SCOPED_LOCK_H_
// Copyright 2014 Tanel Lebedev #ifndef SRC_EXPLICIT_SCOPED_LOCK_H_ #define SRC_EXPLICIT_SCOPED_LOCK_H_ #include <string> #include <sstream> #include "Poco/Logger.h" namespace kopsik { class ExplicitScopedLock : public Poco::Mutex::ScopedLock { public: ExplicitScopedLock( const std::string context, Poco::Mutex& mutex) : Poco::Mutex::ScopedLock(mutex), context_(context) { std::stringstream text; text << context_ << " locking"; logger().trace(text.str()); } ~ExplicitScopedLock() { std::stringstream text; text << context_ << " unlocking"; logger().trace(text.str()); } private: Poco::Logger &logger() { return Poco::Logger::get("lock"); } std::string context_; }; } // namespace kopsik #endif // SRC_EXPLICIT_SCOPED_LOCK_H_
Print out locking/unlocking with trace only
Print out locking/unlocking with trace only
C
bsd-3-clause
codeman38/toggldesktop,codeman38/toggldesktop,codeman38/toggldesktop,codeman38/toggldesktop,codeman38/toggldesktop,codeman38/toggldesktop
0c4922becbbc8b0eb63c4a5bbb3ae4b749eccd24
components/libc/compilers/minilibc/sys/types.h
components/libc/compilers/minilibc/sys/types.h
#ifndef __TYPES_H__ #define __TYPES_H__ typedef long off_t; typedef unsigned long size_t; typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */ typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; typedef int mode_t; typedef unsigned long clockid_t; typedef int pid_t; #ifndef NULL #define NULL (0) #endif #define __u_char_defined #endif
#ifndef __TYPES_H__ #define __TYPES_H__ typedef long off_t; typedef unsigned long size_t; typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */ typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; typedef int mode_t; typedef unsigned long clockid_t; typedef int pid_t; typedef unsigned long clock_t; /* clock() */ #ifndef NULL #define NULL (0) #endif #define __u_char_defined #endif
Add type 'clock_t' to minilibc.
[Libc][Minilibc] Add type 'clock_t' to minilibc.
C
apache-2.0
hezlog/rt-thread,yongli3/rt-thread,zhaojuntao/rt-thread,wolfgangz2013/rt-thread,FlyLu/rt-thread,ArdaFu/rt-thread,nongxiaoming/rt-thread,weety/rt-thread,igou/rt-thread,weiyuliang/rt-thread,gbcwbz/rt-thread,hezlog/rt-thread,hezlog/rt-thread,RT-Thread/rt-thread,weiyuliang/rt-thread,igou/rt-thread,armink/rt-thread,nongxiaoming/rt-thread,AubrCool/rt-thread,weiyuliang/rt-thread,geniusgogo/rt-thread,gbcwbz/rt-thread,AubrCool/rt-thread,FlyLu/rt-thread,armink/rt-thread,nongxiaoming/rt-thread,FlyLu/rt-thread,zhaojuntao/rt-thread,weiyuliang/rt-thread,RT-Thread/rt-thread,armink/rt-thread,geniusgogo/rt-thread,armink/rt-thread,weety/rt-thread,FlyLu/rt-thread,wolfgangz2013/rt-thread,igou/rt-thread,zhaojuntao/rt-thread,yongli3/rt-thread,FlyLu/rt-thread,RT-Thread/rt-thread,RT-Thread/rt-thread,yongli3/rt-thread,geniusgogo/rt-thread,geniusgogo/rt-thread,wolfgangz2013/rt-thread,AubrCool/rt-thread,yongli3/rt-thread,gbcwbz/rt-thread,weiyuliang/rt-thread,nongxiaoming/rt-thread,yongli3/rt-thread,weety/rt-thread,yongli3/rt-thread,RT-Thread/rt-thread,igou/rt-thread,ArdaFu/rt-thread,igou/rt-thread,AubrCool/rt-thread,AubrCool/rt-thread,weety/rt-thread,geniusgogo/rt-thread,hezlog/rt-thread,hezlog/rt-thread,nongxiaoming/rt-thread,armink/rt-thread,zhaojuntao/rt-thread,zhaojuntao/rt-thread,wolfgangz2013/rt-thread,geniusgogo/rt-thread,ArdaFu/rt-thread,ArdaFu/rt-thread,geniusgogo/rt-thread,weiyuliang/rt-thread,nongxiaoming/rt-thread,gbcwbz/rt-thread,wolfgangz2013/rt-thread,wolfgangz2013/rt-thread,hezlog/rt-thread,RT-Thread/rt-thread,zhaojuntao/rt-thread,weety/rt-thread,nongxiaoming/rt-thread,gbcwbz/rt-thread,armink/rt-thread,ArdaFu/rt-thread,gbcwbz/rt-thread,zhaojuntao/rt-thread,FlyLu/rt-thread,AubrCool/rt-thread,igou/rt-thread,yongli3/rt-thread,ArdaFu/rt-thread,hezlog/rt-thread,igou/rt-thread,weety/rt-thread,AubrCool/rt-thread,ArdaFu/rt-thread,weety/rt-thread,FlyLu/rt-thread,gbcwbz/rt-thread,RT-Thread/rt-thread,weiyuliang/rt-thread,wolfgangz2013/rt-thread,armink/rt-thread
565744c9e3a2e91119c7ebb3d6663e0569ed94e7
libevmjit-cpp/JitVM.h
libevmjit-cpp/JitVM.h
#pragma once #include <libevm/VMFace.h> #include <evmjit/libevmjit/ExecutionEngine.h> namespace dev { namespace eth { class JitVM: public VMFace { public: virtual bytesConstRef execImpl(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) override final; private: jit::RuntimeData m_data; jit::ExecutionEngine m_engine; std::unique_ptr<VMFace> m_fallbackVM; ///< VM used in case of input data rejected by JIT }; } }
#pragma once #include <libevm/VMFace.h> #include <evmjit/libevmjit/ExecutionEngine.h> namespace dev { namespace eth { class JitVM: public VMFace { public: virtual bytesConstRef execImpl(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) override final; private: jit::RuntimeData m_data; jit::ExecutionEngine m_engine; std::unique_ptr<VMFace> m_fallbackVM; ///< VM used in case of input data rejected by JIT }; } }
Change the way execution results are collected.
Change the way execution results are collected. Changes handling ExecutionResult by Executive. From now execution results are collected on if a storage for results (ExecutionResult) is provided to an Executiove instance up front. This change allow better output management for calls - VM interface improved.
C
mit
d-das/cpp-ethereum,d-das/cpp-ethereum,expanse-org/cpp-expanse,karek314/cpp-ethereum,expanse-org/cpp-expanse,expanse-org/cpp-expanse,vaporry/webthree-umbrella,PaulGrey30/go-get--u-github.com-tools-godep,johnpeter66/ethminer,xeddmc/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,ethers/cpp-ethereum,ethers/cpp-ethereum,expanse-project/cpp-expanse,anthony-cros/cpp-ethereum,LefterisJP/cpp-ethereum,anthony-cros/cpp-ethereum,expanse-project/cpp-expanse,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,joeldo/cpp-ethereum,karek314/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,expanse-project/cpp-expanse,Sorceror32/go-get--u-github.com-tools-godep,PaulGrey30/go-get--u-github.com-tools-godep,LefterisJP/webthree-umbrella,PaulGrey30/go-get--u-github.com-tools-godep,expanse-project/cpp-expanse,smartbitcoin/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,smartbitcoin/cpp-ethereum,yann300/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,eco/cpp-ethereum,d-das/cpp-ethereum,vaporry/cpp-ethereum,anthony-cros/cpp-ethereum,eco/cpp-ethereum,smartbitcoin/cpp-ethereum,eco/cpp-ethereum,gluk256/cpp-ethereum,LefterisJP/webthree-umbrella,johnpeter66/ethminer,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,karek314/cpp-ethereum,eco/cpp-ethereum,gluk256/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,vaporry/cpp-ethereum,joeldo/cpp-ethereum,expanse-org/cpp-expanse,smartbitcoin/cpp-ethereum,xeddmc/cpp-ethereum,yann300/cpp-ethereum,programonauta/webthree-umbrella,LefterisJP/cpp-ethereum,LefterisJP/cpp-ethereum,karek314/cpp-ethereum,LefterisJP/cpp-ethereum,expanse-project/cpp-expanse,xeddmc/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,LefterisJP/cpp-ethereum,d-das/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,yann300/cpp-ethereum,eco/cpp-ethereum,xeddmc/cpp-ethereum,eco/cpp-ethereum,johnpeter66/ethminer,expanse-project/cpp-expanse,joeldo/cpp-ethereum,joeldo/cpp-ethereum,gluk256/cpp-ethereum,anthony-cros/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,LefterisJP/cpp-ethereum,xeddmc/cpp-ethereum,joeldo/cpp-ethereum,d-das/cpp-ethereum,gluk256/cpp-ethereum,yann300/cpp-ethereum,karek314/cpp-ethereum,expanse-org/cpp-expanse,gluk256/cpp-ethereum,ethers/cpp-ethereum,gluk256/cpp-ethereum,joeldo/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,programonauta/webthree-umbrella,vaporry/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,xeddmc/cpp-ethereum,yann300/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,arkpar/webthree-umbrella,ethers/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,smartbitcoin/cpp-ethereum,vaporry/cpp-ethereum,anthony-cros/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,chfast/webthree-umbrella,d-das/cpp-ethereum,yann300/cpp-ethereum,smartbitcoin/cpp-ethereum,anthony-cros/cpp-ethereum,ethers/cpp-ethereum,expanse-org/cpp-expanse,vaporry/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,ethers/cpp-ethereum,vaporry/cpp-ethereum,karek314/cpp-ethereum
d0a6e12ee14f1ae039a16d0f724846541a836cb5
src/md5.h
src/md5.h
/** * Copyright (c) 2015, Chao Wang <hit9@icloud.com> * * md5 hash function. */ /* * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc. * MD5 Message-Digest Algorithm (RFC 1321). * * Homepage: http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5 * * Author: Alexander Peslyak, better known as Solar Designer <solar at openwall.com> */ #ifndef _CW_MD5_H #define _CW_MD5_H 1 #if defined(__cplusplus) extern "C" { #endif void md5_signature(unsigned char *key, unsigned long length, unsigned char *result); uint32_t hash_md5(const char *key, size_t key_length); #if defined(__cplusplus) } #endif #endif
/** * Copyright (c) 2015, Chao Wang <hit9@icloud.com> * * md5 hash function. */ /* * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc. * MD5 Message-Digest Algorithm (RFC 1321). * * Homepage: http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5 * * Author: Alexander Peslyak, better known as Solar Designer <solar at openwall.com> */ #ifndef _CW_MD5_H #define _CW_MD5_H 1 #include <stdint.h> #if defined(__cplusplus) extern "C" { #endif void md5_signature(unsigned char *key, unsigned long length, unsigned char *result); uint32_t hash_md5(const char *key, size_t key_length); #if defined(__cplusplus) } #endif #endif
Add missing header file `stdint.h`
Add missing header file `stdint.h`
C
bsd-2-clause
hit9/C-Snip,hit9/C-Snip
870a9743819096103ca7906053650009c42e2dd1
ios/RNTrackPlayer/Support/RNTrackPlayer-Bridging-Header.h
ios/RNTrackPlayer/Support/RNTrackPlayer-Bridging-Header.h
// // Use this file to import your target's public headers that you would like to expose to Swift. // #import "STKAudioPlayer.h"
// // Use this file to import your target's public headers that you would like to expose to Swift. //
Remove old audio player header
[ios] Remove old audio player header
C
apache-2.0
react-native-kit/react-native-track-player,react-native-kit/react-native-track-player,react-native-kit/react-native-track-player,react-native-kit/react-native-track-player,react-native-kit/react-native-track-player
649203faa3438601081fa5ade1fc00d0d92bda88
test/asan/TestCases/Darwin/segv_read_write.c
test/asan/TestCases/Darwin/segv_read_write.c
// RUN: %clangxx_asan -std=c++11 -O0 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=READ // RUN: not %run %t write 2>&1 | FileCheck %s --check-prefix=WRITE // REQUIRES: x86-target-arch #include <sys/mman.h> static volatile int sink; __attribute__((noinline)) void Read(int *ptr) { sink = *ptr; } __attribute__((noinline)) void Write(int *ptr) { *ptr = 0; } int main(int argc, char **argv) { // Writes to shadow are detected as reads from shadow gap (because of how the // shadow mapping works). This is kinda hard to fix. Test a random address in // the application part of the address space. void *volatile p = mmap(nullptr, 4096, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); munmap(p, 4096); if (argc == 1) Read((int *)p); else Write((int *)p); } // READ: AddressSanitizer: SEGV on unknown address // READ: The signal is caused by a READ memory access. // WRITE: AddressSanitizer: SEGV on unknown address // WRITE: The signal is caused by a WRITE memory access.
// RUN: %clangxx_asan -std=c++11 -O0 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=READ // RUN: not %run %t write 2>&1 | FileCheck %s --check-prefix=WRITE // REQUIRES: x86-target-arch #include <sys/mman.h> static volatile int sink; __attribute__((noinline)) void Read(int *ptr) { sink = *ptr; } __attribute__((noinline)) void Write(int *ptr) { *ptr = 0; } int main(int argc, char **argv) { // Writes to shadow are detected as reads from shadow gap (because of how the // shadow mapping works). This is kinda hard to fix. Test a random address in // the application part of the address space. void *volatile p = mmap(nullptr, 4096, PROT_READ, MAP_PRIVATE | MAP_ANON, 0, 0); munmap(p, 4096); if (argc == 1) Read((int *)p); else Write((int *)p); } // READ: AddressSanitizer: SEGV on unknown address // READ: The signal is caused by a READ memory access. // WRITE: AddressSanitizer: SEGV on unknown address // WRITE: The signal is caused by a WRITE memory access.
Update a test case to work with old Darwin SDK's
[test/asan] Update a test case to work with old Darwin SDK's On Darwin, MAP_ANONYMOUS is a synonym for MAP_ANON. However, some SDK's don't define MAP_ANONYMOUS. Use MAP_ANON to work around this. (As a point of interest, the situation is exactly reversed on Linux.) git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@267907 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt
695404f5a490c36741886aefbc9fb076bc0e058d
samples/Demo/Customer.h
samples/Demo/Customer.h
#pragma once #include <string> #include <iostream> struct Customer { int id; std::string name; }; inline std::ostream& operator<<(std::ostream& os, const Customer& obj) { os << "Customer (id: " << obj.id << ", name: " << obj.name << ")"; return os; }
#pragma once #include <string> #include <iostream> struct Customer { int id; std::string name; }; inline std::ostream& operator<<(std::ostream& os, const Customer& obj) { os << "Customer (id: " << obj.id << ", name: " << obj.name << ")"; return os; }
Add a new line to satisfy clang.
Add a new line to satisfy clang.
C
mit
SergiusTheBest/plog,SergiusTheBest/plog
b2e29064ae246c4d8bbcd80434477b97d5c47be0
lib/libxpg4/fakelib.c
lib/libxpg4/fakelib.c
/* $FreeBSD$ */ static int ___fake_library___;
/* $FreeBSD$ */ /* libxpg4 is obsolete in FreeBSD 6 -- library has been merged into libc. */ #define OBSOLETE_IN_6 #include <sys/param.h> static int ___fake_library___;
Mark libxpg4 as OBSOLETE_IN_6: it has been empty since its contents were merged into libc in 4.5-RELEASE.
Mark libxpg4 as OBSOLETE_IN_6: it has been empty since its contents were merged into libc in 4.5-RELEASE.
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
188806ede0679466bb5890f3ec1b52736d7ccc49
Wikipedia/Code/WKScriptMessage+WMFScriptMessage.h
Wikipedia/Code/WKScriptMessage+WMFScriptMessage.h
#import <WebKit/WebKit.h> typedef NS_ENUM (NSInteger, WMFWKScriptMessageType) { WMFWKScriptMessagePeek, WMFWKScriptMessageConsoleMessage, WMFWKScriptMessageClickLink, WMFWKScriptMessageClickImage, WMFWKScriptMessageClickReference, WMFWKScriptMessageClickEdit, WMFWKScriptMessageNonAnchorTouchEndedWithoutDragging, WMFWKScriptMessageLateJavascriptTransform, WMFWKScriptMessageArticleState, WMFWKScriptMessageUnknown }; @interface WKScriptMessage (WMFScriptMessage) + (WMFWKScriptMessageType)wmf_typeForMessageName:(NSString*)name; + (Class)wmf_expectedMessageBodyClassForType:(WMFWKScriptMessageType)type; @end
#import <WebKit/WebKit.h> typedef NS_ENUM (NSInteger, WMFWKScriptMessageType) { WMFWKScriptMessageUnknown, WMFWKScriptMessagePeek, WMFWKScriptMessageConsoleMessage, WMFWKScriptMessageClickLink, WMFWKScriptMessageClickImage, WMFWKScriptMessageClickReference, WMFWKScriptMessageClickEdit, WMFWKScriptMessageNonAnchorTouchEndedWithoutDragging, WMFWKScriptMessageLateJavascriptTransform, WMFWKScriptMessageArticleState }; @interface WKScriptMessage (WMFScriptMessage) + (WMFWKScriptMessageType)wmf_typeForMessageName:(NSString*)name; + (Class)wmf_expectedMessageBodyClassForType:(WMFWKScriptMessageType)type; @end
Move unknown enum entry to top.
Move unknown enum entry to top.
C
mit
anirudh24seven/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,anirudh24seven/wikipedia-ios,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,anirudh24seven/wikipedia-ios,wikimedia/wikipedia-ios,anirudh24seven/wikipedia-ios,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,anirudh24seven/wikipedia-ios,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,anirudh24seven/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,josve05a/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios
1c4506e41bdaea86881bca3ee3e3100e2f0e7bcb
src/utils/random.c
src/utils/random.c
#include <limits.h> #include "utils/random.h" // A simple psuedorandom number generator static struct random_t rand_state = { 1 }; void random_seed(struct random_t *r, uint32_t seed) { r->seed = seed; } uint32_t random_get_seed(struct random_t *r) { return r->seed; } uint32_t random_int(struct random_t *r, uint32_t upperbound) { return random_intmax(r) % upperbound; } uint32_t random_intmax(struct random_t *r) { r->seed = r->seed * 1664525 + 1013904223; return r->seed; } float random_float(struct random_t *r) { return (float)random_intmax(r) / UINT_MAX; } void rand_seed(uint32_t seed) { random_seed(&rand_state, seed); } uint32_t rand_get_seed(void) { return random_get_seed(&rand_state); } uint32_t rand_int(uint32_t upperbound) { return random_int(&rand_state, upperbound); } uint32_t rand_intmax(void) { return random_intmax(&rand_state); } float rand_float(void) { return random_float(&rand_state); }
#include <limits.h> #include "utils/random.h" // A simple psuedorandom number generator static struct random_t rand_state = { 1 }; void random_seed(struct random_t *r, uint32_t seed) { r->seed = seed; } uint32_t random_get_seed(struct random_t *r) { return r->seed; } uint32_t random_int(struct random_t *r, uint32_t upperbound) { return random_intmax(r) % upperbound; } uint32_t random_intmax(struct random_t *r) { r->seed = r->seed * 1664525 + 1013904223; return r->seed; } float random_float(struct random_t *r) { return (float)random_intmax(r) / (float)UINT_MAX; } void rand_seed(uint32_t seed) { random_seed(&rand_state, seed); } uint32_t rand_get_seed(void) { return random_get_seed(&rand_state); } uint32_t rand_int(uint32_t upperbound) { return random_int(&rand_state, upperbound); } uint32_t rand_intmax(void) { return random_intmax(&rand_state); } float rand_float(void) { return random_float(&rand_state); }
Fix build warning with clang 10.0.1
utils: Fix build warning with clang 10.0.1 --- /[...]/openomf/src/utils/random.c:26:38: warning: implicit conversion from 'unsigned int' to 'float' changes value from 4294967295 to 4294967296 [-Wimplicit-int-float-conversion] return (float)random_intmax(r) / UINT_MAX; ~ ^~~~~~~~ /usr/lib64/clang/10.0.1/include/limits.h:56:37: note: expanded from macro 'UINT_MAX' ~~~~~~~~~~~~~~~~~^~~ ---
C
mit
omf2097/openomf,omf2097/openomf,omf2097/openomf
b62006060ff1b9079f7d4a6771b6079a34399c83
include/parrot/trace.h
include/parrot/trace.h
/* trace.h * Copyright: (When this is determined...it will go here) * CVS Info * $Id$ * Overview: * Tracing support for runops_cores.c. * Data Structure and Algorithms: * History: * Notes: * References: */ #ifndef PARROT_TRACE_H_GUARD #define PARROT_TRACE_H_GUARD #include "parrot/parrot.h" void trace_op_dump(struct Parrot_Interp *interpreter, opcode_t *code_start, opcode_t *pc); void trace_op(struct Parrot_Interp *interpreter, opcode_t *code_start, opcode_t *code_end, opcode_t *pc); void trace_op_b0(struct Parrot_Interp *interpreter, opcode_t *code_start, opcode_t *pc); void trace_op_b1(struct Parrot_Interp *interpreter, opcode_t *code_start, opcode_t *code_end, code_t *pc); #endif /* * Local variables: * c-indentation-style: bsd * c-basic-offset: 4 * indent-tabs-mode: nil * End: * * vim: expandtab shiftwidth=4: */
/* trace.h * Copyright: (When this is determined...it will go here) * CVS Info * $Id$ * Overview: * Tracing support for runops_cores.c. * Data Structure and Algorithms: * History: * Notes: * References: */ #ifndef PARROT_TRACE_H_GUARD #define PARROT_TRACE_H_GUARD #include "parrot/parrot.h" void trace_op_dump(struct Parrot_Interp *interpreter, opcode_t *code_start, opcode_t *pc); void trace_op(struct Parrot_Interp *interpreter, opcode_t *code_start, opcode_t *code_end, opcode_t *pc); void trace_op_b0(struct Parrot_Interp *interpreter, opcode_t *code_start, opcode_t *pc); void trace_op_b1(struct Parrot_Interp *interpreter, opcode_t *code_start, opcode_t *code_end, opcode_t *pc); #endif /* * Local variables: * c-indentation-style: bsd * c-basic-offset: 4 * indent-tabs-mode: nil * End: * * vim: expandtab shiftwidth=4: */
Fix a typo in the argument type.
Fix a typo in the argument type. Patch from <daniel.ritz@gmx.ch> git-svn-id: 6e74a02f85675cec270f5d931b0f6998666294a3@1106 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
C
artistic-2.0
ashgti/parrot,ashgti/parrot,ashgti/parrot,ashgti/parrot,ashgti/parrot,ashgti/parrot,ashgti/parrot
827a95e884addadb038b85f18890225c9f61943a
formats/custom-type.c
formats/custom-type.c
#include "custom-type.h" #include "cmd.h" #include "common.h" #include <string.h> #include <hiredis/hiredis.h> #include <hiredis/async.h> void custom_type_reply(redisAsyncContext *c, void *r, void *privdata) { redisReply *reply = r; struct cmd *cmd = privdata; (void)c; if(reply == NULL) { evhttp_send_reply(cmd->rq, 404, "Not Found", NULL); return; } if(cmd->mime) { /* use the given content-type, but only for strings */ switch(reply->type) { case REDIS_REPLY_NIL: /* or nil values */ format_send_reply(cmd, "", 0, cmd->mime); return; case REDIS_REPLY_STRING: format_send_reply(cmd, reply->str, reply->len, cmd->mime); return; } } /* couldn't make sense of what the client wanted. */ evhttp_send_reply(cmd->rq, 400, "Bad request", NULL); cmd_free(cmd); }
#include "custom-type.h" #include "cmd.h" #include "common.h" #include <string.h> #include <hiredis/hiredis.h> #include <hiredis/async.h> void custom_type_reply(redisAsyncContext *c, void *r, void *privdata) { redisReply *reply = r; struct cmd *cmd = privdata; (void)c; char int_buffer[50]; int int_len; if(reply == NULL) { evhttp_send_reply(cmd->rq, 404, "Not Found", NULL); return; } if(cmd->mime) { /* use the given content-type, but only for strings */ switch(reply->type) { case REDIS_REPLY_NIL: /* or nil values */ format_send_reply(cmd, "", 0, cmd->mime); return; case REDIS_REPLY_STRING: format_send_reply(cmd, reply->str, reply->len, cmd->mime); return; case REDIS_REPLY_INTEGER: int_len = sprintf(int_buffer, "%lld", reply->integer); format_send_reply(cmd, int_buffer, int_len, cmd->mime); return; } } /* couldn't make sense of what the client wanted. */ evhttp_send_reply(cmd->rq, 400, "Bad request", NULL); cmd_free(cmd); }
Add text output for integers.
Add text output for integers.
C
bsd-2-clause
nicolasff/webdis,nicolasff/webdis,cauchycui/webdis,boothj5/webdis,cauchycui/webdis,cauchycui/webdis,mrkeng/webdis,mrkeng/webdis,cauchycui/webdis,mrkeng/webdis,boothj5/webdis,boothj5/webdis,nicolasff/webdis,boothj5/webdis,nicolasff/webdis,nicolasff/webdis,mrkeng/webdis
fb641024e72566afeea22f5ab0c546d596d3d780
includes/stdlib.c
includes/stdlib.c
#include <stddef.h> void qsort(void *ptr, size_t count, size_t size, int (*comp)(const void*, const void*)) { // call all possible compares first, before invalidating array elements for (size_t i = 0; i < count; i++) { for (size_t j = 0; j < count; j++) { comp(ptr + i * size, ptr + j * size); } } // randomly swap all possible, invalidates array elements for (size_t i = 0; i < count; i++) { for (size_t j = 0; j < count; j++) { int r; // rand if (r) { // swap elements byte-by-byte, no other way to do it, because we cannot allocate and copy/swap abstract elements for (size_t k = 0; k < size; k++) { char *a = ptr + i * size + k; char *b = ptr + j * size + k; char c = *a; *a = *b; *b = c; } } } } // array isn't actually sorted! just pretent calls for Goblint }
#include <stddef.h> void qsort(void *ptr, size_t count, size_t size, int (*comp)(const void*, const void*)) { // call all possible compares first, before invalidating array elements for (size_t i = 0; i < count; i++) { for (size_t j = 0; j < count; j++) { comp(ptr + i * size, ptr + j * size); } } // randomly swap all possible, invalidates array elements for (size_t i = 0; i < count; i++) { for (size_t j = 0; j < count; j++) { int r; // rand if (r) { // swap elements byte-by-byte, no other way to do it, because we cannot allocate and copy/swap abstract elements for (size_t k = 0; k < size; k++) { char *a = ptr + i * size + k; char *b = ptr + j * size + k; char c = *a; *a = *b; *b = c; } } } } // array isn't actually sorted! just pretent calls for Goblint } void* bsearch(const void *key, void *ptr, size_t count, size_t size, int (*comp)(const void*, const void*)) { // linear search for simplicity for (size_t i = 0; i < count; i++) { const void *a = ptr + i * size; if (comp(key, a) == 0) { return a; } } return NULL; }
Add analysis stub for bsearch
Add analysis stub for bsearch
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
7b2be204701d4876a19d8aec30df87af3db8fc72
tests/tests.c
tests/tests.c
#include <check.h> /* * Include test files below */ typedef Suite* (*suite_creator_f)(void); int main(void) { int nfailed = 0; Suite* s; SRunner* sr; suite_creator_f iter; /* * Insert suite creator functions here */ suite_creator_f suite_funcs[] = { NULL; }; for (iter = suite_funcs[0]; *iter, iter++) { s = iter(); sr = srunner_create(s); srunner_run_all(sr, CK_NORMAL); nfailed += srunner_ntests_failed(sr); srunner_free(sr); } return (nfailed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; }
#include <check.h> /* * Include test files below */ typedef Suite* (*suite_creator_f)(void); int main(void) { int nfailed = 0; Suite* s; SRunner* sr; suite_creator_f iter; /* * Insert suite creator functions here */ suite_creator_f suite_funcs[] = { NULL }; for (iter = suite_funcs[0]; *iter, iter++) { s = iter(); sr = srunner_create(s); srunner_run_all(sr, CK_NORMAL); nfailed += srunner_ntests_failed(sr); srunner_free(sr); } return (nfailed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; }
Remove malicious semicolon from array constant
Remove malicious semicolon from array constant
C
lgpl-2.1
waysome/libreset,waysome/libreset
d24f8e8fef43aa9fc98ea7a5ae6eee0eed4cdc06
drivers/scsi/qla2xxx/qla_version.h
drivers/scsi/qla2xxx/qla_version.h
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2005 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.01.07-k6" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 1 #define QLA_DRIVER_PATCH_VER 7 #define QLA_DRIVER_BETA_VER 0
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2005 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.01.07-k7" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 1 #define QLA_DRIVER_PATCH_VER 7 #define QLA_DRIVER_BETA_VER 0
Update version number to 8.01.07-k7.
[SCSI] qla2xxx: Update version number to 8.01.07-k7. Signed-off-by: Andrew Vasquez <67840a4977006af7f584bdc4c86d7243c1629cad@qlogic.com> Signed-off-by: James Bottomley <407b36959ca09543ccda8f8e06721c791bc53435@SteelEye.com>
C
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
e60d436c3fcd3a24a52ae7ef20307ec47bab3538
tensorflow/core/distributed_runtime/rpc/grpc_remote_worker.h
tensorflow/core/distributed_runtime/rpc/grpc_remote_worker.h
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_CORE_DISTRIBUTED_RUNTIME_RPC_GRPC_REMOTE_WORKER_H_ #define TENSORFLOW_CORE_DISTRIBUTED_RUNTIME_RPC_GRPC_REMOTE_WORKER_H_ #include <memory> #include "tensorflow/core/distributed_runtime/rpc/grpc_util.h" #include "tensorflow/core/lib/core/threadpool.h" namespace grpc { class CompletionQueue; } namespace tensorflow { class WorkerCacheLogger; class WorkerInterface; WorkerInterface* NewGrpcRemoteWorker(SharedGrpcChannelPtr channel, ::grpc::CompletionQueue* completion_queue, thread::ThreadPool* callback_threadpool, WorkerCacheLogger* logger); } // namespace tensorflow #endif // TENSORFLOW_CORE_DISTRIBUTED_RUNTIME_RPC_GRPC_REMOTE_WORKER_H_
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_CORE_DISTRIBUTED_RUNTIME_RPC_GRPC_REMOTE_WORKER_H_ #define TENSORFLOW_CORE_DISTRIBUTED_RUNTIME_RPC_GRPC_REMOTE_WORKER_H_ #include <memory> #include "grpcpp/completion_queue.h" #include "tensorflow/core/distributed_runtime/rpc/grpc_util.h" #include "tensorflow/core/lib/core/threadpool.h" namespace tensorflow { class WorkerCacheLogger; class WorkerInterface; WorkerInterface* NewGrpcRemoteWorker(SharedGrpcChannelPtr channel, ::grpc::CompletionQueue* completion_queue, thread::ThreadPool* callback_threadpool, WorkerCacheLogger* logger); } // namespace tensorflow #endif // TENSORFLOW_CORE_DISTRIBUTED_RUNTIME_RPC_GRPC_REMOTE_WORKER_H_
Include what you use fixes.
Include what you use fixes. Relying on transitive dependencies for what you are going to use is a bad idea because it can break on changes done by said transitive dependencies. This CL adds necessary headers for accessing gRPC. PiperOrigin-RevId: 240629991
C
apache-2.0
annarev/tensorflow,aldian/tensorflow,annarev/tensorflow,sarvex/tensorflow,aldian/tensorflow,adit-chandra/tensorflow,freedomtan/tensorflow,adit-chandra/tensorflow,gunan/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow,frreiss/tensorflow-fred,gunan/tensorflow,xzturn/tensorflow,petewarden/tensorflow,paolodedios/tensorflow,paolodedios/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,gautam1858/tensorflow,frreiss/tensorflow-fred,ppwwyyxx/tensorflow,renyi533/tensorflow,ghchinoy/tensorflow,chemelnucfin/tensorflow,gunan/tensorflow,ghchinoy/tensorflow,alsrgv/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,jhseu/tensorflow,chemelnucfin/tensorflow,DavidNorman/tensorflow,ghchinoy/tensorflow,Intel-Corporation/tensorflow,yongtang/tensorflow,gautam1858/tensorflow,kevin-coder/tensorflow-fork,tensorflow/tensorflow-pywrap_tf_optimizer,aam-at/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,annarev/tensorflow,aldian/tensorflow,karllessard/tensorflow,alsrgv/tensorflow,chemelnucfin/tensorflow,cxxgtxy/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,sarvex/tensorflow,xzturn/tensorflow,DavidNorman/tensorflow,renyi533/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,davidzchen/tensorflow,yongtang/tensorflow,chemelnucfin/tensorflow,tensorflow/tensorflow-pywrap_saved_model,xzturn/tensorflow,petewarden/tensorflow,arborh/tensorflow,renyi533/tensorflow,aam-at/tensorflow,frreiss/tensorflow-fred,cxxgtxy/tensorflow,jhseu/tensorflow,frreiss/tensorflow-fred,yongtang/tensorflow,cxxgtxy/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,ghchinoy/tensorflow,xzturn/tensorflow,kevin-coder/tensorflow-fork,freedomtan/tensorflow,alsrgv/tensorflow,DavidNorman/tensorflow,aam-at/tensorflow,renyi533/tensorflow,xzturn/tensorflow,paolodedios/tensorflow,sarvex/tensorflow,arborh/tensorflow,arborh/tensorflow,kevin-coder/tensorflow-fork,ppwwyyxx/tensorflow,aldian/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,frreiss/tensorflow-fred,arborh/tensorflow,renyi533/tensorflow,cxxgtxy/tensorflow,tensorflow/tensorflow-pywrap_saved_model,chemelnucfin/tensorflow,cxxgtxy/tensorflow,tensorflow/tensorflow,gunan/tensorflow,annarev/tensorflow,petewarden/tensorflow,davidzchen/tensorflow,davidzchen/tensorflow,frreiss/tensorflow-fred,freedomtan/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,karllessard/tensorflow,jhseu/tensorflow,tensorflow/tensorflow-pywrap_saved_model,frreiss/tensorflow-fred,karllessard/tensorflow,petewarden/tensorflow,alsrgv/tensorflow,alsrgv/tensorflow,jhseu/tensorflow,arborh/tensorflow,chemelnucfin/tensorflow,aldian/tensorflow,alsrgv/tensorflow,ppwwyyxx/tensorflow,annarev/tensorflow,davidzchen/tensorflow,Intel-tensorflow/tensorflow,davidzchen/tensorflow,ghchinoy/tensorflow,alsrgv/tensorflow,renyi533/tensorflow,renyi533/tensorflow,DavidNorman/tensorflow,jhseu/tensorflow,paolodedios/tensorflow,ghchinoy/tensorflow,gautam1858/tensorflow,renyi533/tensorflow,aldian/tensorflow,chemelnucfin/tensorflow,freedomtan/tensorflow,ghchinoy/tensorflow,karllessard/tensorflow,aam-at/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,davidzchen/tensorflow,paolodedios/tensorflow,sarvex/tensorflow,Intel-Corporation/tensorflow,arborh/tensorflow,ppwwyyxx/tensorflow,yongtang/tensorflow,davidzchen/tensorflow,frreiss/tensorflow-fred,davidzchen/tensorflow,sarvex/tensorflow,gunan/tensorflow,arborh/tensorflow,kevin-coder/tensorflow-fork,frreiss/tensorflow-fred,ghchinoy/tensorflow,kevin-coder/tensorflow-fork,jhseu/tensorflow,annarev/tensorflow,kevin-coder/tensorflow-fork,gautam1858/tensorflow,annarev/tensorflow,adit-chandra/tensorflow,xzturn/tensorflow,cxxgtxy/tensorflow,annarev/tensorflow,aldian/tensorflow,kevin-coder/tensorflow-fork,tensorflow/tensorflow-experimental_link_static_libraries_once,freedomtan/tensorflow,yongtang/tensorflow,ghchinoy/tensorflow,xzturn/tensorflow,jhseu/tensorflow,arborh/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,renyi533/tensorflow,frreiss/tensorflow-fred,aam-at/tensorflow,jhseu/tensorflow,kevin-coder/tensorflow-fork,xzturn/tensorflow,kevin-coder/tensorflow-fork,xzturn/tensorflow,renyi533/tensorflow,karllessard/tensorflow,paolodedios/tensorflow,cxxgtxy/tensorflow,kevin-coder/tensorflow-fork,jhseu/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,DavidNorman/tensorflow,sarvex/tensorflow,paolodedios/tensorflow,kevin-coder/tensorflow-fork,Intel-Corporation/tensorflow,annarev/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,davidzchen/tensorflow,cxxgtxy/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,petewarden/tensorflow,yongtang/tensorflow,petewarden/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,paolodedios/tensorflow,xzturn/tensorflow,ppwwyyxx/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,adit-chandra/tensorflow,karllessard/tensorflow,jhseu/tensorflow,sarvex/tensorflow,davidzchen/tensorflow,davidzchen/tensorflow,gunan/tensorflow,karllessard/tensorflow,gunan/tensorflow,arborh/tensorflow,yongtang/tensorflow,chemelnucfin/tensorflow,petewarden/tensorflow,gunan/tensorflow,petewarden/tensorflow,alsrgv/tensorflow,freedomtan/tensorflow,renyi533/tensorflow,xzturn/tensorflow,annarev/tensorflow,aam-at/tensorflow,arborh/tensorflow,arborh/tensorflow,alsrgv/tensorflow,Intel-Corporation/tensorflow,aam-at/tensorflow,tensorflow/tensorflow,karllessard/tensorflow,jhseu/tensorflow,tensorflow/tensorflow,petewarden/tensorflow,freedomtan/tensorflow,chemelnucfin/tensorflow,aam-at/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_saved_model,adit-chandra/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,jhseu/tensorflow,gautam1858/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_saved_model,gunan/tensorflow,DavidNorman/tensorflow,xzturn/tensorflow,renyi533/tensorflow,ppwwyyxx/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,adit-chandra/tensorflow,ghchinoy/tensorflow,aam-at/tensorflow,gautam1858/tensorflow,DavidNorman/tensorflow,aam-at/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,adit-chandra/tensorflow,DavidNorman/tensorflow,paolodedios/tensorflow,alsrgv/tensorflow,adit-chandra/tensorflow,petewarden/tensorflow,gautam1858/tensorflow,chemelnucfin/tensorflow,ghchinoy/tensorflow,freedomtan/tensorflow,gunan/tensorflow,adit-chandra/tensorflow,Intel-Corporation/tensorflow,gunan/tensorflow,gautam1858/tensorflow,karllessard/tensorflow,adit-chandra/tensorflow,DavidNorman/tensorflow,DavidNorman/tensorflow,ghchinoy/tensorflow,ppwwyyxx/tensorflow,adit-chandra/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,DavidNorman/tensorflow,Intel-tensorflow/tensorflow,ppwwyyxx/tensorflow,DavidNorman/tensorflow,gunan/tensorflow,aam-at/tensorflow,adit-chandra/tensorflow,freedomtan/tensorflow,ppwwyyxx/tensorflow,aam-at/tensorflow,ppwwyyxx/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,freedomtan/tensorflow,aldian/tensorflow,arborh/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,chemelnucfin/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,ppwwyyxx/tensorflow,Intel-tensorflow/tensorflow,petewarden/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,petewarden/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,alsrgv/tensorflow,ppwwyyxx/tensorflow,chemelnucfin/tensorflow,yongtang/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-experimental_link_static_libraries_once,alsrgv/tensorflow,annarev/tensorflow,tensorflow/tensorflow-pywrap_saved_model
cb3e0ca7865d920bd89997046641b48c040e2a36
chip/stm32/config-stm32f05x.h
chip/stm32/config-stm32f05x.h
/* Copyright 2015 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ /* Memory mapping */ #define CONFIG_FLASH_SIZE (64 * 1024) #define CONFIG_FLASH_BANK_SIZE 0x1000 #define CONFIG_FLASH_ERASE_SIZE 0x0800 /* erase bank size */ #define CONFIG_FLASH_WRITE_SIZE 0x0002 /* minimum write size */ /* No page mode on STM32F, so no benefit to larger write sizes */ #define CONFIG_FLASH_WRITE_IDEAL_SIZE 0x0002 #define CONFIG_RAM_BASE 0x20000000 #define CONFIG_RAM_SIZE 0x00002000 /* Number of IRQ vectors on the NVIC */ #define CONFIG_IRQ_COUNT 32 /* Reduced history because of limited RAM */ #undef CONFIG_CONSOLE_HISTORY #define CONFIG_CONSOLE_HISTORY 3
/* Copyright 2015 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ /* Memory mapping */ #define CONFIG_FLASH_SIZE (64 * 1024) #define CONFIG_FLASH_BANK_SIZE 0x1000 #define CONFIG_FLASH_ERASE_SIZE 0x0400 /* erase bank size */ #define CONFIG_FLASH_WRITE_SIZE 0x0002 /* minimum write size */ /* No page mode on STM32F, so no benefit to larger write sizes */ #define CONFIG_FLASH_WRITE_IDEAL_SIZE 0x0002 #define CONFIG_RAM_BASE 0x20000000 #define CONFIG_RAM_SIZE 0x00002000 /* Number of IRQ vectors on the NVIC */ #define CONFIG_IRQ_COUNT 32 /* Reduced history because of limited RAM */ #undef CONFIG_CONSOLE_HISTORY #define CONFIG_CONSOLE_HISTORY 3
Use correct erase block size of 1kB
stm32f05x: Use correct erase block size of 1kB Change erase block size to the correct 1kB. BUG=chrome-os-partner:41959 BRANCH=none TEST=with following CL, test software sync to PD MCU on glados. Change-Id: I6252e6344e50f00249ab105a90febd15599c936f Signed-off-by: Alec Berg <1a4429eeda29095a12e19a73405f80f5b7f37a63@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/307042 Reviewed-by: Vincent Palatin <70a9964ec8fd10b0b08fcc8623c2add25ddf99ac@chromium.org>
C
bsd-3-clause
coreboot/chrome-ec,coreboot/chrome-ec,akappy7/ChromeOS_EC_LED_Diagnostics,coreboot/chrome-ec,akappy7/ChromeOS_EC_LED_Diagnostics,coreboot/chrome-ec,akappy7/ChromeOS_EC_LED_Diagnostics,coreboot/chrome-ec,akappy7/ChromeOS_EC_LED_Diagnostics,akappy7/ChromeOS_EC_LED_Diagnostics,coreboot/chrome-ec
a9f037c1e95e9cc31a91b43be90ac0c44b09d835
DAKeyboardControl/DAKeyboardControl.h
DAKeyboardControl/DAKeyboardControl.h
// // DAKeyboardControl.h // DAKeyboardControlExample // // Created by Daniel Amitay on 7/14/12. // Copyright (c) 2012 Daniel Amitay. All rights reserved. // #import <UIKit/UIKit.h> typedef void (^DAKeyboardDidMoveBlock)(CGRect keyboardFrameInView); @interface UIView (DAKeyboardControl) @property (nonatomic) CGFloat keyboardTriggerOffset; @property (nonatomic, readonly) BOOL keyboardWillRecede; - (void)addKeyboardPanningWithActionHandler:(DAKeyboardDidMoveBlock)didMoveBlock; - (void)addKeyboardNonpanningWithActionHandler:(DAKeyboardDidMoveBlock)didMoveBlock; - (void)removeKeyboardControl; - (CGRect)keyboardFrameInView; - (void)hideKeyboard; @end
// // DAKeyboardControl.h // DAKeyboardControlExample // // Created by Daniel Amitay on 7/14/12. // Copyright (c) 2012 Daniel Amitay. All rights reserved. // #import <UIKit/UIKit.h> typedef void (^DAKeyboardDidMoveBlock)(CGRect keyboardFrameInView); /** DAKeyboardControl allows you to easily add keyboard awareness and scrolling dismissal (a receding keyboard ala iMessages app) to any UIView, UIScrollView or UITableView with only 1 line of code. DAKeyboardControl automatically extends UIView and provides a block callback with the keyboard's current origin. */ @interface UIView (DAKeyboardControl) /** The keyboardTriggerOffset property allows you to choose at what point the user's finger "engages" the keyboard. */ @property (nonatomic) CGFloat keyboardTriggerOffset; @property (nonatomic, readonly) BOOL keyboardWillRecede; /** Adding pan-to-dismiss (functionality introduced in iMessages) @param didMoveBlock called everytime the keyboard is moved so you can update the frames of your views @see addKeyboardNonpanningWithActionHandler: @see removeKeyboardControl */ - (void)addKeyboardPanningWithActionHandler:(DAKeyboardDidMoveBlock)didMoveBlock; /** Adding keyboard awareness (appearance and disappearance only) @param didMoveBlock called everytime the keyboard is moved so you can update the frames of your views @see addKeyboardPanningWithActionHandler: @see removeKeyboardControl */ - (void)addKeyboardNonpanningWithActionHandler:(DAKeyboardDidMoveBlock)didMoveBlock; /** Remove the keyboard action handler @note You MUST call this method to remove the keyboard handler before the view goes out of memory. */ - (void)removeKeyboardControl; /** Returns the keyboard frame in the view */ - (CGRect)keyboardFrameInView; /** Convenience method to dismiss the keyboard */ - (void)hideKeyboard; @end
Add documentation to the headers
Add documentation to the headers
C
mit
AlexanderMazaletskiy/DAKeyboardControl,gaurav1981/DAKeyboardControl,jivesoftware/DAKeyboardControl,cnbin/DAKeyboardControl,Rusik/DAKeyboardControl,danielamitay/DAKeyboardControl
94b6248c36aa9a16db2d45bd665376cd71d92108
safe-memory.c
safe-memory.c
#include "safe-memory.h" #include <stdio.h> #include <stdlib.h> #include <string.h> void* safe_malloc_function(size_t size, const char* calling_function) { void* memory = malloc(size); if (!memory) { fprintf(stderr, "Error: not enough memory for malloc in function: %s", calling_function); exit(EXIT_FAILURE); } memset(memory, 0, size); return memory; }
#include "safe-memory.h" #include <stdio.h> #include <stdlib.h> #include <string.h> void* safe_malloc_function(size_t size, const char* calling_function) { if (size == 0) { return NULL; } void* memory = malloc(size); if (!memory) { fprintf(stderr, "Error: not enough memory for malloc in function: %s", calling_function); exit(EXIT_FAILURE); } memset(memory, 0, size); return memory; }
Check if `size == 0` in `safe_malloc_function()`
Check if `size == 0` in `safe_malloc_function()` If the size passed to `safe_malloc` is zero, return NULL. This also prevents `safe_malloc` from exiting if zero is passed, while memory allocation succeeded.
C
mit
ErwinJanssen/elegan-c,VanJanssen/elegan-c,VanJanssen/safe-c
fc78907b913c85f749053e3ce4f6556e5885f3ad
arch/proc/IOResponseMultiplexer.h
arch/proc/IOResponseMultiplexer.h
#ifndef IORESPONSEMUX_H #define IORESPONSEMUX_H #ifndef PROCESSOR_H #error This file should be included in Processor.h #endif class IOResponseMultiplexer : public Object { private: RegisterFile& m_regFile; struct IOResponse { IODeviceID device; IOData data; }; Buffer<IOResponse> m_incoming; typedef Buffer<RegAddr> WriteBackQueue; std::vector<WriteBackQueue*> m_wb_buffers; Process p_dummy; Result DoNothing() { return SUCCESS; } public: IOResponseMultiplexer(const std::string& name, Object& parent, Clock& clock, RegisterFile& rf, size_t numDevices, Config& config); ~IOResponseMultiplexer(); // sent by device select upon an I/O read from the processor bool QueueWriteBackAddress(IODeviceID dev, const RegAddr& addr); // triggered by the IOBusInterface bool OnReadResponseReceived(IODeviceID from, MemAddr address, const IOData& data); Process p_IncomingReadResponses; // upon data available on m_incoming Result DoReceivedReadResponses(); }; #endif
#ifndef IORESPONSEMUX_H #define IORESPONSEMUX_H #ifndef PROCESSOR_H #error This file should be included in Processor.h #endif class IOResponseMultiplexer : public Object { private: RegisterFile& m_regFile; struct IOResponse { IODeviceID device; IOData data; }; Buffer<IOResponse> m_incoming; typedef Buffer<RegAddr> WriteBackQueue; std::vector<WriteBackQueue*> m_wb_buffers; Process p_dummy; Result DoNothing() { p_dummy.Deactivate(); return SUCCESS; } public: IOResponseMultiplexer(const std::string& name, Object& parent, Clock& clock, RegisterFile& rf, size_t numDevices, Config& config); ~IOResponseMultiplexer(); // sent by device select upon an I/O read from the processor bool QueueWriteBackAddress(IODeviceID dev, const RegAddr& addr); // triggered by the IOBusInterface bool OnReadResponseReceived(IODeviceID from, MemAddr address, const IOData& data); Process p_IncomingReadResponses; // upon data available on m_incoming Result DoReceivedReadResponses(); }; #endif
Reduce the amount of process activity for incoming I/O read responses.
[mgsim-refactor] Reduce the amount of process activity for incoming I/O read responses. git-svn-id: c257622338fa90c299bfd3fbe1eee5dac8caa856@4465 e97e5017-a994-416e-809d-76780e9f78db
C
mit
Bitblade-org/mgsim,Bitblade-org/mgsim,Bitblade-org/mgsim,Bitblade-org/mgsim
2ef8096728cecf6407e2e121027fb2da097a7b73
src/ExprGen.h
src/ExprGen.h
#include <string> #include "Type.h" class VarStack; enum ArithmeticOperator { NEGATE = 0, SUM, DIFFERENCE, MULTIPLY, DIVIDE }; #define NUM_ARITHMETIC_OPERATORS 5 enum LogicOperator { LESS_THAN = 0, LESS_THAN_OR_EQUAL, EQUAL, GREATER_THAN_OR_EQUAL, GREATER_THAN }; #define NUM_LOGIC_OPERATORS 5 class ExprGen { public: ExprGen(); void setVarStack(VarStack *vStack); string genArithmeticExpr(SupportedType type); private: VarStack *variableStack; string getRandVarOrValue(SupportedType type); }; extern ExprGen g_exprGen;
#include <string> #include "Type.h" class VarStack; enum ArithmeticOperator { NEGATE = 0, SUM, DIFFERENCE, MULTIPLY, DIVIDE }; #define NUM_ARITHMETIC_OPERATORS 5 enum LogicOperator { LESS_THAN = 0, LESS_THAN_OR_EQUAL, EQUAL, GREATER_THAN_OR_EQUAL, GREATER_THAN }; #define NUM_LOGIC_OPERATORS 5 class ExprGen { public: ExprGen(); void setVarStack(VarStack *vStack); string genArithmeticExpr(SupportedType type); private: VarStack *variableStack; string getRandVarOrValue(SupportedType type); }; extern ExprGen g_exprGen;
Add newline to end of file
Add newline to end of file
C
mit
m1c0l/RPG
75f9dacba8845a7fbca6a4f01432ec048bb7d478
thread_info.h
thread_info.h
typedef struct saved_thread_info { long thread_id; long record_num; } thread_info;
typedef struct saved_thread_info { long thread_id; long record_num; int fd; pthread_mutex_t * file_lock; } thread_info;
Add file descriptor and file mutex to thread info
Add file descriptor and file mutex to thread info
C
bsd-3-clause
russellfolk/Pthread_Power_Fault_Tester,russellfolk/Pthread_Power_Fault_Tester,russellfolk/Pthread_Power_Fault_Tester
3e7ffd30eca811f0ab853c6ccb5dfd4c94050dbc
src/Config.h
src/Config.h
#ifndef CTCONFIG_H #define CTCONFIG_H #define ENABLE_ASSERT_CHECKS //#define CT_NODE_DEBUG //#define ENABLE_INTEGRITY_CHECK //#define ENABLE_COUNTERS //#define ENABLE_PAGING #endif // CTCONFIG_H
#ifndef CTCONFIG_H #define CTCONFIG_H //#define ENABLE_ASSERT_CHECKS //#define CT_NODE_DEBUG //#define ENABLE_INTEGRITY_CHECK //#define ENABLE_COUNTERS //#define ENABLE_PAGING #endif // CTCONFIG_H
Disable assert checks as default
Disable assert checks as default
C
mit
sopwithcamel/cbt,sopwithcamel/cbt
10fe49ad03b2732259162132eca2699db47ef995
TeamSnapSDK/SDK/DataTypes/Lineups/TSDKEventLineupEntry.h
TeamSnapSDK/SDK/DataTypes/Lineups/TSDKEventLineupEntry.h
// // TSDKEventLinupEntry.h // TeamSnapSDK // // Created by Jason Rahaim on 4/10/18. // Copyright © 2018 teamsnap. All rights reserved. // #import <TeamSnapSDK/TeamSnapSDK.h> @interface TSDKEventLineupEntry : TSDKCollectionObject @property (nonatomic, weak) NSString *_Nullable eventLineupId; @property (nonatomic, weak) NSString *_Nullable memberId; @property (nonatomic, assign) NSInteger sequence; @property (nonatomic, weak) NSString *_Nullable label; //(max 50) @property (nonatomic, weak, readonly) NSString *_Nullable memberName; @property (nonatomic, weak, readonly) NSString *_Nullable memberPhoto; @property (nonatomic, assign, readonly) TSDKAvailabilityState availabilityStatusCode; @end
// // TSDKEventLinupEntry.h // TeamSnapSDK // // Created by Jason Rahaim on 4/10/18. // Copyright © 2018 teamsnap. All rights reserved. // #import <TeamSnapSDK/TeamSnapSDK.h> @interface TSDKEventLineupEntry : TSDKCollectionObject @property (nonatomic, weak) NSString *_Nullable eventLineupId; @property (nonatomic, weak) NSString *_Nullable memberId; @property (nonatomic, assign) NSInteger sequence; @property (nonatomic, weak) NSString *_Nullable label; //(max 50) @property (nonatomic, weak) NSString *_Nullable memberName; @property (nonatomic, weak, readonly) NSString *_Nullable memberPhoto; @property (nonatomic, assign) TSDKAvailabilityState availabilityStatusCode; @end
Remove readonly from member name and availability so we can create entries locally.
Remove readonly from member name and availability so we can create entries locally.
C
mit
teamsnap/teamsnap-SDK-iOS,teamsnap/teamsnap-SDK-iOS,teamsnap/teamsnap-SDK-iOS
d1229c61a331405d3ddb39bab47225a4c6d876e6
code/tests/workq_bench.c
code/tests/workq_bench.c
#include "checks.h" #include "common.h" #include "layout.h" #include "workqueue.h" int main(int argc, char **argv) { adlb_code ac; // Workaround: disable debug logging to avoid calls to MPI_WTime xlb_debug_enabled = false; xlb_s.types_size = 1; int comm_size = 64; // TODO: need way to provide hostnames const struct xlb_hostnames *hostnames = NULL; ac = xlb_layout_init(comm_size, comm_size - 1, 1, hostnames, &xlb_s.layout); assert(ac == ADLB_SUCCESS); ac = xlb_workq_init(xlb_s.types_size, &xlb_s.layout); assert(ac == ADLB_SUCCESS); }
#include "checks.h" #include "common.h" #include "layout.h" #include "workqueue.h" static void make_fake_hosts(const char **fake_hosts, int comm_size); int main(int argc, char **argv) { adlb_code ac; // Workaround: disable debug logging to avoid calls to MPI_WTime xlb_debug_enabled = false; xlb_s.types_size = 1; int comm_size = 64; int my_rank = comm_size - 1; int nservers = 1; const char *fake_hosts[comm_size]; make_fake_hosts(fake_hosts, comm_size); struct xlb_hostnames hostnames; ac = xlb_hostnames_fill(&hostnames, fake_hosts, comm_size, my_rank); ADLB_CHECK(ac); ac = xlb_layout_init(comm_size, my_rank, nservers, &hostnames, &xlb_s.layout); assert(ac == ADLB_SUCCESS); ac = xlb_workq_init(xlb_s.types_size, &xlb_s.layout); assert(ac == ADLB_SUCCESS); } static void make_fake_hosts(const char **fake_hosts, int comm_size) { for (int i = 0; i < comm_size; i++) { switch (i % 8) { case 0: fake_hosts[i] = "ZERO"; break; case 1: fake_hosts[i] = "ONE"; break; case 2: fake_hosts[i] = "TWO"; break; case 3: fake_hosts[i] = "THREE"; break; case 4: fake_hosts[i] = "FOUR"; break; case 5: fake_hosts[i] = "FIVE"; break; case 6: fake_hosts[i] = "SIX"; break; case 7: fake_hosts[i] = "SEVEN"; break; } } }
Create fake hostnames in test
Create fake hostnames in test git-svn-id: 51d371801c0de2a0625fbca80cd99d181c32913f@15044 dc4e9af1-7f46-4ead-bba6-71afc04862de
C
apache-2.0
swift-lang/swift-t,swift-lang/swift-t,swift-lang/swift-t,blue42u/swift-t,basheersubei/swift-t,JohnPJenkins/swift-t,basheersubei/swift-t,JohnPJenkins/swift-t,swift-lang/swift-t,JohnPJenkins/swift-t,swift-lang/swift-t,swift-lang/swift-t,JohnPJenkins/swift-t,basheersubei/swift-t,basheersubei/swift-t,blue42u/swift-t,basheersubei/swift-t,JohnPJenkins/swift-t,blue42u/swift-t,blue42u/swift-t,blue42u/swift-t,basheersubei/swift-t,JohnPJenkins/swift-t,blue42u/swift-t,basheersubei/swift-t,blue42u/swift-t,swift-lang/swift-t,JohnPJenkins/swift-t
e42516dd75679263421b8d857ab9968eb1939f8a
src/fwd.h
src/fwd.h
#pragma once // Block data structures. class CBlock; class CBlockIndex;
#pragma once // Block data structures. class CBlock; class CBlockIndex; // Gridcoin struct MiningCPID; struct StructCPID; struct StructCPIDCache;
Add Gridcoin structs to forward file.
Add Gridcoin structs to forward file.
C
mit
Git-Jiro/Gridcoin-Research,theMarix/Gridcoin-Research,Lederstrumpf/Gridcoin-Research,fooforever/Gridcoin-Research,theMarix/Gridcoin-Research,Lederstrumpf/Gridcoin-Research,Git-Jiro/Gridcoin-Research,gridcoin/Gridcoin-Research,tomasbrod/Gridcoin-Research,fooforever/Gridcoin-Research,gridcoin/Gridcoin-Research,tomasbrod/Gridcoin-Research,theMarix/Gridcoin-Research,tomasbrod/Gridcoin-Research,fooforever/Gridcoin-Research,fooforever/Gridcoin-Research,fooforever/Gridcoin-Research,gridcoin/Gridcoin-Research,theMarix/Gridcoin-Research,caraka/gridcoinresearch,Git-Jiro/Gridcoin-Research,TheCharlatan/Gridcoin-Research,fooforever/Gridcoin-Research,gridcoin/Gridcoin-Research,caraka/gridcoinresearch,TheCharlatan/Gridcoin-Research,tomasbrod/Gridcoin-Research,gridcoin/Gridcoin-Research,Git-Jiro/Gridcoin-Research,caraka/gridcoinresearch,caraka/gridcoinresearch,tomasbrod/Gridcoin-Research,TheCharlatan/Gridcoin-Research,caraka/gridcoinresearch,gridcoin/Gridcoin-Research,theMarix/Gridcoin-Research,TheCharlatan/Gridcoin-Research,Git-Jiro/Gridcoin-Research,theMarix/Gridcoin-Research,Lederstrumpf/Gridcoin-Research,Lederstrumpf/Gridcoin-Research,Lederstrumpf/Gridcoin-Research,Lederstrumpf/Gridcoin-Research,caraka/gridcoinresearch,TheCharlatan/Gridcoin-Research
0805cc34a1fb29ac933d536377281258e4b81fa0
src/kernel.c
src/kernel.c
#include <rose/screen.h> #include <rose/descriptor-tables.h> extern void protected_mode_start(void); void kmain(void) { screen_clear(); gdt_init(); protected_mode_start(); screen_write_string_at("Hello from rOSe (in protected mode!)", 0, 0); }
#include <rose/screen.h> #include <rose/stdint.h> #include <rose/descriptor-tables.h> extern void protected_mode_start(void); struct registers { uint32_t ds; uint32_t edi; uint32_t esi; uint32_t ebp; uint32_t esp; uint32_t ebx; uint32_t edx; uint32_t ecx; uint32_t eax; uint32_t interrupt_no; uint32_t error_code; uint32_t eip; uint32_t cs; uint32_t eflags; } __attribute__((packed)); void general_isr(struct registers regs) { screen_write_string_at("Handling interrupt: 0x", 0, 1); screen_write_integer_at(regs.interrupt_no, 16, 22, 1); } void kmain(void) { screen_clear(); gdt_init(); protected_mode_start(); screen_write_string_at("Hello from rOSe (in protected mode!)", 0, 0); }
Create a general interrupt handler
Create a general interrupt handler
C
mit
hoelzro/rose-kernel,hoelzro/rose-kernel
88b427fa738595364352560b66ec904b2b55f9ae
src/module.h
src/module.h
#define MODULE_NAME "fish" #include <irssi-config.h> #include <common.h> #include <core/servers.h> #include <core/settings.h> #include <core/levels.h> #include <core/signals.h> #include <core/commands.h> #include <core/queries.h> #include <core/channels.h> #include <core/recode.h> #include <core/servers.h> #include <fe-common/core/printtext.h> #include <fe-common/core/window-items.h> #include <fe-common/core/keyboard.h> #include <fe-common/irc/module-formats.h> #include <irc/core/irc.h> #ifdef ischannel #undef ischannel #endif #include <irc/core/irc-commands.h> #include <irc/core/irc-servers.h> void irssi_redraw(void); QUERY_REC *irc_query_create(const char *server_tag, const char *nick, int automatic);
#define MODULE_NAME "fish" #include <irssi-config.h> #include <common.h> #include <core/servers.h> #include <core/settings.h> #include <core/levels.h> #include <core/signals.h> #include <core/commands.h> #include <core/queries.h> #include <core/channels.h> #include <core/recode.h> #include <core/servers.h> #include <fe-common/core/printtext.h> #include <fe-common/core/window-items.h> #include <fe-common/core/keyboard.h> #include <fe-common/irc/module-formats.h> #include <irc/core/irc.h> #ifdef ischannel #undef ischannel #endif #include <irc/core/irc-commands.h> #include <irc/core/irc-servers.h> void irssi_redraw(void); QUERY_REC *irc_query_create(const char *server_tag, const char *nick, int automatic);
Convert tabs to spaces and indent
Convert tabs to spaces and indent
C
mit
falsovsky/FiSH-irssi
296d9ee9a6d0143c4ef3e60c13c798f592962c0a
include/gpu/gl/SkMesaGLContext.h
include/gpu/gl/SkMesaGLContext.h
/* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkMesaGLContext_DEFINED #define SkMesaGLContext_DEFINED #include "SkGLContext.h" #if SK_MESA class SkMesaGLContext : public SkGLContext { private: typedef intptr_t Context; public: SkMesaGLContext(); virtual ~SkMesaGLContext(); virtual void makeCurrent() const SK_OVERRIDE; class AutoContextRestore { public: AutoContextRestore(); ~AutoContextRestore(); private: Context fOldContext; GLint fOldWidth; GLint fOldHeight; GLint fOldFormat; void* fOldImage; }; protected: virtual const GrGLInterface* createGLContext() SK_OVERRIDE; virtual void destroyGLContext() SK_OVERRIDE; private: Context fContext; GrGLubyte *fImage; }; #endif #endif
/* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkMesaGLContext_DEFINED #define SkMesaGLContext_DEFINED #include "SkGLContext.h" #if SK_MESA class SkMesaGLContext : public SkGLContext { private: typedef intptr_t Context; public: SkMesaGLContext(); virtual ~SkMesaGLContext(); virtual void makeCurrent() const SK_OVERRIDE; class AutoContextRestore { public: AutoContextRestore(); ~AutoContextRestore(); private: Context fOldContext; GrGLint fOldWidth; GrGLint fOldHeight; GrGLint fOldFormat; void* fOldImage; }; protected: virtual const GrGLInterface* createGLContext() SK_OVERRIDE; virtual void destroyGLContext() SK_OVERRIDE; private: Context fContext; GrGLubyte *fImage; }; #endif #endif
Fix undefined GLint in Mac builds
Fix undefined GLint in Mac builds
C
bsd-3-clause
csulmone/skia,csulmone/skia,csulmone/skia,csulmone/skia
8dafd5d540a8ed88465f6fdb32ebb219e2f82cd0
common/src/models/models.h
common/src/models/models.h
/* * Copyright 2021 The CFU-Playground Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _MODELS_H #define _MODELS_H #ifdef __cplusplus extern "C" { #endif // For integration into menu system void models_menu(); #ifdef __cplusplus } #endif #endif // _MODELS_H
/* * Copyright 2021 The CFU-Playground Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _MODELS_H #define _MODELS_H #ifdef __cplusplus extern "C" { #endif // For integration into menu system void models_menu(); void no_menu(); #ifdef __cplusplus } #endif #endif // _MODELS_H
Add prototype to header file for compilation to succeed if no TFLM model included in Makefile
Add prototype to header file for compilation to succeed if no TFLM model included in Makefile Signed-off-by: ShvetankPrakash <1a565be4c7f481ed31060d5d811c95b3207c5b09@g.harvard.edu>
C
apache-2.0
google/CFU-Playground,google/CFU-Playground,google/CFU-Playground,google/CFU-Playground
2a24065dbbe6b88c21da66f588b913e5f3b403fa
test/Preprocessor/print_line_empty_file.c
test/Preprocessor/print_line_empty_file.c
// RUN: %clang -E %s | FileCheck %s #line 21 "" int foo() { return 42; } #line 4 "bug.c" int bar() { return 21; } // CHECK: # 21 "" // CHECK: int foo() { return 42; } // CHECK: # 4 "bug.c" // CHECK: int bar() { return 21; }
// RUN: %clang_cc1 -E %s | FileCheck %s #line 21 "" int foo() { return 42; } #line 4 "bug.c" int bar() { return 21; } // CHECK: # 21 "" // CHECK: int foo() { return 42; } // CHECK: # 4 "bug.c" // CHECK: int bar() { return 21; }
Fix this test to use -cc1.
Fix this test to use -cc1. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@114156 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/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,apple/swift-clang,apple/swift-clang
140311ab999dda019075b9f86661ebd51e0a144f
src/include/elektraprivate.h
src/include/elektraprivate.h
/** * @file * * @brief Private declarations. * * @copyright BSD License (see doc/LICENSE.md or http://www.libelektra.org) */ #ifndef ELEKTRAPRIVATE_H #define ELEKTRAPRIVATE_H #include "kdb.h" struct _ElektraError { int errorNr; const char * msg; }; struct _Elektra { KDB * kdb; KeySet * config; Key * parentKey; struct _ElektraError * error; }; #endif //ELEKTRAPRIVATE_H
/** * @file * * @brief Private declarations. * * @copyright BSD License (see doc/LICENSE.md or http://www.libelektra.org) */ #ifndef ELEKTRAPRIVATE_H #define ELEKTRAPRIVATE_H #include "kdb.h" struct _ElektraError { int errorNr; const char * msg; }; struct _Elektra { KDB * kdb; KeySet * config; Key * parentKey; }; #endif //ELEKTRAPRIVATE_H
Remove error from Elektra struct
Remove error from Elektra struct
C
bsd-3-clause
mpranj/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,petermax2/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,mpranj/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,petermax2/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,BernhardDenner/libelektra,mpranj/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,petermax2/libelektra,mpranj/libelektra,petermax2/libelektra,mpranj/libelektra,mpranj/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,mpranj/libelektra,mpranj/libelektra,BernhardDenner/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra
de03609158f5e3d774bd519cfdd2a1de04854fa6
newbase/NFmiDictionaryFunction.h
newbase/NFmiDictionaryFunction.h
/*! NFmiDictionaryFunction.h * Tämä on Editorin käyttämä sana kirja funktio. * Kieli versiot stringeihin tulevat täältä. */ #ifndef NFMIDICTIONARYFUNCTION_H #define NFMIDICTIONARYFUNCTION_H #include <NFmiSettings.h> // HUOM! Tämä on kopio NFmiEditMapGeneralDataDoc-luokan metodista, kun en voinut antaa tänne // dokumenttia std::string GetDictionaryString(const char *theMagicWord); #endif
/*! NFmiDictionaryFunction.h * Tämä on Editorin käyttämä sana kirja funktio. * Kieli versiot stringeihin tulevat täältä. */ #ifndef NFMIDICTIONARYFUNCTION_H #define NFMIDICTIONARYFUNCTION_H #include "NFmiSettings.h" // HUOM! Tämä on kopio NFmiEditMapGeneralDataDoc-luokan metodista, kun en voinut antaa tänne // dokumenttia std::string GetDictionaryString(const char *theMagicWord); #endif
Use "" instead of <> for local includes
Use "" instead of <> for local includes
C
mit
fmidev/smartmet-library-newbase,fmidev/smartmet-library-newbase
266393a705ce2b6db982a4bd048bb536ec556a85
include/extensions.h
include/extensions.h
#ifndef _SWAY_EXTENSIONS_H #define _SWAY_EXTENSIONS_H #include <wayland-server-core.h> #include <wlc/wlc-wayland.h> #include "wayland-desktop-shell-server-protocol.h" #include "list.h" struct background_config { wlc_handle output; wlc_resource surface; struct wl_resource *resource; }; struct panel_config { wlc_handle output; wlc_resource surface; struct wl_resource *resource; }; struct desktop_shell_state { list_t *backgrounds; list_t *panels; enum desktop_shell_panel_position panel_position; struct wlc_size panel_size; }; struct swaylock_state { bool active; wlc_handle output; wlc_resource surface; }; extern struct desktop_shell_state desktop_shell; void register_extensions(void); #endif
#ifndef _SWAY_EXTENSIONS_H #define _SWAY_EXTENSIONS_H #include <wayland-server.h> #include <wlc/wlc-wayland.h> #include "wayland-desktop-shell-server-protocol.h" #include "list.h" struct background_config { wlc_handle output; wlc_resource surface; struct wl_resource *resource; }; struct panel_config { wlc_handle output; wlc_resource surface; struct wl_resource *resource; }; struct desktop_shell_state { list_t *backgrounds; list_t *panels; enum desktop_shell_panel_position panel_position; struct wlc_size panel_size; }; struct swaylock_state { bool active; wlc_handle output; wlc_resource surface; }; extern struct desktop_shell_state desktop_shell; void register_extensions(void); #endif
Include wayland-server.h instead of -core.h
Include wayland-server.h instead of -core.h
C
mit
1ace/sway,1ace/sway,sleep-walker/sway,colemickens/sway,colemickens/sway,colemickens/sway,4e554c4c/sway,crondog/sway,ascent12/sway,4e554c4c/sway,ptMuta/sway,taiyu-len/sway,ascent12/sway,taiyu-len/sway,mikkeloscar/sway,mikkeloscar/sway,SirCmpwn/sway,taiyu-len/sway,crondog/sway,johalun/sway,ascent12/sway,1ace/sway,sleep-walker/sway
f97be484d675f92b852a7f7d72fcfd13a9f166dd
mlpack/trunk/src/mlpack/core.h
mlpack/trunk/src/mlpack/core.h
/*** * @file mlpack_core.h * * Include all of the base components required to write MLPACK methods. */ #ifndef __MLPACK_CORE_H #define __MLPACK_CORE_H // First, standard includes. #include <stdlib.h> #include <stdio.h> #include <string.h> #include <ctype.h> #include <cmath> #include <math.h> #include <limits.h> #include <float.h> #include <stdint.h> #include <iostream> // And then the Armadillo library. #include <armadillo> // Now MLPACK-specific includes. #include <mlpack/core/data/dataset.h> #include <mlpack/core/math/math_lib.h> #include <mlpack/core/math/range.h> #include <mlpack/core/math/kernel.h> #include <mlpack/core/file/textfile.h> #include <mlpack/core/io/io.h> #include <mlpack/core/arma_extend/arma_extend.h> #endif
/*** * @file mlpack_core.h * * Include all of the base components required to write MLPACK methods. */ #ifndef __MLPACK_CORE_H #define __MLPACK_CORE_H // First, standard includes. #include <stdlib.h> #include <stdio.h> #include <string.h> #include <ctype.h> #include <limits.h> #include <float.h> #include <stdint.h> #include <iostream> // Defining __USE_MATH_DEFINES should set M_PI. #define _USE_MATH_DEFINES #include <math.h> // But if it's not defined, we'll do it. #ifndef M_PI #define M_PI 3.141592653589793238462643383279 #endif // And then the Armadillo library. #include <armadillo> // Now MLPACK-specific includes. #include <mlpack/core/data/dataset.h> #include <mlpack/core/math/math_lib.h> #include <mlpack/core/math/range.h> #include <mlpack/core/math/kernel.h> #include <mlpack/core/file/textfile.h> #include <mlpack/core/io/io.h> #include <mlpack/core/arma_extend/arma_extend.h> #endif
Make sure we include M_PI, and if the system does not define it for us, we'll give it our best shot.
Make sure we include M_PI, and if the system does not define it for us, we'll give it our best shot.
C
bsd-3-clause
darcyliu/mlpack,minhpqn/mlpack,bmswgnp/mlpack,trungda/mlpack,BookChan/mlpack,ajjl/mlpack,lezorich/mlpack,ersanliqiao/mlpack,palashahuja/mlpack,stereomatchingkiss/mlpack,datachand/mlpack,erubboli/mlpack,theranger/mlpack,datachand/mlpack,bmswgnp/mlpack,erubboli/mlpack,thirdwing/mlpack,theranger/mlpack,ajjl/mlpack,BookChan/mlpack,lezorich/mlpack,darcyliu/mlpack,palashahuja/mlpack,palashahuja/mlpack,erubboli/mlpack,Azizou/mlpack,ranjan1990/mlpack,Azizou/mlpack,trungda/mlpack,ersanliqiao/mlpack,thirdwing/mlpack,darcyliu/mlpack,minhpqn/mlpack,minhpqn/mlpack,ajjl/mlpack,ranjan1990/mlpack,thirdwing/mlpack,stereomatchingkiss/mlpack,bmswgnp/mlpack,BookChan/mlpack,stereomatchingkiss/mlpack,lezorich/mlpack,datachand/mlpack,chenmoshushi/mlpack,Azizou/mlpack,trungda/mlpack,ersanliqiao/mlpack,ranjan1990/mlpack,chenmoshushi/mlpack,theranger/mlpack,chenmoshushi/mlpack
eab972c985f5abcf7f8ec3ebd155532f2e9e5f62
include/intellibot.h
include/intellibot.h
#if !defined(_INTELLIBOT_H) #define _INTELLIBOT_H #include <sys/types.h> #include <time.h> #include "queue.h" #include "sock.h" struct _intellibot; struct _server; struct _plugin; struct _plugin_ctx; struct _queue; #define SOCK_FLAG_DISCONNECTED 0 #define SOCK_FLAG_CONNECTED 1 #define SOCK_FLAG_REGISTERED 2 typedef struct _server { SOCK *sock; struct _server *prev, *next; } SERVER; typedef struct _plugin_ctx { struct _plugin *plugin; struct _intellibot *bot; void *ctx; } PLUGIN_CTX; typedef struct _plugin { void *handle; void *ctx; QUEUE *queue; struct _plugin *prev, *next; } PLUGIN; typedef struct _intellibot { PLUGIN *plugins; SERVER *servers; } INTELLIBOT; #endif
#if !defined(_INTELLIBOT_H) #define _INTELLIBOT_H #include <sys/types.h> #include <time.h> #include "queue.h" #include "sock.h" struct _intellibot; struct _server; struct _plugin; struct _plugin_ctx; struct _queue; #define SOCK_FLAG_DISCONNECTED 0 #define SOCK_FLAG_CONNECTED 1 #define SOCK_FLAG_REGISTERED 2 typedef struct _server { SOCK *sock; struct _server *prev, *next; } SERVER; typedef struct _plugin_ctx { struct _plugin *plugin; struct _intellibot *bot; void *ctx; } PLUGIN_CTX; #define SUBSCRIPTION_JOIN 0x00000001 #define SUBSCRIPTION_PART 0x00000002 #define SUBSCRIPTION_CONNECT 0x00000004 #define SUBSCRIPTION_DISCONNECT 0x00000008 #define SUBSCRIPTION_PRIVMSG 0x00000010 typedef struct _plugin { pthread_t tid; void *handle; void *ctx; unsigned int subscriptions; QUEUE *queue; int (*run)(struct _plugin *, char *); struct _plugin *prev, *next; } PLUGIN; typedef struct _intellibot { PLUGIN *plugins; SERVER *servers; } INTELLIBOT; #endif
Add fields to the plugin struct
Add fields to the plugin struct
C
bsd-2-clause
lattera/intellibot
278ef644709f6e05938be329941e4cc2207dae41
hab/proxr/poll-arduino.c
hab/proxr/poll-arduino.c
#include "sim-hab.h" #include <stdlib.h> int poll_arduino() { char response[256]; uint32_t content; bionet_resource_t *res; bionet_node_t *node; node = bionet_hab_get_node_by_index(hab, 0); // send command 100. requests analog0's value // read value and set resource arduino_write(100); arduino_read_until(response, '\n'); content = atoi(response); res = bionet_node_get_resource_by_index(node, 24); bionet_resource_set_uint32(res, content, NULL); // send command 101. requests analog1's value // read value and set resource arduino_write(101); arduino_read_until(response, '\n'); content = atoi(response); res = bionet_node_get_resource_by_index(node, 25); bionet_resource_set_uint32(res, content, NULL); // testing arduino_write(200); arduino_read_until(response, '\n'); content = atoi(response); printf("digital 0: %d\n", content); // report new data hab_report_datapoints(node); return 1; }
#include "sim-hab.h" #include <stdlib.h> int poll_arduino() { char response[256]; uint32_t content; bionet_resource_t *res; bionet_node_t *node; node = bionet_hab_get_node_by_index(hab, 0); // send command 100. requests analog0's value // read value and set resource arduino_write(100); arduino_read_until(response, '\n'); content = atoi(response); res = bionet_node_get_resource_by_index(node, 24); bionet_resource_set_uint32(res, content, NULL); // send command 101. requests analog1's value // read value and set resource arduino_write(101); arduino_read_until(response, '\n'); content = atoi(response); res = bionet_node_get_resource_by_index(node, 25); bionet_resource_set_uint32(res, content, NULL); // send command 200. requests the 8 digital values // read values and set resource arduino_write(200); arduino_read_until(response, '\n'); for(int i=0; i<8; i++) { content = atoi(&response[i]); res = bionet_node_get_resource_by_index(node, 16+i); bionet_resource_set_binary(res, content, NULL); } // report new data hab_report_datapoints(node); return 1; }
Modify sim-hab so that the digital inputs are accounted for.
Modify sim-hab so that the digital inputs are accounted for.
C
lgpl-2.1
ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead
da939c53dac50093fc1227010652ab0560f08b45
net/socket/ssl_client_socket.h
net/socket/ssl_client_socket.h
// Copyright (c) 2006-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 NET_SOCKET_SSL_CLIENT_SOCKET_H_ #define NET_SOCKET_SSL_CLIENT_SOCKET_H_ #include "net/socket/client_socket.h" namespace net { class SSLCertRequestInfo; class SSLInfo; // A client socket that uses SSL as the transport layer. // // NOTE: The SSL handshake occurs within the Connect method after a TCP // connection is established. If a SSL error occurs during the handshake, // Connect will fail. // class SSLClientSocket : public ClientSocket { public: // Gets the SSL connection information of the socket. virtual void GetSSLInfo(SSLInfo* ssl_info) = 0; // Gets the SSL CertificateRequest info of the socket after Connect failed // with ERR_SSL_CLIENT_AUTH_CERT_NEEDED. virtual void GetSSLCertRequestInfo( SSLCertRequestInfo* cert_request_info) = 0; }; } // namespace net #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_
// Copyright (c) 2006-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 NET_SOCKET_SSL_CLIENT_SOCKET_H_ #define NET_SOCKET_SSL_CLIENT_SOCKET_H_ #include "net/socket/client_socket.h" namespace net { class SSLCertRequestInfo; class SSLInfo; // A client socket that uses SSL as the transport layer. // // NOTE: The SSL handshake occurs within the Connect method after a TCP // connection is established. If a SSL error occurs during the handshake, // Connect will fail. // class SSLClientSocket : public ClientSocket { public: // Next Protocol Negotiation (NPN), if successful, results in agreement on an // application-level string that specifies the application level protocol to // use over the TLS connection. NextProto enumerates the application level // protocols that we recognise. enum NextProto { kProtoUnknown = 0, kProtoHTTP11 = 1, kProtoSPDY = 2, }; // Gets the SSL connection information of the socket. virtual void GetSSLInfo(SSLInfo* ssl_info) = 0; // Gets the SSL CertificateRequest info of the socket after Connect failed // with ERR_SSL_CLIENT_AUTH_CERT_NEEDED. virtual void GetSSLCertRequestInfo( SSLCertRequestInfo* cert_request_info) = 0; static NextProto NextProtoFromString(const std::string& proto_string) { if (proto_string == "http1.1") { return kProtoHTTP11; } else if (proto_string == "spdy") { return kProtoSPDY; } else { return kProtoUnknown; } } }; } // namespace net #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_
Add static function to convert NPN strings to an enum.
Add static function to convert NPN strings to an enum. http://codereview.chromium.org/487012 git-svn-id: http://src.chromium.org/svn/trunk/src@34287 4ff67af0-8c30-449e-8e8b-ad334ec8d88c Former-commit-id: 2a63eef748fa1910eddb0b772eb24344e6705fdc
C
bsd-3-clause
meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser
a58c131cca2faedf386aa57b7f68b0ab0dd4f6b8
SmartDeviceLink-iOS/SmartDeviceLink/SDLAbstractProtocol.h
SmartDeviceLink-iOS/SmartDeviceLink/SDLAbstractProtocol.h
// SDLAbstractProtocol.h // @class SDLAbstractTransport; @class SDLRPCMessage; @class SDLRPCRequest; #import "SDLProtocolListener.h" #import "SDLTransportDelegate.h" @interface SDLAbstractProtocol : NSObject <SDLTransportDelegate> @property (strong) NSString *debugConsoleGroupName; @property (weak) SDLAbstractTransport *transport; @property (weak) NSHashTable *protocolDelegateTable; // table of id<SDLProtocolListener> // Sending - (void)sendStartSessionWithType:(SDLServiceType)serviceType; - (void)sendEndSessionWithType:(SDLServiceType)serviceType; - (void)sendRPC:(SDLRPCMessage *)message; - (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest __deprecated_msg(("Use sendRPC: instead")); - (void)sendHeartbeat; - (void)sendRawDataStream:(NSInputStream *)inputStream withServiceType:(SDLServiceType)serviceType; - (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType; // Recieving - (void)handleBytesFromTransport:(NSData *)receivedData; - (void)dispose; @end
// SDLAbstractProtocol.h // @class SDLAbstractTransport; @class SDLRPCMessage; @class SDLRPCRequest; #import "SDLProtocolListener.h" #import "SDLTransportDelegate.h" @interface SDLAbstractProtocol : NSObject <SDLTransportDelegate> @property (strong) NSString *debugConsoleGroupName; @property (weak) SDLAbstractTransport *transport; @property (strong) NSHashTable *protocolDelegateTable; // table of id<SDLProtocolListener> // Sending - (void)sendStartSessionWithType:(SDLServiceType)serviceType; - (void)sendEndSessionWithType:(SDLServiceType)serviceType; - (void)sendRPC:(SDLRPCMessage *)message; - (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest __deprecated_msg(("Use sendRPC: instead")); - (void)sendHeartbeat; - (void)sendRawDataStream:(NSInputStream *)inputStream withServiceType:(SDLServiceType)serviceType; - (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType; // Recieving - (void)handleBytesFromTransport:(NSData *)receivedData; - (void)dispose; @end
Fix SDLProtocol delegate table being released too early
Fix SDLProtocol delegate table being released too early
C
bsd-3-clause
FordDev/sdl_ios,APCVSRepo/sdl_ios,smartdevicelink/sdl_ios,adein/sdl_ios,kshala-ford/sdl_ios,kshala-ford/sdl_ios,smartdevicelink/sdl_ios,FordDev/sdl_ios,APCVSRepo/sdl_ios,kshala-ford/sdl_ios,APCVSRepo/sdl_ios,davidswi/sdl_ios,kshala-ford/sdl_ios,davidswi/sdl_ios,APCVSRepo/sdl_ios,FordDev/sdl_ios,FordDev/sdl_ios,smartdevicelink/sdl_ios,adein/sdl_ios,smartdevicelink/sdl_ios,kshala-ford/sdl_ios,davidswi/sdl_ios,davidswi/sdl_ios,APCVSRepo/sdl_ios,FordDev/sdl_ios,davidswi/sdl_ios,smartdevicelink/sdl_ios
77e2e9b890807560b3db5f1e277c7445cc5d74dd
lib/kernel/test/os_SUITE_data/my_echo.c
lib/kernel/test/os_SUITE_data/my_echo.c
#ifdef __WIN32__ #include <windows.h> int wmain(int argc, wchar_t **argv) { char* sep = ""; int len; /* * Echo all arguments separated with '::', so that we can check that * quotes are interpreted correctly. */ while (argc-- > 1) { char *utf8; len = WideCharToMultiByte(CP_UTF8, 0, argv[1], -1, NULL, 0, NULL, NULL); utf8 = malloc(len*sizeof(char)); WideCharToMultiByte(CP_UTF8, 0, argv++[1], -1, utf8, len, NULL, NULL); printf("%s%s", sep, utf8); free(utf8); sep = "::"; } putchar('\n'); return 0; } #else #include <stdio.h> int main(int argc, char** argv) { char* sep = ""; /* * Echo all arguments separated with '::', so that we can check that * quotes are interpreted correctly. */ while (argc-- > 1) { printf("%s%s", sep, argv++[1]); sep = "::"; } putchar('\n'); return 0; } #endif
#include <stdio.h> #ifdef __WIN32__ #include <windows.h> int wmain(int argc, wchar_t **argv) { char* sep = ""; int len; /* * Echo all arguments separated with '::', so that we can check that * quotes are interpreted correctly. */ while (argc-- > 1) { char *utf8; len = WideCharToMultiByte(CP_UTF8, 0, argv[1], -1, NULL, 0, NULL, NULL); utf8 = malloc(len*sizeof(char)); WideCharToMultiByte(CP_UTF8, 0, argv++[1], -1, utf8, len, NULL, NULL); printf("%s%s", sep, utf8); free(utf8); sep = "::"; } putchar('\n'); return 0; } #else int main(int argc, char** argv) { char* sep = ""; /* * Echo all arguments separated with '::', so that we can check that * quotes are interpreted correctly. */ while (argc-- > 1) { printf("%s%s", sep, argv++[1]); sep = "::"; } putchar('\n'); return 0; } #endif
Fix os_SUITE compilation issue on win32
kernel: Fix os_SUITE compilation issue on win32
C
apache-2.0
rlipscombe/otp,bjorng/otp,dgud/otp,isvilen/otp,emacsmirror/erlang,bjorng/otp,g-andrade/otp,getong/otp,dgud/otp,isvilen/otp,potatosalad/otp,vinoski/otp,g-andrade/otp,jj1bdx/otp,emacsmirror/erlang,mikpe/otp,erlang/otp,lrascao/otp,erlang/otp,potatosalad/otp,getong/otp,rlipscombe/otp,emacsmirror/erlang,vinoski/otp,uabboli/otp,erlang/otp,rlipscombe/otp,mikpe/otp,ferd/otp,getong/otp,dumbbell/otp,vinoski/otp,dgud/otp,bjorng/otp,getong/otp,isvilen/otp,ferd/otp,potatosalad/otp,lrascao/otp,lrascao/otp,uabboli/otp,potatosalad/otp,potatosalad/otp,isvilen/otp,jj1bdx/otp,ferd/otp,mikpe/otp,dumbbell/otp,erlang/otp,rlipscombe/otp,jj1bdx/otp,ferd/otp,dumbbell/otp,mikpe/otp,g-andrade/otp,lrascao/otp,uabboli/otp,isvilen/otp,uabboli/otp,getong/otp,rlipscombe/otp,lrascao/otp,lrascao/otp,isvilen/otp,dgud/otp,potatosalad/otp,emacsmirror/erlang,dgud/otp,rlipscombe/otp,vinoski/otp,potatosalad/otp,lrascao/otp,getong/otp,bjorng/otp,dumbbell/otp,vinoski/otp,dgud/otp,dumbbell/otp,bjorng/otp,erlang/otp,mikpe/otp,g-andrade/otp,emacsmirror/erlang,rlipscombe/otp,isvilen/otp,mikpe/otp,g-andrade/otp,potatosalad/otp,dgud/otp,rlipscombe/otp,isvilen/otp,vinoski/otp,mikpe/otp,dgud/otp,uabboli/otp,vinoski/otp,vinoski/otp,jj1bdx/otp,g-andrade/otp,g-andrade/otp,uabboli/otp,dumbbell/otp,emacsmirror/erlang,bjorng/otp,ferd/otp,emacsmirror/erlang,uabboli/otp,dgud/otp,ferd/otp,mikpe/otp,uabboli/otp,g-andrade/otp,mikpe/otp,bjorng/otp,dumbbell/otp,dumbbell/otp,vinoski/otp,jj1bdx/otp,rlipscombe/otp,bjorng/otp,lrascao/otp,jj1bdx/otp,jj1bdx/otp,g-andrade/otp,emacsmirror/erlang,isvilen/otp,getong/otp,isvilen/otp,lrascao/otp,dumbbell/otp,erlang/otp,erlang/otp,bjorng/otp,jj1bdx/otp,ferd/otp,uabboli/otp,emacsmirror/erlang,jj1bdx/otp,getong/otp,potatosalad/otp,erlang/otp,potatosalad/otp,erlang/otp,mikpe/otp,vinoski/otp,getong/otp,bjorng/otp,ferd/otp,dgud/otp,erlang/otp,emacsmirror/erlang,g-andrade/otp,rlipscombe/otp,getong/otp,ferd/otp,dumbbell/otp,jj1bdx/otp
48a000c2d136e1571a0732006b2bec2538a117a2
SSPSolution/SSPSolution/ComponentHandler.h
SSPSolution/SSPSolution/ComponentHandler.h
#ifndef SSPAPPLICATION_COMPONENTHANDLER_H #define SSPAPPLICATION_COMPONENTHANDLER_H #include "../GraphicsDLL/GraphicsHandler.h" //#include "ComponentStructs.h" #include "../GraphicsDLL/GraphicsHandler.h" #include "../physicsDLL/PhysicsHandler.h" #include "../AIDLL/AIHandler.h" class ComponentHandler { private: GraphicsHandler* m_graphicsHandler; PhysicsHandler* m_physicsHandler; AIHandler* m_aiHandler; public: ComponentHandler(); ~ComponentHandler(); //Returns 0 if the graphicsHandler or physicshandler is a nullptr int Initialize(GraphicsHandler* graphicsHandler, PhysicsHandler* physicsHandler, AIHandler* aiHandler); GraphicsComponent* GetGraphicsComponent(); PhysicsComponent* GetPhysicsComponent(); void UpdateGraphicsComponents(); void SetGraphicsComponentListSize(int gCompSize); //temporary function PhysicsHandler* GetPhysicsHandler() const; }; #endif
#ifndef SSPAPPLICATION_COMPONENTHANDLER_H #define SSPAPPLICATION_COMPONENTHANDLER_H //#include "ComponentStructs.h" #include "../GraphicsDLL/GraphicsHandler.h" #include "../physicsDLL/PhysicsHandler.h" #include "../AIDLL/AIHandler.h" class ComponentHandler { private: GraphicsHandler* m_graphicsHandler; PhysicsHandler* m_physicsHandler; AIHandler* m_aiHandler; public: ComponentHandler(); ~ComponentHandler(); //Returns 0 if the graphicsHandler or physicshandler is a nullptr int Initialize(GraphicsHandler* graphicsHandler, PhysicsHandler* physicsHandler, AIHandler* aiHandler); GraphicsComponent* GetGraphicsComponent(); PhysicsComponent* GetPhysicsComponent(); void UpdateGraphicsComponents(); void SetGraphicsComponentListSize(int gCompSize); //temporary function PhysicsHandler* GetPhysicsHandler() const; }; #endif
FIX duplicate includes of GraphicsHandler
FIX duplicate includes of GraphicsHandler
C
apache-2.0
Chringo/SSP,Chringo/SSP
ef460ae7e5836154d5e8e811af87491126de5487
src/host/string_hash.c
src/host/string_hash.c
/** * \file string_hash.c * \brief Computes a hash value for a string. * \author Copyright (c) 2012-2014 Jason Perkins and the Premake project */ #include "premake.h" #include <string.h> int string_hash(lua_State* L) { const char* str = luaL_checkstring(L, 1); unsigned long seed = luaL_optint(L, 2, 0); lua_pushnumber(L, do_hash(str, seed)); return 1; } unsigned long do_hash(const char* str, int seed) { /* DJB2 hashing; see http://www.cse.yorku.ca/~oz/hash.html */ unsigned long hash = 5381; if (seed != 0) { hash = hash * 33 + seed; } while (*str) { hash = hash * 33 + (*str); str++; } return hash; }
/** * \file string_hash.c * \brief Computes a hash value for a string. * \author Copyright (c) 2012-2014 Jason Perkins and the Premake project */ #include "premake.h" #include <string.h> int string_hash(lua_State* L) { const char* str = luaL_checkstring(L, 1); unsigned long seed = luaL_optint(L, 2, 0); lua_pushnumber(L, (lua_Number)do_hash(str, seed)); return 1; } unsigned long do_hash(const char* str, int seed) { /* DJB2 hashing; see http://www.cse.yorku.ca/~oz/hash.html */ unsigned long hash = 5381; if (seed != 0) { hash = hash * 33 + seed; } while (*str) { hash = hash * 33 + (*str); str++; } return hash; }
Fix implicit conversion warning when building with floating point Lua
Fix implicit conversion warning when building with floating point Lua
C
bsd-3-clause
bravnsgaard/premake-core,noresources/premake-core,starkos/premake-core,noresources/premake-core,premake/premake-core,tvandijck/premake-core,Yhgenomics/premake-core,felipeprov/premake-core,jstewart-amd/premake-core,Meoo/premake-core,TurkeyMan/premake-core,martin-traverse/premake-core,jstewart-amd/premake-core,jstewart-amd/premake-core,noresources/premake-core,grbd/premake-core,felipeprov/premake-core,dcourtois/premake-core,Zefiros-Software/premake-core,TurkeyMan/premake-core,CodeAnxiety/premake-core,jsfdez/premake-core,kankaristo/premake-core,mandersan/premake-core,PlexChat/premake-core,xriss/premake-core,aleksijuvani/premake-core,sleepingwit/premake-core,Zefiros-Software/premake-core,prapin/premake-core,noresources/premake-core,dcourtois/premake-core,mendsley/premake-core,kankaristo/premake-core,xriss/premake-core,lizh06/premake-core,Blizzard/premake-core,starkos/premake-core,Blizzard/premake-core,saberhawk/premake-core,resetnow/premake-core,felipeprov/premake-core,premake/premake-core,noresources/premake-core,LORgames/premake-core,soundsrc/premake-core,felipeprov/premake-core,martin-traverse/premake-core,Meoo/premake-core,jstewart-amd/premake-core,martin-traverse/premake-core,Blizzard/premake-core,dcourtois/premake-core,martin-traverse/premake-core,lizh06/premake-core,Yhgenomics/premake-core,TurkeyMan/premake-core,PlexChat/premake-core,aleksijuvani/premake-core,Tiger66639/premake-core,starkos/premake-core,tritao/premake-core,resetnow/premake-core,premake/premake-core,alarouche/premake-core,jstewart-amd/premake-core,Meoo/premake-core,tritao/premake-core,LORgames/premake-core,xriss/premake-core,tvandijck/premake-core,alarouche/premake-core,akaStiX/premake-core,tritao/premake-core,soundsrc/premake-core,Tiger66639/premake-core,sleepingwit/premake-core,saberhawk/premake-core,akaStiX/premake-core,alarouche/premake-core,aleksijuvani/premake-core,grbd/premake-core,starkos/premake-core,LORgames/premake-core,LORgames/premake-core,sleepingwit/premake-core,mendsley/premake-core,xriss/premake-core,premake/premake-core,aleksijuvani/premake-core,lizh06/premake-core,akaStiX/premake-core,resetnow/premake-core,lizh06/premake-core,Tiger66639/premake-core,tritao/premake-core,CodeAnxiety/premake-core,mendsley/premake-core,bravnsgaard/premake-core,CodeAnxiety/premake-core,kankaristo/premake-core,tvandijck/premake-core,Blizzard/premake-core,dcourtois/premake-core,mandersan/premake-core,Yhgenomics/premake-core,PlexChat/premake-core,prapin/premake-core,CodeAnxiety/premake-core,bravnsgaard/premake-core,grbd/premake-core,noresources/premake-core,prapin/premake-core,LORgames/premake-core,premake/premake-core,tvandijck/premake-core,mandersan/premake-core,premake/premake-core,CodeAnxiety/premake-core,saberhawk/premake-core,jsfdez/premake-core,Zefiros-Software/premake-core,akaStiX/premake-core,noresources/premake-core,saberhawk/premake-core,dcourtois/premake-core,soundsrc/premake-core,soundsrc/premake-core,starkos/premake-core,Blizzard/premake-core,dcourtois/premake-core,aleksijuvani/premake-core,grbd/premake-core,soundsrc/premake-core,tvandijck/premake-core,PlexChat/premake-core,resetnow/premake-core,Blizzard/premake-core,TurkeyMan/premake-core,Meoo/premake-core,premake/premake-core,prapin/premake-core,alarouche/premake-core,Zefiros-Software/premake-core,TurkeyMan/premake-core,xriss/premake-core,mandersan/premake-core,starkos/premake-core,starkos/premake-core,sleepingwit/premake-core,bravnsgaard/premake-core,dcourtois/premake-core,resetnow/premake-core,Zefiros-Software/premake-core,bravnsgaard/premake-core,kankaristo/premake-core,sleepingwit/premake-core,mendsley/premake-core,mandersan/premake-core,jsfdez/premake-core,Tiger66639/premake-core,jsfdez/premake-core,Yhgenomics/premake-core,mendsley/premake-core
972adb833389607a84e879e2df565e37451d4c60
test/CodeGen/arm_asm_clobber.c
test/CodeGen/arm_asm_clobber.c
// RUN: clang -ccc-host-triple armv6-unknown-unknown -emit-llvm -S -o %t %s void test0(void) { asm volatile("mov r0, r0" :: ); } void test1(void) { asm volatile("mov r0, r0" ::: "cc", "memory" ); } void test2(void) { asm volatile("mov r0, r0" ::: "r0", "r1", "r2", "r3"); asm volatile("mov r0, r0" ::: "r4", "r5", "r6", "r8"); } void test3(void) { asm volatile("mov r0, r0" ::: "a1", "a2", "a3", "a4"); asm volatile("mov r0, r0" ::: "v1", "v2", "v3", "v5"); }
// RUN: clang-cc -triple armv6-unknown-unknown -emit-llvm -o %t %s void test0(void) { asm volatile("mov r0, r0" :: ); } void test1(void) { asm volatile("mov r0, r0" ::: "cc", "memory" ); } void test2(void) { asm volatile("mov r0, r0" ::: "r0", "r1", "r2", "r3"); asm volatile("mov r0, r0" ::: "r4", "r5", "r6", "r8"); } void test3(void) { asm volatile("mov r0, r0" ::: "a1", "a2", "a3", "a4"); asm volatile("mov r0, r0" ::: "v1", "v2", "v3", "v5"); }
Use clang-cc in this test.
Use clang-cc in this test. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@90872 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
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,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang
d9e9a0a7122b881fd97b190ed615daf572731a2b
test/CodeGen/pragma-pack-1.c
test/CodeGen/pragma-pack-1.c
// RUN: %clang_cc1 -emit-llvm -o - %s // PR4610 #pragma pack(4) struct ref { struct ref *next; } refs;
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.7.0 -emit-llvm -o - %s | FileCheck %s // PR4610 #pragma pack(4) struct ref { struct ref *next; } refs; // PR13580 struct S { char a[3]; #pragma pack(1) struct T { char b; int c; } d; #pragma pack() struct T2 { char b; int c; } d2; } ss; // CHECK: [[struct_ref:%[a-zA-Z0-9_.]+]] = type <{ [[struct_ref]]* }> // CHECK: [[struct_S:%[a-zA-Z0-9_.]+]] = type { [3 x i8], [[struct_T:%[a-zA-Z0-9_.]+]], [[struct_T2:%[a-zA-Z0-9_.]+]] } // CHECK: [[struct_T]] = type <{ i8, i32 }> // CHECK: [[struct_T2]] = type { i8, i32 } // CHECK: @refs = common global [[struct_ref]] // CHECK: @ss = common global [[struct_S]]
Add IRGen test case for r179743.
Add IRGen test case for r179743. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@179777 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang
e695b928e43435d62ac2e4bc3133cbe6eae44bbe
include/api/ofp_odp_compat.h
include/api/ofp_odp_compat.h
/* Copyright (c) 2015, ENEA Software AB * Copyright (c) 2015, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #if ODP_VERSION < 105 typedef uint64_t odp_time_t; #endif /* ODP_VERSION < 105 */ #if ODP_VERSION < 104 && ODP_VERSION > 101 #define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_def_worker(cpumask, num_workers) #elif ODP_VERSION < 102 #define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_count(cpumask) #endif
/* Copyright (c) 2015, ENEA Software AB * Copyright (c) 2015, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #if ODP_VERSION < 105 typedef uint64_t odp_time_t; #endif /* ODP_VERSION < 105 */ #if ODP_VERSION < 104 && ODP_VERSION > 101 #define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_def_worker(cpumask, num_workers) #elif ODP_VERSION < 102 #define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_count(cpumask) #define ODP_THREAD_WORKER #define ODP_THREAD_CONTROL #endif
Define ODP_THREAD_WORKER and ODP_THREAD_CONTROL for odp versions < 102.
Define ODP_THREAD_WORKER and ODP_THREAD_CONTROL for odp versions < 102. Signed-off-by: José Pekkarinen <d7cb8761fb0e75b1a78c2fda4f1daed76cd46cfe@nokia.com> Reviewed-and-tested-by: Sorin Vultureanu <8013ba55f8675034bc2ab0d6c3a1c9650437ca36@enea.com>
C
bsd-3-clause
TolikH/ofp,OpenFastPath/ofp,TolikH/ofp,TolikH/ofp,OpenFastPath/ofp,OpenFastPath/ofp,OpenFastPath/ofp
d37719c942a0eaa9b50d3b6e8e2fa4e8a852eecc
nwn2mdk-lib/cgmath.h
nwn2mdk-lib/cgmath.h
#pragma once template <typename T> class Vector3 { public: T x, y, z; Vector3(T x, T y, T z) { this->x = x; this->y = y; this->z = z; } Vector3() : Vector3(0, 0, 0) { } T &operator[](unsigned i) { return (&x)[i]; } }; static_assert(sizeof(Vector3<float>) == 12); template <typename T> class Vector4 { public: T x, y, z, w; Vector4() {} Vector4(T x, T y, T z, T w) { this->x = x; this->y = y; this->z = z; this->w = w; } T &operator[](unsigned i) { return (&x)[i]; } };
#pragma once template <typename T> class Vector3 { public: T x, y, z; Vector3(T x, T y, T z) { this->x = x; this->y = y; this->z = z; } Vector3() : Vector3(0, 0, 0) { } T &operator[](unsigned i) { return (&x)[i]; } bool operator==(const Vector3 &v) const { return x == v.x && y == v.y && z == v.z; } }; static_assert(sizeof(Vector3<float>) == 12); template <typename T> class Vector4 { public: T x, y, z, w; Vector4() {} Vector4(T x, T y, T z, T w) { this->x = x; this->y = y; this->z = z; this->w = w; } T &operator[](unsigned i) { return (&x)[i]; } };
Add "equal to" operator to Vector3
Add "equal to" operator to Vector3
C
apache-2.0
Arbos/nwn2mdk,Arbos/nwn2mdk,Arbos/nwn2mdk
4aa666a35dc30b7b912ece51249e011a46feddd9
MicroReasoner/SMRPreprocessor.h
MicroReasoner/SMRPreprocessor.h
// // SMRPreprocessor.h // MicroReasoner // // Created by Ivano Bilenchi on 05/05/16. // Copyright © 2016 SisInf Lab. All rights reserved. // #ifndef SMRPreprocessor_h #define SMRPreprocessor_h // Pseudo-abstract class convenience macros. #define ABSTRACT_METHOD {\ @throw [NSException exceptionWithName:NSInternalInconsistencyException \ reason:@"This method should be overridden in a subclass." \ userInfo:nil]; \ } #endif /* SMRPreprocessor_h */
// // SMRPreprocessor.h // MicroReasoner // // Created by Ivano Bilenchi on 05/05/16. // Copyright © 2016 SisInf Lab. All rights reserved. // #ifndef SMRPreprocessor_h #define SMRPreprocessor_h /** * Use this directive to mark method implementations that should be overridden * by concrete subclasses. */ #define ABSTRACT_METHOD {\ @throw [NSException exceptionWithName:NSInternalInconsistencyException \ reason:@"This method should be overridden in a subclass." \ userInfo:nil]; \ } /** * Use this directive in place of @synthesize to automatically create a * lazy getter for the specified property. Example syntax: * * SYNTHESIZE_LAZY(NSMutableString, myMutableString) { * return [NSMutableString stringWithString:@"my mutable string"]; * } * * @param type The type of the property. * @param name The name of the property. */ #define SYNTHESIZE_LAZY(type, name) \ @synthesize name = _##name; \ - (type *)name { \ if (_##name == nil) { _##name = [self __##name##LazyInit]; } \ return _##name; \ } \ - (type *)__##name##LazyInit /** * Use this directive in place of @synthesize to automatically create a * lazy getter for the specified property. The getter calls the default * 'init' constructor. * * @param type The type of the property. * @param name The name of the property. */ #define SYNTHESIZE_LAZY_INIT(type, name) \ @synthesize name = _##name; \ - (type *)name { \ if (_##name == nil) { _##name = [[type alloc] init]; } \ return _##name; \ } #endif /* SMRPreprocessor_h */
Add lazy property synthesis directives
Add lazy property synthesis directives
C
epl-1.0
sisinflab-swot/OWL-API-for-iOS,sisinflab-swot/OWL-API-for-iOS,sisinflab-swot/OWL-API-for-iOS
36db197d9cc6af1062902a1678caa6825eaa2e9f
Settings/Tabs/Tab.h
Settings/Tabs/Tab.h
#pragma once #include <Windows.h> #include <unordered_map> #include "../Controls/Control.h" #include "../Controls/Controls.h" class UIContext; #define INIT_CONTROL(ctrlId, ctrlType, var) { \ var = ctrlType(ctrlId, _hWnd); \ _controlMap[ctrlId] = &var; \ } /// <summary> /// Abstract class that encapsulates functionality for dealing with /// property sheet pages (tabs). /// </summary> class Tab { public: Tab(); ~Tab(); /// <summary>Processes messages sent to the tab page.</summary> virtual DLGPROC TabProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); /// <summary>Persists changes made on the tab page</summary> virtual void SaveSettings() = 0; protected: /// <summary>Window handle of this tab.</summary> HWND _hWnd; /// <summary>Maps control IDs to their respective instances.</summary> std::unordered_map<int, Control *> _controlMap; /// <summary> /// Performs intitialization for the tab page, similar to a constructor. /// Since tab page windows are created on demand, this method could be /// called much later than the constructor for the tab. /// </summary> virtual void Initialize() = 0; /// <summary>Applies the current settings state to the tab page.</summary> virtual void LoadSettings() = 0; };
#pragma once #include <Windows.h> #include <unordered_map> #include "../Controls/Control.h" #include "../Controls/Controls.h" #define INIT_CONTROL(ctrlId, ctrlType, var) { \ var = ctrlType(ctrlId, _hWnd); \ _controlMap[ctrlId] = &var; \ } /// <summary> /// Abstract class that encapsulates functionality for dealing with /// property sheet pages (tabs). /// </summary> class Tab { public: Tab(); ~Tab(); /// <summary>Processes messages sent to the tab page.</summary> virtual DLGPROC TabProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); /// <summary>Persists changes made on the tab page</summary> virtual void SaveSettings() = 0; protected: /// <summary>Window handle of this tab.</summary> HWND _hWnd; /// <summary>Maps control IDs to their respective instances.</summary> std::unordered_map<int, Control *> _controlMap; /// <summary> /// Performs intitialization for the tab page, similar to a constructor. /// Since tab page windows are created on demand, this method could be /// called much later than the constructor for the tab. /// </summary> virtual void Initialize() = 0; /// <summary>Applies the current settings state to the tab page.</summary> virtual void LoadSettings() = 0; };
Remove old UIContext class declaration
Remove old UIContext class declaration
C
bsd-2-clause
malensek/3RVX,malensek/3RVX,malensek/3RVX
37e51a20cc9f3ff9afebdabdcd3a82b9a08d3302
sway/commands/create_output.c
sway/commands/create_output.c
#include <wlr/backend/multi.h> #include <wlr/backend/wayland.h> #include <wlr/backend/x11.h> #include "sway/commands.h" #include "sway/server.h" #include "log.h" static void create_output(struct wlr_backend *backend, void *data) { bool *done = data; if (*done) { return; } if (wlr_backend_is_wl(backend)) { wlr_wl_output_create(backend); *done = true; } else if (wlr_backend_is_x11(backend)) { wlr_x11_output_create(backend); *done = true; } } /** * This command is intended for developer use only. */ struct cmd_results *cmd_create_output(int argc, char **argv) { sway_assert(wlr_backend_is_multi(server.backend), "Expected a multi backend"); bool done = false; wlr_multi_for_each_backend(server.backend, create_output, &done); if (!done) { return cmd_results_new(CMD_INVALID, "create_output", "Can only create outputs for Wayland or X11 backends"); } return cmd_results_new(CMD_SUCCESS, NULL, NULL); }
#include <wlr/config.h> #include <wlr/backend/multi.h> #include <wlr/backend/wayland.h> #ifdef WLR_HAS_X11_BACKEND #include <wlr/backend/x11.h> #endif #include "sway/commands.h" #include "sway/server.h" #include "log.h" static void create_output(struct wlr_backend *backend, void *data) { bool *done = data; if (*done) { return; } if (wlr_backend_is_wl(backend)) { wlr_wl_output_create(backend); *done = true; } #ifdef WLR_HAS_X11_BACKEND else if (wlr_backend_is_x11(backend)) { wlr_x11_output_create(backend); *done = true; } #endif } /** * This command is intended for developer use only. */ struct cmd_results *cmd_create_output(int argc, char **argv) { sway_assert(wlr_backend_is_multi(server.backend), "Expected a multi backend"); bool done = false; wlr_multi_for_each_backend(server.backend, create_output, &done); if (!done) { return cmd_results_new(CMD_INVALID, "create_output", "Can only create outputs for Wayland or X11 backends"); } return cmd_results_new(CMD_SUCCESS, NULL, NULL); }
Fix compilation against wlroots without X11 backend
Fix compilation against wlroots without X11 backend
C
mit
ascent12/sway,1ace/sway,SirCmpwn/sway,ascent12/sway,1ace/sway,ascent12/sway,1ace/sway
003bca2cb254ad4712d4aad3bcf14ed62b48be19
RobotC/Headers/Helper.h
RobotC/Headers/Helper.h
#ifndef HELPER_H #define HELPER_H /*Helper function for calculating ABSOLUTE maximum of two floats Will return maximum absolute value (ignores sign) */ float helpFindMaxAbsFloat(float a, float b) { float aAbs = abs(a); float bAbs = abs(b); if (aAbs > bAbs) { return aAbs; } else { return bAbs; } } //Helper function for calculating ABSOLUTE minimum of two floats //Will return minimum absolute value (ignores sign) float helpFindMinAbsFloat(float a, float b) { float aAbs = abs(a); float bAbs = abs(b); if (aAbs < bAbs) { return aAbs; } else { return bAbs; } } //Helper function for calculating contraints of a float float constrain(float x, float lowerBound, float upperBound){ if(x<lowerBound){ return lowerBound; }else if(x>upperBound){ return upperBound; }else{ return x; } } #endif
#ifndef HELPER_H #define HELPER_H #pragma systemFile /*Helper function for calculating ABSOLUTE maximum of two floats Will return maximum absolute value (ignores sign) */ float helpFindMaxAbsFloat(float a, float b) { float aAbs = abs(a); float bAbs = abs(b); if (aAbs > bAbs) { return aAbs; } else { return bAbs; } } //Helper function for calculating ABSOLUTE minimum of two floats //Will return minimum absolute value (ignores sign) float helpFindMinAbsFloat(float a, float b) { float aAbs = abs(a); float bAbs = abs(b); if (aAbs < bAbs) { return aAbs; } else { return bAbs; } } //Helper function for calculating contraints of a float float constrain(float x, float lowerBound, float upperBound){ if(x<lowerBound){ return lowerBound; }else if(x>upperBound){ return upperBound; }else{ return x; } } #endif
Add systemFile declaration to helper library
Add systemFile declaration to helper library
C
mit
RMRobotics/FTC_5421_2014-2015,RMRobotics/FTC_5421_2014-2015
4220192f474cce95ed3a83f7dd79692fb5ca1432
MdeModulePkg/Library/ExtendedIfrSupportLib/LibraryInternal.h
MdeModulePkg/Library/ExtendedIfrSupportLib/LibraryInternal.h
/** @file The file contain all library function for Ifr Operations. Copyright (c) 2007 - 2008, Intel Corporation. <BR> All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #ifndef _IFRLIBRARY_INTERNAL_H_ #define _IFRLIBRARY_INTERNAL_H_ #include <Uefi.h> #include <Guid/GlobalVariable.h> #include <Protocol/DevicePath.h> #include <Protocol/HiiDatabase.h> #include <Protocol/HiiString.h> #include <Library/DebugLib.h> #include <Library/BaseMemoryLib.h> #include <Library/UefiRuntimeServicesTableLib.h> #include <Library/UefiBootServicesTableLib.h> #include <Library/BaseLib.h> #include <Library/DevicePathLib.h> #include <Library/MemoryAllocationLib.h> #include <Library/IfrSupportLib.h> #include <Library/PcdLib.h> #include <MdeModuleHii.h> extern EFI_GUID mIfrVendorGuid; #endif
/** @file The file contain all library function for Ifr Operations. Copyright (c) 2007 - 2008, Intel Corporation. <BR> All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #ifndef _IFRLIBRARY_INTERNAL_H_ #define _IFRLIBRARY_INTERNAL_H_ #include <Uefi.h> #include <Protocol/DevicePath.h> #include <Protocol/HiiDatabase.h> #include <Protocol/HiiString.h> #include <Library/DebugLib.h> #include <Library/BaseMemoryLib.h> #include <Library/UefiRuntimeServicesTableLib.h> #include <Library/UefiBootServicesTableLib.h> #include <Library/BaseLib.h> #include <Library/DevicePathLib.h> #include <Library/MemoryAllocationLib.h> #include <Library/IfrSupportLib.h> #include <Library/PcdLib.h> #include <MdeModuleHii.h> extern EFI_GUID mIfrVendorGuid; #endif
Remove over specific header file.
Remove over specific header file. git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@6393 6f19259b-4bc3-4df7-8a09-765794883524
C
bsd-2-clause
MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2
0397724420b14c35c7cd88dc6580bf780c2509e4
rts/c/tuning.h
rts/c/tuning.h
// Start of tuning.h. static char* load_tuning_file(const char *fname, void *cfg, int (*set_size)(void*, const char*, size_t)) { const int max_line_len = 1024; char* line = (char*) malloc(max_line_len); FILE *f = fopen(fname, "r"); if (f == NULL) { snprintf(line, max_line_len, "Cannot open file: %s", strerror(errno)); return line; } int lineno = 0; while (fgets(line, max_line_len, f) != NULL) { lineno++; char *eql = strstr(line, "="); if (eql) { *eql = 0; int value = atoi(eql+1); if (set_size(cfg, line, value) != 0) { strncpy(eql+1, line, max_line_len-strlen(line)-1); snprintf(line, max_line_len, "Unknown name '%s' on line %d.", eql+1, lineno); return line; } } else { snprintf(line, max_line_len, "Invalid line %d (must be of form 'name=int').", lineno); return line; } } free(line); return NULL; } // End of tuning.h.
// Start of tuning.h. static char* load_tuning_file(const char *fname, void *cfg, int (*set_size)(void*, const char*, size_t)) { const int max_line_len = 1024; char* line = (char*) malloc(max_line_len); FILE *f = fopen(fname, "r"); if (f == NULL) { snprintf(line, max_line_len, "Cannot open file: %s", strerror(errno)); return line; } int lineno = 0; while (fgets(line, max_line_len, f) != NULL) { lineno++; char *eql = strstr(line, "="); if (eql) { *eql = 0; int value = atoi(eql+1); if (set_size(cfg, line, value) != 0) { char* err = (char*) malloc(max_line_len + 50); snprintf(err, max_line_len + 50, "Unknown name '%s' on line %d.", line, lineno); free(line); return err; } } else { snprintf(line, max_line_len, "Invalid line %d (must be of form 'name=int').", lineno); return line; } } free(line); return NULL; } // End of tuning.h.
Fix error for short names
Fix error for short names
C
isc
diku-dk/futhark,HIPERFIT/futhark,diku-dk/futhark,diku-dk/futhark,HIPERFIT/futhark,HIPERFIT/futhark,diku-dk/futhark,diku-dk/futhark
2638a56fd95710ec7f68131dfefa233a7bdab94f
egroot/src/bits/leadingzeros-cortexm+.h
egroot/src/bits/leadingzeros-cortexm+.h
// +build cortexm3 cortexm4 cortexm4f static inline uint bits$leadingZeros32(uint32 u) { uint n; asm volatile ("clz %0, %1" : "=r" (n) : "r" (u)); return n; } static inline uint bits$leadingZerosPtr(uintptr u) { uint n; asm volatile ("clz %0, %1" : "=r" (n) : "r" (u)); return n; } static inline uint bits$leadingZeros64(uint64 u) { uint n; asm volatile ( "clz %0, %R1\n\t" "cmp %0, 32\n\t" "itt eq\n\t" "clzeq %0, %Q1\n\t" "addeq %0, 32\n\t" : "=&r" (n) : "r" (u) : "cc" ); return n; }
// +build cortexm3 cortexm4 cortexm4f uint bits$leadingZeros32(uint32 u) { uint n; asm volatile ("clz %0, %1":"=r" (n):"r"(u)); return n; } uint bits$leadingZerosPtr(uintptr u) { uint n; asm volatile ("clz %0, %1":"=r" (n):"r"(u)); return n; } uint bits$leadingZeros64(uint64 u) { uint n; asm volatile ("clz %0, %R1\n\t" "cmp %0, 32\n\t" "itt eq\n\t" "clzeq %0, %Q1\n\t" "addeq %0, 32\n\t" :"=&r" (n) :"r"(u) :"cc"); return n; }
Remove "static inline" from C code.
bits: Remove "static inline" from C code.
C
bsd-3-clause
ziutek/emgo,ziutek/emgo,ziutek/emgo,ziutek/emgo
c1c1a4f9cd97d81cca1306ebb6c3099313fd9ea2
libc/sysdeps/linux/arm/aeabi_memclr.c
libc/sysdeps/linux/arm/aeabi_memclr.c
/* Copyright (C) 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <string.h> libc_hidden_proto(bzero) /* Clear memory. Can't alias to bzero because it's not defined in the same translation unit. */ void __aeabi_memclr (void *dest, size_t n) { bzero (dest, n); } /* Versions of the above which may assume memory alignment. */ strong_alias (__aeabi_memclr, __aeabi_memclr4) strong_alias (__aeabi_memclr, __aeabi_memclr8)
/* Copyright (C) 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <string.h> libc_hidden_proto(memset) /* Clear memory. Can't alias to bzero because it's not defined in the same translation unit. */ void __aeabi_memclr (void *dest, size_t n) { memset (dest, 0, n); } /* Versions of the above which may assume memory alignment. */ strong_alias (__aeabi_memclr, __aeabi_memclr4) strong_alias (__aeabi_memclr, __aeabi_memclr8)
Use memset instead of bzero
Use memset instead of bzero
C
lgpl-2.1
foss-for-synopsys-dwc-arc-processors/uClibc,majek/uclibc-vx32,m-labs/uclibc-lm32,ysat0/uClibc,waweber/uclibc-clang,hjl-tools/uClibc,atgreen/uClibc-moxie,wbx-github/uclibc-ng,brgl/uclibc-ng,ffainelli/uClibc,kraj/uClibc,klee/klee-uclibc,foss-xtensa/uClibc,mephi42/uClibc,gittup/uClibc,brgl/uclibc-ng,mephi42/uClibc,czankel/xtensa-uclibc,ffainelli/uClibc,OpenInkpot-archive/iplinux-uclibc,majek/uclibc-vx32,hjl-tools/uClibc,OpenInkpot-archive/iplinux-uclibc,hwoarang/uClibc,czankel/xtensa-uclibc,OpenInkpot-archive/iplinux-uclibc,groundwater/uClibc,groundwater/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,ffainelli/uClibc,ddcc/klee-uclibc-0.9.33.2,groundwater/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,kraj/uclibc-ng,skristiansson/uClibc-or1k,kraj/uclibc-ng,czankel/xtensa-uclibc,ysat0/uClibc,ChickenRunjyd/klee-uclibc,klee/klee-uclibc,m-labs/uclibc-lm32,kraj/uClibc,kraj/uClibc,brgl/uclibc-ng,waweber/uclibc-clang,hjl-tools/uClibc,mephi42/uClibc,ChickenRunjyd/klee-uclibc,m-labs/uclibc-lm32,groundwater/uClibc,wbx-github/uclibc-ng,ysat0/uClibc,ChickenRunjyd/klee-uclibc,ffainelli/uClibc,skristiansson/uClibc-or1k,foss-xtensa/uClibc,kraj/uclibc-ng,foss-for-synopsys-dwc-arc-processors/uClibc,skristiansson/uClibc-or1k,hwoarang/uClibc,majek/uclibc-vx32,m-labs/uclibc-lm32,gittup/uClibc,waweber/uclibc-clang,ndmsystems/uClibc,foss-xtensa/uClibc,ddcc/klee-uclibc-0.9.33.2,majek/uclibc-vx32,mephi42/uClibc,hjl-tools/uClibc,skristiansson/uClibc-or1k,brgl/uclibc-ng,klee/klee-uclibc,ffainelli/uClibc,kraj/uclibc-ng,klee/klee-uclibc,ChickenRunjyd/klee-uclibc,gittup/uClibc,waweber/uclibc-clang,ndmsystems/uClibc,atgreen/uClibc-moxie,atgreen/uClibc-moxie,ddcc/klee-uclibc-0.9.33.2,kraj/uClibc,groundwater/uClibc,hwoarang/uClibc,ndmsystems/uClibc,hjl-tools/uClibc,gittup/uClibc,wbx-github/uclibc-ng,czankel/xtensa-uclibc,ndmsystems/uClibc,hwoarang/uClibc,atgreen/uClibc-moxie,OpenInkpot-archive/iplinux-uclibc,wbx-github/uclibc-ng,ddcc/klee-uclibc-0.9.33.2,foss-xtensa/uClibc,ysat0/uClibc
965d247d41bffde43572c81575a0915f53fa9b04
phraser/cc/analysis/analysis_options.h
phraser/cc/analysis/analysis_options.h
#ifndef CC_ANALYSIS_ANALYSIS_OPTIONS_H_ #define CC_ANALYSIS_ANALYSIS_OPTIONS_H_ #include <cstddef> struct AnalysisOptions { AnalysisOptions() : destutter_max_consecutive(3), replace_html_entities(true) {} // Preprocessing. size_t destutter_max_consecutive; // Tokenization. bool replace_html_entities; }; #endif // CC_ANALYSIS_ANALYSIS_OPTIONS_H_
#ifndef CC_ANALYSIS_ANALYSIS_OPTIONS_H_ #define CC_ANALYSIS_ANALYSIS_OPTIONS_H_ #include <cstddef> struct AnalysisOptions { AnalysisOptions() : track_index_translation(true), destutter_max_consecutive(3), track_chr2drop(true), replace_html_entities(true) {} // General flags: // * Map tokens to spans in the original text. bool track_index_translations; // Preprocessing flags: // * Maximum number of consecutive code points before we start dropping them. // * Whether to keep track of code point drop counts from destuttering. size_t destutter_max_consecutive; bool track_chr2drop; // Tokenization flags: // * Whether to replace HTML entities in the text with their Unicode // equivalents. bool replace_html_entities; }; #endif // CC_ANALYSIS_ANALYSIS_OPTIONS_H_
Add track_* flags to analysis options to let caller strip it down.
Add track_* flags to analysis options to let caller strip it down.
C
mit
knighton/phraser,escherba/phraser,knighton/phraser,escherba/phraser,knighton/phraser,escherba/phraser,knighton/phraser,escherba/phraser
ff6f5a4817adb4e2f2220a65478e50a89d4090b1
src/readstat_iconv.h
src/readstat_iconv.h
#include <iconv.h> #ifdef WIN32 typedef const char ** readstat_iconv_inbuf_t; #else typedef char ** readstat_iconv_inbuf_t; #endif typedef struct readstat_charset_entry_s { int code; char name[32]; } readstat_charset_entry_t;
#include <iconv.h> #ifdef WINICONV_CONST typedef const char ** readstat_iconv_inbuf_t; #else typedef char ** readstat_iconv_inbuf_t; #endif typedef struct readstat_charset_entry_s { int code; char name[32]; } readstat_charset_entry_t;
Fix iconv warnings on MinGW
Fix iconv warnings on MinGW
C
mit
WizardMac/ReadStat,ivarref/ReadStat,ivarref/ReadStat,WizardMac/ReadStat
c07827f2d82d7eaa18ab5945b6fe44589650bbc9
include/dt-bindings/clock/kinetis_sim.h
include/dt-bindings/clock/kinetis_sim.h
/* * Copyright (c) 2017, NXP * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_ #define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_ #define KINETIS_SIM_CORESYS_CLK 0 #define KINETIS_SIM_PLATFORM_CLK 1 #define KINETIS_SIM_BUS_CLK 2 #define KINETIS_SIM_LPO_CLK 19 #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_ */
/* * Copyright (c) 2017, NXP * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_ #define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_ #define KINETIS_SIM_CORESYS_CLK 0 #define KINETIS_SIM_PLATFORM_CLK 1 #define KINETIS_SIM_BUS_CLK 2 #define KINETIS_SIM_FAST_PERIPHERAL_CLK 5 #define KINETIS_SIM_LPO_CLK 19 #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_ */
Add support for fast peripheral clock in mcux sim driver
clock_control: Add support for fast peripheral clock in mcux sim driver Adds support for getting the fast peripheral clock frequency in the mcux sim driver. Signed-off-by: Filip Brozovic <9e406e4eada0a466898ca20f2c830a2e8d7bc324@gmail.com>
C
apache-2.0
Vudentz/zephyr,galak/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,Vudentz/zephyr,nashif/zephyr,nashif/zephyr,galak/zephyr,finikorg/zephyr,galak/zephyr,galak/zephyr,Vudentz/zephyr,nashif/zephyr,finikorg/zephyr,finikorg/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,galak/zephyr
3da1a1dde53b3efeb54ab1c68fba7d85dac4ac20
utils/prompt.h
utils/prompt.h
#ifndef _WISH_PROMPT #define _WISH_PROMPT /* * The wish shell prompt has its own format characters, much like how bash, * zsh, fish, and ksh all have their own formatting characters. * * %u - The username of the current user * %h - The hostname * %d~n - The top n levels of the working directory. If n is not provided * then the entire working directory is displayed. (i.e. %d, %d~2) * This assumes that 0 <= n <= 9. * %t - The time in 24 hour format * %T - The time in 12 hour (AM/PM) format * %% - The percent symbol * * * NOTES: * * If there is a % at the end of the prompt, it will be implied that it is %%. * An unrecognized formatting character will be interpretted literally. */ char *PROMPT; char *get_format_substitution(char *prompt_var); void load_prompt_defaults(); void load_prompt_config(); void prompt(char *current_working_dir); #endif
#ifndef _WISH_PROMPT #define _WISH_PROMPT /* * The wish shell prompt has its own format characters, much like how bash, * zsh, fish, and ksh all have their own formatting characters. * * %u - The username of the current user * %h - The hostname * %d~n - The top n levels of the working directory. If n is not provided * then the entire working directory is displayed. (i.e. %d, %d~2) * This assumes that 0 <= n <= 9. * %t - The time in 24 hour format * %T - The time in 12 hour (AM/PM) format * %% - The percent symbol * * * NOTES: * * If there is a % at the end of the prompt, it will be implied that it is %%. * An unrecognized formatting character will be interpretted literally. */ char *PROMPT; char *get_format_substitution(char *prompt_var); void load_prompt_defaults(); void load_prompt_config(); void prompt(char *current_working_dir); #endif #ifndef HOST_NAME_MAX #define HOST_NAME_MAX 255 #endif
Fix HOST_NAME_MAX not found error on Mac OSX. POSIX compliance pls.
Fix HOST_NAME_MAX not found error on Mac OSX. POSIX compliance pls.
C
mit
elc1798/wish
b491a3e6156e450810e3d9a8c2d59365606dd208
hal2.h
hal2.h
#ifndef HAL2_H #define HAL2_H // Mechanical constants extern int const MAIN_MOTOR_PWM_TOP = 255; extern int const MAIN_MOTOR_BRAKE_SPEED = 120; extern int const MAIN_MOTOR_MIN_SPEED = 150; extern int const MAIN_MOTOR_MED_SPEED = 254; extern int const MAIN_MOTOR_MAX_SPEED = 255; extern int const MAGNET_OPEN_WAIT = 5; // 10ths of a second void init(void); void main_motor_stop(); void main_motor_cw_open(uint8_t speed); void main_motor_ccw_close(uint8_t speed); void set_main_motor_speed(int speed); int get_main_motor_speed(); void aux_motor_stop(); void aux_motor_cw_close(); void aux_motor_ccw_open(); void magnet_off(); void magnet_on(); bool door_nearly_open(); bool door_fully_open(); bool door_fully_closed(); bool sensor_proximity(); bool button_openclose(); bool button_stop(); bool main_encoder(); bool aux_outdoor_limit(); bool aux_indoor_limit(); bool door_nearly_closed(); bool aux_encoder(); #endif
#ifndef HAL2_H #define HAL2_H // Mechanical constants extern int const MAIN_MOTOR_PWM_TOP = 255; extern int const MAIN_MOTOR_BRAKE_SPEED = 120; extern int const MAIN_MOTOR_MIN_SPEED = 150; extern int const MAIN_MOTOR_MED_SPEED = 254; extern int const MAIN_MOTOR_MAX_SPEED = 255; extern int const MAGNET_OPEN_WAIT = 5; // 10ths of a second void init(void); void main_motor_stop(); void main_motor_cw_open(uint8_t speed); void main_motor_ccw_close(uint8_t speed); void aux_motor_stop(); void aux_motor_cw_close(); void aux_motor_ccw_open(); void magnet_off(); void magnet_on(); bool door_nearly_open(); bool door_fully_open(); bool door_fully_closed(); bool sensor_proximity(); bool button_openclose(); bool button_stop(); bool main_encoder(); bool aux_outdoor_limit(); bool aux_indoor_limit(); bool door_nearly_closed(); bool aux_encoder(); #endif
Remove functions that are private.
Remove functions that are private.
C
unlicense
plzz/ovisysteemi,plzz/ovisysteemi
637d0f278459aa1130ab96c063fcaf0611507e47
main.c
main.c
#include <stdio.h> #include <assert.h> #include "api.h" #include "lib/math.c" #include "lib/test.c" static jack_state_t* state; static intptr_t jack_fib(intptr_t n) { jack_new_integer(state, n); jack_function_call(state, 1, 1); return jack_get_integer(state, -1); } int main() { for (int j = 0; j < 0x1; ++j) { state = jack_new_state(15); jack_call(state, jack_math, 0); jack_map_get_symbol(state, -1, "fib"); jack_new_list(state); // 1 - fib // 2 - list for (intptr_t i = 0; i <= 91; ++i) { printf("fib(%ld) = %ld\n", i, jack_fib(i)); jack_list_push(state, 2); } jack_dump_state(state); jack_free_state(state); } return 0; }
#include <stdio.h> #include <assert.h> #include "api.h" #include "lib/math.c" #include "lib/test.c" static jack_state_t* state; static intptr_t jack_fib(intptr_t n) { jack_new_integer(state, n); jack_function_call(state, 1, 1); return jack_get_integer(state, -1); } int main() { state = jack_new_state(20); jack_call(state, jack_math, 0); jack_map_get_symbol(state, -1, "fib"); jack_new_list(state); // 1 - fib // 2 - list for (int j = 0; j < 0x10000; ++j) { printf("Generation %d\n", j); for (intptr_t i = 0; i <= 91; ++i) { jack_fib(i); // printf("fib(%ld) = %ld\n", i, jack_fib(i)); jack_pop(state); // jack_list_push(state, 2); } } jack_dump_state(state); jack_free_state(state); return 0; }
Tweak for benchmark. fib(0-91) 1987925/second
Tweak for benchmark. fib(0-91) 1987925/second
C
mit
creationix/jack-lang,creationix/jack-lang
6eba7a9e41ca3e5fac9c3b5feb74af9f37774987
apps/examples/kalman_demo/params.c
apps/examples/kalman_demo/params.c
#include <systemlib/param/param.h> /*PARAM_DEFINE_FLOAT(NAME,0.0f);*/ PARAM_DEFINE_FLOAT(KF_V_GYRO, 1.0f); PARAM_DEFINE_FLOAT(KF_V_ACCEL, 1.0f); PARAM_DEFINE_FLOAT(KF_R_MAG, 1.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_VEL, 1.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_POS, 5.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_ALT, 5.0f); PARAM_DEFINE_FLOAT(KF_R_PRESS_ALT, 0.1f); PARAM_DEFINE_FLOAT(KF_R_ACCEL, 1.0f); PARAM_DEFINE_FLOAT(KF_FAULT_POS, 10.0f); PARAM_DEFINE_FLOAT(KF_FAULT_ATT, 10.0f); PARAM_DEFINE_FLOAT(KF_ENV_G, 9.765f); PARAM_DEFINE_FLOAT(KF_ENV_MAG_DIP, 60.0f); PARAM_DEFINE_FLOAT(KF_ENV_MAG_DEC, 0.0f);
#include <systemlib/param/param.h> /*PARAM_DEFINE_FLOAT(NAME,0.0f);*/ PARAM_DEFINE_FLOAT(KF_V_GYRO, 0.008f); PARAM_DEFINE_FLOAT(KF_V_ACCEL, 1.0f); PARAM_DEFINE_FLOAT(KF_R_MAG, 1.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_VEL, 1.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_POS, 5.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_ALT, 5.0f); PARAM_DEFINE_FLOAT(KF_R_PRESS_ALT, 0.1f); PARAM_DEFINE_FLOAT(KF_R_ACCEL, 1.0f); PARAM_DEFINE_FLOAT(KF_FAULT_POS, 10.0f); PARAM_DEFINE_FLOAT(KF_FAULT_ATT, 10.0f); PARAM_DEFINE_FLOAT(KF_ENV_G, 9.765f); PARAM_DEFINE_FLOAT(KF_ENV_MAG_DIP, 60.0f); PARAM_DEFINE_FLOAT(KF_ENV_MAG_DEC, 0.0f);
Fix gyro measurement noise variance
Fix gyro measurement noise variance
C
bsd-3-clause
mcgill-robotics/Firmware,Aerotenna/Firmware,darknight-007/Firmware,dagar/Firmware,krbeverx/Firmware,PX4/Firmware,mcgill-robotics/Firmware,PX4/Firmware,jlecoeur/Firmware,mje-nz/PX4-Firmware,PX4/Firmware,PX4/Firmware,jlecoeur/Firmware,Aerotenna/Firmware,acfloria/Firmware,krbeverx/Firmware,acfloria/Firmware,krbeverx/Firmware,PX4/Firmware,jlecoeur/Firmware,krbeverx/Firmware,Aerotenna/Firmware,jlecoeur/Firmware,jlecoeur/Firmware,jlecoeur/Firmware,dagar/Firmware,Aerotenna/Firmware,acfloria/Firmware,mje-nz/PX4-Firmware,acfloria/Firmware,mcgill-robotics/Firmware,mcgill-robotics/Firmware,dagar/Firmware,krbeverx/Firmware,krbeverx/Firmware,mcgill-robotics/Firmware,acfloria/Firmware,mcgill-robotics/Firmware,Aerotenna/Firmware,mje-nz/PX4-Firmware,mje-nz/PX4-Firmware,PX4/Firmware,mje-nz/PX4-Firmware,jlecoeur/Firmware,dagar/Firmware,Aerotenna/Firmware,PX4/Firmware,Aerotenna/Firmware,darknight-007/Firmware,darknight-007/Firmware,mcgill-robotics/Firmware,darknight-007/Firmware,krbeverx/Firmware,dagar/Firmware,mje-nz/PX4-Firmware,acfloria/Firmware,acfloria/Firmware,dagar/Firmware,darknight-007/Firmware,jlecoeur/Firmware,dagar/Firmware,mje-nz/PX4-Firmware
8114b3e7e5438de48b5cf1c1e2454debb6cf96cc
src/readimages.c
src/readimages.c
#include <stdio.h> #include <stdlib.h> #include <assert.h> #include <arpa/inet.h> #include "idx.h" int main(int argc, char **argv){ if(argc<2){ printf("Usage: \n"); printf("readlabels t10k-labels-idx1-ubyte \n"); exit(1); } char *slabelfname = argv[1]; IDX1_DATA idxdata; if(!fread_idx1_file( slabelfname, &idxdata)){ printf("The datafile '%s' is not a valid IDX_1 file.\n", slabelfname); exit(2); } //printf("Length: %d\n", idxdata.length); int i; for(i=0;i<idxdata.length;i++){ // printf("DATA[%05d] = %02d\n", i, idxdata.data[i]); printf("%d\n", idxdata.data[i]); } return 0; }
#include <stdio.h> #include <stdlib.h> #include <assert.h> #include <arpa/inet.h> #include "idx.h" int main(int argc, char **argv){ if(argc<2){ printf("Usage: \n"); printf("readimages t10k-images-idx3-ubyte \n"); exit(1); } char *slabelfname = argv[1]; IDX3_DATA idxdata; if(!fread_idx3_file( slabelfname, &idxdata)){ printf("The datafile '%s' is not a valid IDX3 file.\n", slabelfname); exit(2); } //printf("Length: %d\n", idxdata.length); int i; int x; int y; int ibase; int rbase; unsigned char pxl; for(i=0;i<idxdata.nimages;i++){ ibase = i * idxdata.nrows * idxdata.ncols; printf("Image %05d ( %010d ):\n", i + 1, ibase); for(y=0;y<idxdata.nrows;y++){ rbase = ibase + y*idxdata.ncols; for(x=0;x<idxdata.ncols;x++){ // printf("DATA[%05d] = %02d\n", i, idxdata.data[i]); pxl = idxdata.data[ rbase + x ]; if(pxl){ printf("%02X", pxl); }else{ printf(" "); } } printf("\n"); } printf("========================================================\n"); } return 0; }
Implement a simple ASCII text image dumper.
Implement a simple ASCII text image dumper.
C
mit
spytheman/MNIST-idx1-and-idx3-file-readers
8422e5d1b414ee3a5ca6813e064fb55ea7a8c5bd
src/udbm_stubs.h
src/udbm_stubs.h
#ifndef UDBM_STUBS_H_ #define UDBM_STUBS_H_ #include <vector> typedef std::vector<int> carray_t; #define get_cvector(x) ((carray_t*)Data_custom_val(x)) #define get_dbm_ptr(x) static_cast<dbm_t*>(Data_custom_val(x)) #endif // UDBM_STUBS_H_
#ifndef UDBM_STUBS_H_ #define UDBM_STUBS_H_ #include <vector> typedef std::vector<int> carray_t; #define get_cvector(x) ((carray_t*)Data_custom_val(x)) #define get_dbm_ptr(x) static_cast<dbm_t*>(Data_custom_val(x)) bool dbm_closure_leq(const raw_t * const dr1, const raw_t * const dr2, cindex_t dim, const std::vector<int> &lbounds, const std::vector<int> &ubounds); #endif // UDBM_STUBS_H_
Make closure inclusion test visible (to be used from the priced zone part).
Make closure inclusion test visible (to be used from the priced zone part).
C
agpl-3.0
osankur/udbml,osankur/udbml,osankur/udbml
0938cfe3dc0a498bbf3ce26dfe6c47d4d68025b5
libtock/internal/nonvolatile_storage.h
libtock/internal/nonvolatile_storage.h
#pragma once #include "tock.h" #ifdef __cplusplus extern "C" { #endif #define DRIVER_NUM_NONVOLATILE_STORAGE 0x1b int nonvolatile_storage_internal_read_done_subscribe(subscribe_cb cb, void *userdata); int nonvolatile_storage_internal_write_done_subscribe(subscribe_cb cb, void *userdata); int nonvolatile_storage_internal_read_buffer(uint8_t* buffer, uint32_t len); int nonvolatile_storage_internal_write_buffer(uint8_t* buffer, uint32_t len); int nonvolatile_storage_internal_get_number_bytes(void); int nonvolatile_storage_internal_read(uint32_t offset, uint32_t length); int nonvolatile_storage_internal_write(uint32_t offset, uint32_t length); #ifdef __cplusplus } #endif
#pragma once #include "tock.h" #define DRIVER_NUM_NONVOLATILE_STORAGE 0x50001 #ifdef __cplusplus extern "C" { #endif int nonvolatile_storage_internal_read_done_subscribe(subscribe_cb cb, void *userdata); int nonvolatile_storage_internal_write_done_subscribe(subscribe_cb cb, void *userdata); int nonvolatile_storage_internal_read_buffer(uint8_t* buffer, uint32_t len); int nonvolatile_storage_internal_write_buffer(uint8_t* buffer, uint32_t len); int nonvolatile_storage_internal_get_number_bytes(void); int nonvolatile_storage_internal_read(uint32_t offset, uint32_t length); int nonvolatile_storage_internal_write(uint32_t offset, uint32_t length); #ifdef __cplusplus } #endif
Revert "weird issue where flash only works when DRIVER_NUM set to 27, hardcoded somewhere?"
Revert "weird issue where flash only works when DRIVER_NUM set to 27, hardcoded somewhere?" This reverts commit 3431f4ed857afb9376a120334e1521aa9a71d483.
C
apache-2.0
tock/libtock-c,tock/libtock-c,tock/libtock-c