commit
stringlengths 40
40
| old_file
stringlengths 4
112
| new_file
stringlengths 4
112
| old_contents
stringlengths 0
2.05k
| new_contents
stringlengths 28
3.9k
| subject
stringlengths 17
736
| message
stringlengths 18
4.78k
| lang
stringclasses 1
value | license
stringclasses 13
values | repos
stringlengths 7
111k
|
---|---|---|---|---|---|---|---|---|---|
dd9777220347843feb5f74e2d48ae62082936649 | jni/ru_exlmoto_spout_SpoutNativeLibProxy.h | jni/ru_exlmoto_spout_SpoutNativeLibProxy.h | /* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class ru_exlmoto_spout_SpoutNativeLibProxy */
#ifndef _Included_ru_exlmoto_spout_SpoutNativeLibProxy
#define _Included_ru_exlmoto_spout_SpoutNativeLibProxy
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: ru_exlmoto_spout_SpoutNativeLibProxy
* Method: SpoutNativeInit
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_ru_exlmoto_spout_SpoutNativeLibProxy_SpoutNativeInit
(JNIEnv *, jclass);
/*
* Class: ru_exlmoto_spout_SpoutNativeLibProxy
* Method: SpoutNativeDeinit
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_ru_exlmoto_spout_SpoutNativeLibProxy_SpoutNativeDeinit
(JNIEnv *, jclass);
/*
* Class: ru_exlmoto_spout_SpoutNativeLibProxy
* Method: SpoutNativeSurfaceChanged
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_ru_exlmoto_spout_SpoutNativeLibProxy_SpoutNativeSurfaceChanged
(JNIEnv *, jclass, jint, jint);
/*
* Class: ru_exlmoto_spout_SpoutNativeLibProxy
* Method: SpoutNativeDraw
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_ru_exlmoto_spout_SpoutNativeLibProxy_SpoutNativeDraw
(JNIEnv *, jclass);
/*
* Class: ru_exlmoto_spout_SpoutNativeLibProxy
* Method: SpoutNativeKeyDown
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_ru_exlmoto_spout_SpoutNativeLibProxy_SpoutNativeKeyDown
(JNIEnv *, jclass, jint);
/*
* Class: ru_exlmoto_spout_SpoutNativeLibProxy
* Method: SpoutNativeKeyUp
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_ru_exlmoto_spout_SpoutNativeLibProxy_SpoutNativeKeyUp
(JNIEnv *, jclass, jint);
/*
* Class: ru_exlmoto_spout_SpoutNativeLibProxy
* Method: SpoutNativePushScore
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_ru_exlmoto_spout_SpoutNativeLibProxy_SpoutNativePushScore
(JNIEnv *, jclass, jint, jint);
/*
* Class: ru_exlmoto_spout_SpoutNativeLibProxy
* Method: SpoutNativeGetScore
* Signature: ()[I
*/
JNIEXPORT jintArray JNICALL Java_ru_exlmoto_spout_SpoutNativeLibProxy_SpoutNativeGetScore
(JNIEnv *, jclass);
#ifdef __cplusplus
}
#endif
#endif
| Add machine generated JNI header | Add machine generated JNI header
command:
javah -jni -d jni -classpath src \
ru.exlmoto.spout.SpoutNativeLibProxy
| C | mit | EXL/Spout,EXL/Spout,EXL/Spout |
|
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 |
0dbf3c5578ad9334c98a2099c2bdac68ebeab933 | pratica-07/soluc.c | pratica-07/soluc.c | #include "local.h"
float soluc(float x, float y)
{
float r;
r = sqrt(x * x + y * y);
return r;
}
float radians_degrees(float degrees)
{
return degrees*180/PI;
}
float degrees_radians(float radians)
{
return radians*PI/180;
}
| Add funcoes para converter graus <-> rad | Add funcoes para converter graus <-> rad
| C | mit | tonussi/freezing-dubstep,tonussi/freezing-dubstep,tonussi/freezing-dubstep |
|
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 <[email protected]>
Cc: [email protected]
Cc: Linus Torvalds <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Pekka Enberg <[email protected]>
Link: [email protected]
Signed-off-by: Ingo Molnar <[email protected]>
| 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 |
d7f50666d97c89c03e2ab8679a7c20523e14b11d | objc/message.h | objc/message.h | #ifndef _OBJC_MESSAGE_H_
#define _OBJC_MESSAGE_H_
#if defined(__x86_64) || defined(__i386) || defined(__arm__) || \
defined(__mips_n64) || defined(__mips_n32)
/**
* Standard message sending function. This function must be cast to the
* correct types for the function before use. The first argument is the
* receiver and the second the selector.
*
* Note that this function is not available on all architectures. For a more
* portable solution to sending arbitrary messages, consider using
* objc_msg_lookup_sender() and then calling the returned IMP directly.
*
* This version of the function is used for all messages that return either an
* integer, a pointer, or a small structure value that is returned in
* registers. Be aware that calling conventions differ between operating
* systems even within the same architecture, so take great care if using this
* function for small (two integer) structures.
*/
id objc_msgSend(id self, SEL _cmd, ...);
/**
* Standard message sending function. This function must be cast to the
* correct types for the function before use. The first argument is the
* receiver and the second the selector.
*
* Note that this function is not available on all architectures. For a more
* portable solution to sending arbitrary messages, consider using
* objc_msg_lookup_sender() and then calling the returned IMP directly.
*
* This version of the function is used for all messages that return a
* structure that is not returned in registers. Be aware that calling
* conventions differ between operating systems even within the same
* architecture, so take great care if using this function for small (two
* integer) structures.
*/
#ifdef __cplusplus
id objc_msgSend_stret(id self, SEL _cmd, ...);
#else
void objc_msgSend_stret(id self, SEL _cmd, ...);
#endif
/**
* Standard message sending function. This function must be cast to the
* correct types for the function before use. The first argument is the
* receiver and the second the selector.
*
* Note that this function is not available on all architectures. For a more
* portable solution to sending arbitrary messages, consider using
* objc_msg_lookup_sender() and then calling the returned IMP directly.
*
* This version of the function is used for all messages that return floating
* point values.
*/
long double objc_msgSend_fpret(id self, SEL _cmd, ...);
#endif
#endif //_OBJC_MESSAGE_H_
| Fix clang's stupid warning to work around a bug in OS X headers... | Fix clang's stupid warning to work around a bug in OS X headers...
git-svn-id: f6517e426f81db5247881cd92f7386583ace04fa@35962 72102866-910b-0410-8b05-ffd578937521
| C | mit | skudryas/gnustep-libobjc2,crontab/libobjc2,crontab/libobjc2,skudryas/gnustep-libobjc2 |
|
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 |
c031eb0a246c091c297009129b527e3e226027ef | tests/regression/49-expsplit/04-multi-split.c | tests/regression/49-expsplit/04-multi-split.c | // PARAM: --set ana.activated[+] expsplit
#include <stddef.h>
#include <assert.h>
#include <goblint.h>
int main() {
int r, r2; // rand
int x, y, z;
__goblint_split_begin(x);
__goblint_split_begin(y);
if (r) {
x = 1;
if (r2) {
y = 1;
z = 1;
}
else {
y = 2;
z = 2;
}
}
else {
x = 2;
if (r2) {
y = 1;
z = 3;
}
else {
y = 2;
z = 4;
}
}
__goblint_check((x == 1 && y == 1 && z == 1) || (x == 1 && y == 2 && z == 2) || (x == 2 && y == 1 && z == 3) || (x == 2 && y == 2 && z == 4));
__goblint_split_end(x);
__goblint_check((x == 1 && y == 1 && z == 1) || (x == 1 && y == 2 && z == 2) || (x == 2 && y == 1 && z == 3) || (x == 2 && y == 2 && z == 4)); // UNKNOWN (intentionally)
__goblint_split_end(y);
__goblint_check((x == 1 && y == 1 && z == 1) || (x == 1 && y == 2 && z == 2) || (x == 2 && y == 1 && z == 3) || (x == 2 && y == 2 && z == 4)); // UNKNOWN (intentionally)
return 0;
} | Test expsplit with multiple simultaneous splits | Test expsplit with multiple simultaneous splits
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
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 <[email protected]>
Auto-Submit: Heather Miller <[email protected]>
Reviewed-by: Eric Boren <[email protected]>
Commit-Queue: Eric Boren <[email protected]>
| C | bsd-3-clause | google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia |
bb0a2963f2d67428142b910abb2fd3168f7b0c44 | BitManipulation/Lonely_Integer.c | BitManipulation/Lonely_Integer.c | /*
Problem Statement
There are N integers in an array A. All but one integer occur in pairs. Your task is to find the number that occurs only once.
Input Format
The first line of the input contains an integer N, indicating the number of integers. The next line contains N space-separated integers that form the array A.
Constraints
1≤N<100
N % 2=1 (N is an odd number)
0≤A[i]≤100,∀i∈[1,N]
Output Format
Output S, the number that occurs only once.
Sample Input:1
1
1
Sample Output:1
1
Sample Input:2
3
1 1 2
Sample Output:2
2
Sample Input:3
5
0 0 1 2 1
Sample Output:3
2
Explanation
In the first input, we see only one element (1) and that element is the answer.
In the second input, we see three elements; 1 occurs at two places and 2 only once. Thus, the answer is 2.
In the third input, we see five elements. 1 and 0 occur twice. The element that occurs only once is 2.
*/
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <assert.h>
int lonelyinteger(int a_size, int* a) {
int result;
result = 0;
for(int i=0 ; i<a_size ; i++){
result = result ^ a[i];
}
return result;
}
int main() {
int res;
int _a_size, _a_i;
scanf("%d", &_a_size);
int _a[_a_size];
for(_a_i = 0; _a_i < _a_size; _a_i++) {
int _a_item;
scanf("%d", &_a_item);
_a[_a_i] = _a_item;
}
res = lonelyinteger(_a_size, _a);
printf("%d", res);
return 0;
}
| Add Bit Manipulation to find lonely integer by XOR trick | Add Bit Manipulation to find lonely integer by XOR trick
| C | mit | anaghajoshi/HackerRank |
|
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 |
53359adda7580cb506970956b48062741da051cd | tests/regression/36-apron/71-td3-self-abort-complex.c | tests/regression/36-apron/71-td3-self-abort-complex.c | // SKIP PARAM: --set ana.activated[+] apron
#include <pthread.h>
#include <assert.h>
int g = 1;
int h = 1;
pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
int x, y; // rand
pthread_mutex_lock(&A);
g = x;
h = x;
pthread_mutex_unlock(&A);
pthread_mutex_lock(&A);
pthread_mutex_unlock(&A);
pthread_mutex_lock(&A);
if (y)
g = x;
assert(g == h); // UNKNOWN?
pthread_mutex_unlock(&A);
return NULL;
}
int main(void) {
pthread_t id;
pthread_create(&id, NULL, t_fun, NULL);
return 0;
}
| Add TD3 test where complex self-abort causes verify error | Add TD3 test where complex self-abort causes verify error
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
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 |
28c25f82e59407a491bac10a4c53a322cfa9b0cc | tests/regression/13-privatized/52-refine-protected-loop2-small.c | tests/regression/13-privatized/52-refine-protected-loop2-small.c | #include <pthread.h>
#include <assert.h>
int g = 0;
pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER;
void *worker(void *arg )
{
while (1) {
pthread_mutex_lock(&A);
g = 1000;
assert(g != 0);
if (g > 0) {
g--;
}
pthread_mutex_unlock(&A);
// extra mutex makes mine-W more precise than mine-lazy
pthread_mutex_lock(&B);
pthread_mutex_unlock(&B);
}
return NULL;
}
int main(int argc , char **argv )
{
pthread_t tid;
pthread_create(& tid, NULL, & worker, NULL);
return 0;
}
| Add further simplification of 13/51 | Add further simplification of 13/51
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
eb0d91cfa278bceba3ec9a3fdcbc7c47a2ed3a3f | src/core/SkExchange.h | src/core/SkExchange.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 SkExchange_DEFINED
#define SkExchange_DEFINED
#include <utility>
namespace skstd {
// std::exchange is in C++14
template<typename T, typename U = T>
inline static T exchange(T& obj, U&& new_val) {
T old_val = std::move(obj);
obj = std::forward<U>(new_val);
return old_val;
}
}
#endif // SkExchange_DEFINED
| Add skstd version of std::exchange | Add skstd version of std::exchange
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2381793004
Review-Url: https://codereview.chromium.org/2381793004
| C | bsd-3-clause | HalCanary/skia-hc,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,google/skia,HalCanary/skia-hc,rubenvb/skia,aosp-mirror/platform_external_skia,rubenvb/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,HalCanary/skia-hc,google/skia,HalCanary/skia-hc,google/skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,rubenvb/skia,rubenvb/skia,HalCanary/skia-hc,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,google/skia,rubenvb/skia,rubenvb/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,rubenvb/skia,rubenvb/skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,HalCanary/skia-hc,google/skia,google/skia,Hikari-no-Tenshi/android_external_skia |
|
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 |
eef2154790600024c9ccc72da34392b841ff9f0d | tests/tests.h | tests/tests.h | //---------------------------- tests.h ---------------------------
// $Id$
// Version: $Name$
//
// Copyright (C) 2004 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
// to the file deal.II/doc/license.html for the text and
// further information on this license.
//
//---------------------------- tests.h ---------------------------
// common definitions used in all the tests
#include <base/logstream.h>
#include <cmath>
// overload floating point output operators for LogStream so that small
// numbers below a certain threshold are simply printed as zeros. this removes
// a number of possible places where output may differ depending on platform,
// compiler options, etc, simply because round-off is different.
LogStream & operator << (LogStream &logstream,
const double d)
{
if (std::fabs (d) < 1e-10)
logstream << 0.;
else
logstream << d;
return logstream;
}
LogStream & operator << (LogStream &logstream,
const float d)
{
if (std::fabs (d) < 1e-8)
logstream << 0.;
else
logstream << d;
return logstream;
}
| Add a file with common definitions to be used by all testcases. | Add a file with common definitions to be used by all testcases.
git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@8395 0785d39b-7218-0410-832d-ea1e28bc413d
| C | lgpl-2.1 | YongYang86/dealii,spco/dealii,Arezou-gh/dealii,gpitton/dealii,rrgrove6/dealii,mac-a/dealii,lue/dealii,ESeNonFossiIo/dealii,lpolster/dealii,ESeNonFossiIo/dealii,danshapero/dealii,mtezzele/dealii,nicolacavallini/dealii,sairajat/dealii,flow123d/dealii,JaeryunYim/dealii,YongYang86/dealii,andreamola/dealii,ibkim11/dealii,johntfoster/dealii,lue/dealii,natashasharma/dealii,spco/dealii,EGP-CIG-REU/dealii,ibkim11/dealii,flow123d/dealii,natashasharma/dealii,ESeNonFossiIo/dealii,ESeNonFossiIo/dealii,danshapero/dealii,adamkosik/dealii,lue/dealii,sriharisundar/dealii,rrgrove6/dealii,ESeNonFossiIo/dealii,YongYang86/dealii,msteigemann/dealii,andreamola/dealii,maieneuro/dealii,nicolacavallini/dealii,mtezzele/dealii,johntfoster/dealii,mtezzele/dealii,JaeryunYim/dealii,sairajat/dealii,mtezzele/dealii,gpitton/dealii,angelrca/dealii,adamkosik/dealii,shakirbsm/dealii,sriharisundar/dealii,Arezou-gh/dealii,flow123d/dealii,spco/dealii,maieneuro/dealii,danshapero/dealii,adamkosik/dealii,flow123d/dealii,andreamola/dealii,adamkosik/dealii,mac-a/dealii,lpolster/dealii,msteigemann/dealii,Arezou-gh/dealii,jperryhouts/dealii,sairajat/dealii,adamkosik/dealii,spco/dealii,johntfoster/dealii,johntfoster/dealii,natashasharma/dealii,sairajat/dealii,nicolacavallini/dealii,natashasharma/dealii,lue/dealii,ibkim11/dealii,ibkim11/dealii,andreamola/dealii,natashasharma/dealii,JaeryunYim/dealii,spco/dealii,JaeryunYim/dealii,andreamola/dealii,lue/dealii,angelrca/dealii,johntfoster/dealii,mac-a/dealii,sriharisundar/dealii,andreamola/dealii,lue/dealii,flow123d/dealii,angelrca/dealii,Arezou-gh/dealii,pesser/dealii,EGP-CIG-REU/dealii,flow123d/dealii,JaeryunYim/dealii,maieneuro/dealii,angelrca/dealii,naliboff/dealii,nicolacavallini/dealii,natashasharma/dealii,shakirbsm/dealii,danshapero/dealii,ibkim11/dealii,kalj/dealii,shakirbsm/dealii,mac-a/dealii,Arezou-gh/dealii,YongYang86/dealii,Arezou-gh/dealii,sairajat/dealii,kalj/dealii,pesser/dealii,sriharisundar/dealii,shakirbsm/dealii,johntfoster/dealii,naliboff/dealii,sriharisundar/dealii,maieneuro/dealii,jperryhouts/dealii,nicolacavallini/dealii,YongYang86/dealii,mac-a/dealii,natashasharma/dealii,mtezzele/dealii,gpitton/dealii,andreamola/dealii,flow123d/dealii,YongYang86/dealii,adamkosik/dealii,ESeNonFossiIo/dealii,EGP-CIG-REU/dealii,lpolster/dealii,nicolacavallini/dealii,lpolster/dealii,jperryhouts/dealii,kalj/dealii,Arezou-gh/dealii,danshapero/dealii,msteigemann/dealii,pesser/dealii,lpolster/dealii,mac-a/dealii,spco/dealii,shakirbsm/dealii,jperryhouts/dealii,mtezzele/dealii,rrgrove6/dealii,ibkim11/dealii,EGP-CIG-REU/dealii,kalj/dealii,maieneuro/dealii,maieneuro/dealii,mac-a/dealii,YongYang86/dealii,shakirbsm/dealii,shakirbsm/dealii,naliboff/dealii,maieneuro/dealii,pesser/dealii,msteigemann/dealii,rrgrove6/dealii,lpolster/dealii,lpolster/dealii,angelrca/dealii,naliboff/dealii,jperryhouts/dealii,nicolacavallini/dealii,lue/dealii,sriharisundar/dealii,mtezzele/dealii,ESeNonFossiIo/dealii,kalj/dealii,angelrca/dealii,msteigemann/dealii,johntfoster/dealii,gpitton/dealii,EGP-CIG-REU/dealii,msteigemann/dealii,JaeryunYim/dealii,sairajat/dealii,JaeryunYim/dealii,ibkim11/dealii,pesser/dealii,jperryhouts/dealii,EGP-CIG-REU/dealii,pesser/dealii,naliboff/dealii,naliboff/dealii,kalj/dealii,sriharisundar/dealii,pesser/dealii,adamkosik/dealii,EGP-CIG-REU/dealii,jperryhouts/dealii,gpitton/dealii,rrgrove6/dealii,sairajat/dealii,gpitton/dealii,danshapero/dealii,naliboff/dealii,spco/dealii,rrgrove6/dealii,msteigemann/dealii,angelrca/dealii,danshapero/dealii,gpitton/dealii,kalj/dealii,rrgrove6/dealii |
|
7aabc4f6c8893ba6c1480ae6064182fc6ceed04c | kernel/muen/muen-poll.c | kernel/muen/muen-poll.c | /*
* Copyright (c) 2017 Contributors as noted in the AUTHORS file
*
* This file is part of Solo5, a unikernel base layer.
*
* Permission to use, copy, modify, and/or distribute this software
* for any purpose with or without fee is hereby granted, provided
* that the above copyright notice and this permission notice appear
* in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "../kernel.h"
#include "muen-net.h"
int solo5_poll(uint64_t until_nsecs)
{
int rc = 0;
do {
if (muen_net_pending_data()) {
rc = 1;
break;
}
__asm__ __volatile__("pause");
} while (solo5_clock_monotonic() < until_nsecs);
if (muen_net_pending_data()) {
rc = 1;
}
return rc;
}
| Add poll implementation for Muen | Add poll implementation for Muen
| C | isc | djwillia/solo5,mato/solo5,djwillia/solo5,Solo5/solo5,Weichen81/solo5,Weichen81/solo5,mato/solo5,mato/solo5,Solo5/solo5,djwillia/solo5,Weichen81/solo5 |
|
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 <[email protected]>
| 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 |
8983b37067d80a462f9ff58b04f37832d5e06365 | digital_clock.c | digital_clock.c | #include <wiringPi.h>
#include <stdio.h>
#include <stdlib.h>
#include "PCD8544.h"
int pin_sclk = 4;
int pin_din = 3;
int pin_dc = 2;
int pin_rst = 0;
int pin_ce = 1;
// This is already tuned
int lcd_contrast = 60;
char timeString[9];
void cleanup(void)
{
pinMode(pin_sclk, INPUT);
pinMode(pin_din, INPUT);
pinMode(pin_dc, INPUT);
pinMode(pin_rst, INPUT);
pinMode(pin_ce, INPUT);
}
char * get_time(void)
{
time_t current_time;
struct tm * time_info;
time(¤t_time);
time_info = localtime(¤t_time);
strftime(timeString, sizeof(timeString), "%H:%M:%S", time_info);
// printf("%s\n", &timeString);
return &timeString;
}
int main(int argc, char const *argv[])
{
printf("nLCD tool\n");
printf("Pin definations:\n");
printf("CLK on %i\n", pin_sclk);
printf("DIN on %i\n", pin_din);
printf("DC on %i\n", pin_dc);
printf("CE on %i\n", pin_ce);
printf("RST on %i\n", pin_rst);
if (wiringPiSetup() == -1)
{
printf("wiringPi error\n");
exit(1);
}
LCDInit(pin_sclk, pin_din, pin_dc, pin_ce, pin_rst, lcd_contrast);
LCDcommand(PCD8544_DISPLAYCONTROL | PCD8544_DISPLAYALLON);
LCDdisplay();
LCDclear();
LCDcommand(PCD8544_DISPLAYCONTROL | PCD8544_DISPLAYNORMAL);
while (1)
{
LCDdrawrect(6 - 1, 6 - 1, LCDWIDTH - 6, LCDHEIGHT - 6, BLACK);
LCDdrawstring(12, 12, get_time());
LCDdisplay();
delay(1000);
// LCDclear();
}
LCDclear();
cleanup();
return 0;
}
| Add simple digital clock example | Add simple digital clock example
| C | lgpl-2.1 | JokerQyou/nlcd |
|
d0a6e12ee14f1ae039a16d0f724846541a836cb5 | src/md5.h | src/md5.h | /**
* Copyright (c) 2015, Chao Wang <[email protected]>
*
* 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 <[email protected]>
*
* 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 |
adbab433f0df9179cd0ce060e55c5e1b3f9f094b | src/app/qmlvideofilter/QVideoFrameScopeMap.h | src/app/qmlvideofilter/QVideoFrameScopeMap.h | #ifndef Q_VIDEO_FRAME_SCOPE_MAP
#define Q_VIDEO_FRAME_SCOPE_MAP 1
// TODO: move to QVideoFrameScope
struct QVideoFrameScopeMap
{
QVideoFrameScopeMap(QVideoFrame *frame, QAbstractVideoBuffer::MapMode mode) : frame(frame)
{
if(frame)
{
status = frame->map(mode);
if (!status)
{
qWarning("Can't map!");
}
}
}
~QVideoFrameScopeMap()
{
if(frame)
{
frame->unmap();
}
}
operator bool() const { return status; }
QVideoFrame *frame = nullptr;
bool status = false;
};
#endif // Q_VIDEO_FRAME_SCOPE_MAP
| Move the QVideoFrame scope lock to a header file | Move the QVideoFrame scope lock to a header file
| C | bsd-3-clause | headupinclouds/gatherer,headupinclouds/gatherer,headupinclouds/gatherer,headupinclouds/gatherer |
|
beccc92af8ff19dacd41014d016af304b25eec3d | CNFGDriver.c | CNFGDriver.c | #if defined(WINDOWS) || defined(WIN32) || defined(WIN64)
#include "CNFGWinDriver.c"
#elif defined( __android__ )
#include "CNFGOGLEGLDriver.c"
#else
#include "CNFGXDriver.c"
#endif
| Add feature letting you include one .c file which automatically selects the driver. | Add feature letting you include one .c file which automatically selects the driver.
| C | mit | cnlohr/rawdraw,cnlohr/rawdraw |
|
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 <[email protected]>
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 <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
| 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 <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/307042
Reviewed-by: Vincent Palatin <[email protected]>
| 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 |
5df51532660f881a1c5f1122cd52410559780f17 | benchmark/bench-result-set-raw.c | benchmark/bench-result-set-raw.c | /*
Copyright (C) 2015-2019 Sutou Kouhei <[email protected]>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License version 2.1 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <groonga.h>
int
main(int argc, char **argv)
{
grn_rc rc;
grn_ctx ctx;
int n = 10000000;
rc = grn_init();
if (rc != GRN_SUCCESS) {
printf("failed to initialize Groonga: <%d>: %s\n",
rc, grn_get_global_error_message());
return EXIT_FAILURE;
}
grn_ctx_init(&ctx, 0);
grn_obj *db = grn_db_open(&ctx, "db/db");
if (ctx.rc != GRN_SUCCESS) {
printf("failed to open database: <%d>: %s\n",
rc, grn_get_global_error_message());
return EXIT_FAILURE;
}
grn_obj *source_table = grn_ctx_get(&ctx, "Sources", -1);
grn_obj *result_set = grn_table_create(&ctx,
NULL, 0, NULL,
GRN_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC,
source_table,
NULL);
grn_timeval start;
grn_timeval_now(&ctx, &start);
for (int i = 0; i < n; i++) {
grn_id id = i;
grn_hash_add(&ctx, (grn_hash *)result_set, &id, sizeof(grn_id), NULL, NULL);
}
grn_timeval end;
grn_timeval_now(&ctx, &end);
double elapsed =
(end.tv_sec + (end.tv_nsec / GRN_TIME_NSEC_PER_SEC_F)) -
(start.tv_sec + (start.tv_nsec / GRN_TIME_NSEC_PER_SEC_F));
printf("%f:%d\n", elapsed, grn_table_size(&ctx, result_set));
grn_obj_close(&ctx, result_set);
grn_obj_close(&ctx, db);
grn_ctx_fin(&ctx);
grn_fin();
return EXIT_SUCCESS;
}
| Add result set benchmark program without GLib | Add result set benchmark program without GLib
| C | lgpl-2.1 | komainu8/groonga,groonga/groonga,groonga/groonga,kenhys/groonga,groonga/groonga,komainu8/groonga,groonga/groonga,kenhys/groonga,kenhys/groonga,kenhys/groonga,groonga/groonga,naoa/groonga,komainu8/groonga,naoa/groonga,komainu8/groonga,kenhys/groonga,komainu8/groonga,kenhys/groonga,komainu8/groonga,kenhys/groonga,komainu8/groonga,naoa/groonga,komainu8/groonga,naoa/groonga,groonga/groonga,groonga/groonga,naoa/groonga,kenhys/groonga,naoa/groonga,groonga/groonga,naoa/groonga,naoa/groonga |
|
2bc66f36fe9c019dceaa001aa9a5a061dae25abe | tests/regression/02-base/90-memcpy.c | tests/regression/02-base/90-memcpy.c |
// Test case taken from sqlite3.c
#include <string.h>
typedef unsigned long u64;
# define EXP754 (((u64)0x7ff)<<52)
# define MAN754 ((((u64)1)<<52)-1)
# define IsNaN(X) (((X)&EXP754)==EXP754 && ((X)&MAN754)!=0)
static int sqlite3IsNaN(double x){
int rc; /* The value return */
u64 y;
memcpy(&y,&x,sizeof(y)); // Goblint used to crash here
rc = IsNaN(y);
return rc;
}
int main(){
sqlite3IsNaN(23.0);
return 0;
}
| Add test case that makes goblint crash | Add test case that makes goblint crash
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
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 |
a023e3cc0b361824d896c5eeb56dccdaa4555b6b | fileops/filecreation.c | fileops/filecreation.c | /*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* This program is used to create many empty files for testing file system performance
*/
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#define MAX_COUNT 100000
const char alphanum[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
void gen_random(char *s, const int len)
{
int i;
for (i = 0; i < len; i++) {
s[i] = alphanum[rand() % (sizeof(alphanum) - 1)];
}
s[len] = 0;
}
int main()
{
int i;
FILE *f;
char fname[15];
time_t start, end;
time(&start);
for (i = 0; i < MAX_COUNT; i++) {
gen_random(fname, 15);
f = fopen(fname, "w");
if (f != NULL) {
fclose(f);
} else {
perror("Error creating file\n");
exit(1);
}
}
time(&end);
printf("Time taken %f\n", difftime(end, start));
return 0;
}
| Add program to create a lot of files in a directory | Add program to create a lot of files in a directory
Useful for testing file system performance
Signed-off-by: Prashant P Shah <[email protected]>
| C | cc0-1.0 | prashants/tools,prashants/tools,prashants/tools |
|
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 |
0c93228d8a9028d03c22a122e464c51b57ff51a5 | problem_003.c | problem_003.c | /*
* he prime factors of 13195 are 5, 7, 13 and 29.
*
* What is the largest prime factor of the number 600851475143 ?
*/
#include <stdio.h>
int
main(int argc, char **argv)
{
long long int num = 600851475143;
int x;
for(x = 2; x < num; x++) {
if(num % x == 0) {
num /= x;
x--;
}
}
printf("%i\n", x);
return 0;
}
| Add solution for problem 3 | Add solution for problem 3
| C | bsd-2-clause | skreuzer/euler |
|
935972a87170e1e79de28573018e7588238c3d75 | problem_009.c | problem_009.c | #include <stdio.h>
#include <stdint.h>
#include "euler.h"
#define PROBLEM 9
#define ANSWER 31875000
int
main(int argc, char **argv)
{
int a, b, c, a2, b2, c2;
int product = 0;
for(a = 1; a < 1000; a++) {
for(b = 1; b < 1000; b++) {
a2 = a * a;
b2 = b * b;
for(c = 1; c < 1000; c++) {
c2 = c * c;
if((a2 + b2 == c2) && (a + b + c == 1000)) {
product = a * b * c;
}
}
}
}
return check(PROBLEM, ANSWER, product);
}
| Add a solution for problem 9 | Add a solution for problem 9
| C | bsd-2-clause | skreuzer/euler |
|
33e85ca6a9881e511a989e4396d4f5f861073c68 | simple-thread.c | simple-thread.c | #include <stdio.h>
#include <assert.h>
#include "uv.h"
static uv_thread_t thread;
static void thread_cb(void* arg) {
printf("hello thread!\n");
}
int main() {
int r = uv_thread_create(&thread, thread_cb, NULL);
assert(r == 0);
/* pause execution of this thread until the spawned thread has had
* time to finish execution. */
uv_thread_join(&thread);
return 0;
}
| Add super simple thread creation case | Add super simple thread creation case
| C | mit | trevnorris/libuv-examples |
|
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 |
86b46cab1683a68b3f34478d1e8465ebb1ea3a96 | include/swift/ABI/Class.h | include/swift/ABI/Class.h | //===--- Class.h - Compiler/runtime class-metadata values -------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This header provides target-independent information about class
// metadata.
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_ABI_CLASS_H
#define SWIFT_ABI_CLASS_H
#include <stdint.h>
namespace swift {
/// Flags which
enum class ClassFlags : uint32_t {
/// This class is a meta-class.
Meta = 0x00001,
/// This class is a root class.
Root = 0x00002,
/// This class provides a non-trivial .cxx_construct or .cxx_destruct
/// implementation.
HasCXXStructors = 0x00004,
/// This class has hidden visibility.
Hidden = 0x00010,
/// This class has the exception attribute.
Exception = 0x00020,
/// (Obsolete) ARC-specific: this class has a .release_ivars method
HasIvarReleaser = 0x00040,
/// This class implementation was compiled under ARC.
CompiledByARC = 0x00080,
/// This class provides a non-trivial .cxx_destruct method, but
/// its .cxx_construct is trivial. For backwards compatibility,
/// when setting this flag, HasCXXStructors must be set as well.
HasCXXDestructorOnly = 0x00100
};
inline ClassFlags &operator|=(ClassFlags &lhs, ClassFlags rhs) {
lhs = ClassFlags(uint32_t(lhs) | uint32_t(rhs));
return lhs;
}
inline ClassFlags operator|(ClassFlags lhs, ClassFlags rhs) {
return (lhs |= rhs);
}
}
#endif
| Add a file for some ObjC class ABI constants. | Add a file for some ObjC class ABI constants.
Swift SVN r3474
| C | apache-2.0 | jtbandes/swift,lorentey/swift,JGiola/swift,ken0nek/swift,atrick/swift,austinzheng/swift,atrick/swift,sdulal/swift,swiftix/swift.old,MukeshKumarS/Swift,jtbandes/swift,dduan/swift,deyton/swift,uasys/swift,shajrawi/swift,zisko/swift,kstaring/swift,felix91gr/swift,karwa/swift,lorentey/swift,rudkx/swift,stephentyrone/swift,danielmartin/swift,gmilos/swift,manavgabhawala/swift,tinysun212/swift-windows,djwbrown/swift,lorentey/swift,ken0nek/swift,kentya6/swift,Ivacker/swift,lorentey/swift,CodaFi/swift,ben-ng/swift,atrick/swift,karwa/swift,roambotics/swift,felix91gr/swift,shahmishal/swift,jmgc/swift,adrfer/swift,kperryua/swift,mightydeveloper/swift,practicalswift/swift,adrfer/swift,cbrentharris/swift,hughbe/swift,apple/swift,nathawes/swift,devincoughlin/swift,huonw/swift,amraboelela/swift,therealbnut/swift,shahmishal/swift,danielmartin/swift,modocache/swift,hooman/swift,gmilos/swift,Ivacker/swift,hughbe/swift,aschwaighofer/swift,tardieu/swift,jckarter/swift,gribozavr/swift,devincoughlin/swift,modocache/swift,MukeshKumarS/Swift,brentdax/swift,milseman/swift,gmilos/swift,adrfer/swift,natecook1000/swift,CodaFi/swift,calebd/swift,benlangmuir/swift,ben-ng/swift,LeoShimonaka/swift,austinzheng/swift,sschiau/swift,SwiftAndroid/swift,benlangmuir/swift,swiftix/swift,allevato/swift,ben-ng/swift,xedin/swift,practicalswift/swift,LeoShimonaka/swift,dreamsxin/swift,lorentey/swift,devincoughlin/swift,return/swift,tkremenek/swift,MukeshKumarS/Swift,Jnosh/swift,atrick/swift,tkremenek/swift,gribozavr/swift,aschwaighofer/swift,dreamsxin/swift,OscarSwanros/swift,gregomni/swift,karwa/swift,bitjammer/swift,JaSpa/swift,codestergit/swift,OscarSwanros/swift,gottesmm/swift,codestergit/swift,kstaring/swift,tkremenek/swift,huonw/swift,mightydeveloper/swift,kentya6/swift,frootloops/swift,sschiau/swift,johnno1962d/swift,harlanhaskins/swift,jtbandes/swift,JaSpa/swift,jmgc/swift,bitjammer/swift,therealbnut/swift,russbishop/swift,austinzheng/swift,zisko/swift,alblue/swift,xwu/swift,natecook1000/swift,lorentey/swift,IngmarStein/swift,karwa/swift,devincoughlin/swift,modocache/swift,frootloops/swift,nathawes/swift,amraboelela/swift,parkera/swift,uasys/swift,gregomni/swift,shahmishal/swift,parkera/swift,roambotics/swift,tjw/swift,bitjammer/swift,stephentyrone/swift,LeoShimonaka/swift,benlangmuir/swift,jopamer/swift,swiftix/swift.old,danielmartin/swift,rudkx/swift,djwbrown/swift,Ivacker/swift,natecook1000/swift,huonw/swift,frootloops/swift,khizkhiz/swift,tkremenek/swift,khizkhiz/swift,Ivacker/swift,harlanhaskins/swift,stephentyrone/swift,LeoShimonaka/swift,shajrawi/swift,gregomni/swift,aschwaighofer/swift,karwa/swift,amraboelela/swift,aschwaighofer/swift,manavgabhawala/swift,therealbnut/swift,benlangmuir/swift,johnno1962d/swift,xedin/swift,ben-ng/swift,djwbrown/swift,codestergit/swift,russbishop/swift,calebd/swift,tjw/swift,tardieu/swift,aschwaighofer/swift,kstaring/swift,tjw/swift,kperryua/swift,emilstahl/swift,zisko/swift,swiftix/swift.old,SwiftAndroid/swift,sdulal/swift,russbishop/swift,uasys/swift,JGiola/swift,apple/swift,MukeshKumarS/Swift,aschwaighofer/swift,sschiau/swift,ken0nek/swift,nathawes/swift,gregomni/swift,tkremenek/swift,huonw/swift,zisko/swift,tardieu/swift,Jnosh/swift,shahmishal/swift,parkera/swift,kentya6/swift,calebd/swift,emilstahl/swift,jckarter/swift,hughbe/swift,hooman/swift,nathawes/swift,brentdax/swift,JGiola/swift,deyton/swift,devincoughlin/swift,shajrawi/swift,brentdax/swift,xedin/swift,johnno1962d/swift,xedin/swift,tjw/swift,frootloops/swift,natecook1000/swift,emilstahl/swift,jmgc/swift,apple/swift,parkera/swift,frootloops/swift,modocache/swift,return/swift,huonw/swift,JGiola/swift,bitjammer/swift,roambotics/swift,manavgabhawala/swift,natecook1000/swift,modocache/swift,allevato/swift,danielmartin/swift,deyton/swift,OscarSwanros/swift,cbrentharris/swift,roambotics/swift,danielmartin/swift,uasys/swift,gribozavr/swift,xwu/swift,calebd/swift,gribozavr/swift,gottesmm/swift,KrishMunot/swift,swiftix/swift.old,JaSpa/swift,harlanhaskins/swift,sschiau/swift,nathawes/swift,atrick/swift,gottesmm/swift,shahmishal/swift,karwa/swift,swiftix/swift,gribozavr/swift,xedin/swift,JGiola/swift,glessard/swift,kusl/swift,airspeedswift/swift,kperryua/swift,gregomni/swift,therealbnut/swift,practicalswift/swift,zisko/swift,bitjammer/swift,khizkhiz/swift,cbrentharris/swift,ken0nek/swift,kentya6/swift,mightydeveloper/swift,emilstahl/swift,kperryua/swift,manavgabhawala/swift,dduan/swift,ahoppen/swift,codestergit/swift,shahmishal/swift,felix91gr/swift,tardieu/swift,swiftix/swift,alblue/swift,swiftix/swift,rudkx/swift,uasys/swift,gottesmm/swift,hooman/swift,IngmarStein/swift,russbishop/swift,CodaFi/swift,jmgc/swift,kentya6/swift,natecook1000/swift,kentya6/swift,KrishMunot/swift,austinzheng/swift,return/swift,kentya6/swift,austinzheng/swift,deyton/swift,arvedviehweger/swift,airspeedswift/swift,kstaring/swift,emilstahl/swift,slavapestov/swift,felix91gr/swift,dduan/swift,allevato/swift,ben-ng/swift,stephentyrone/swift,gottesmm/swift,ahoppen/swift,hughbe/swift,ken0nek/swift,apple/swift,emilstahl/swift,therealbnut/swift,stephentyrone/swift,djwbrown/swift,danielmartin/swift,IngmarStein/swift,russbishop/swift,swiftix/swift.old,MukeshKumarS/Swift,gribozavr/swift,sdulal/swift,adrfer/swift,natecook1000/swift,jopamer/swift,KrishMunot/swift,glessard/swift,zisko/swift,practicalswift/swift,hooman/swift,jopamer/swift,tinysun212/swift-windows,airspeedswift/swift,sschiau/swift,roambotics/swift,arvedviehweger/swift,codestergit/swift,practicalswift/swift,stephentyrone/swift,tinysun212/swift-windows,Jnosh/swift,KrishMunot/swift,xedin/swift,lorentey/swift,felix91gr/swift,shajrawi/swift,allevato/swift,sdulal/swift,jmgc/swift,Jnosh/swift,hughbe/swift,adrfer/swift,khizkhiz/swift,jtbandes/swift,kentya6/swift,brentdax/swift,xedin/swift,rudkx/swift,karwa/swift,kusl/swift,harlanhaskins/swift,modocache/swift,mightydeveloper/swift,gmilos/swift,jopamer/swift,jckarter/swift,OscarSwanros/swift,gribozavr/swift,return/swift,codestergit/swift,OscarSwanros/swift,deyton/swift,slavapestov/swift,benlangmuir/swift,kperryua/swift,jckarter/swift,Ivacker/swift,allevato/swift,calebd/swift,ahoppen/swift,tardieu/swift,shajrawi/swift,adrfer/swift,milseman/swift,jckarter/swift,glessard/swift,shajrawi/swift,harlanhaskins/swift,Ivacker/swift,nathawes/swift,calebd/swift,alblue/swift,kstaring/swift,gmilos/swift,tjw/swift,practicalswift/swift,parkera/swift,LeoShimonaka/swift,tjw/swift,dduan/swift,JaSpa/swift,nathawes/swift,SwiftAndroid/swift,lorentey/swift,Jnosh/swift,devincoughlin/swift,tinysun212/swift-windows,LeoShimonaka/swift,JaSpa/swift,johnno1962d/swift,MukeshKumarS/Swift,jtbandes/swift,jckarter/swift,atrick/swift,airspeedswift/swift,slavapestov/swift,milseman/swift,apple/swift,russbishop/swift,practicalswift/swift,gottesmm/swift,uasys/swift,glessard/swift,gmilos/swift,manavgabhawala/swift,CodaFi/swift,amraboelela/swift,codestergit/swift,alblue/swift,sdulal/swift,ahoppen/swift,shajrawi/swift,gribozavr/swift,khizkhiz/swift,SwiftAndroid/swift,alblue/swift,hooman/swift,therealbnut/swift,LeoShimonaka/swift,ken0nek/swift,amraboelela/swift,JaSpa/swift,devincoughlin/swift,huonw/swift,airspeedswift/swift,swiftix/swift,glessard/swift,jopamer/swift,airspeedswift/swift,cbrentharris/swift,hooman/swift,frootloops/swift,slavapestov/swift,IngmarStein/swift,OscarSwanros/swift,therealbnut/swift,stephentyrone/swift,arvedviehweger/swift,kperryua/swift,SwiftAndroid/swift,brentdax/swift,uasys/swift,djwbrown/swift,arvedviehweger/swift,apple/swift,swiftix/swift.old,KrishMunot/swift,return/swift,cbrentharris/swift,CodaFi/swift,xedin/swift,Jnosh/swift,mightydeveloper/swift,ahoppen/swift,tkremenek/swift,gregomni/swift,emilstahl/swift,IngmarStein/swift,milseman/swift,swiftix/swift.old,jckarter/swift,kusl/swift,felix91gr/swift,brentdax/swift,milseman/swift,ben-ng/swift,cbrentharris/swift,shahmishal/swift,sdulal/swift,karwa/swift,tinysun212/swift-windows,slavapestov/swift,hughbe/swift,allevato/swift,Ivacker/swift,parkera/swift,return/swift,mightydeveloper/swift,austinzheng/swift,rudkx/swift,felix91gr/swift,alblue/swift,benlangmuir/swift,KrishMunot/swift,xwu/swift,emilstahl/swift,huonw/swift,cbrentharris/swift,khizkhiz/swift,tinysun212/swift-windows,ken0nek/swift,xwu/swift,KrishMunot/swift,xwu/swift,IngmarStein/swift,gmilos/swift,johnno1962d/swift,brentdax/swift,mightydeveloper/swift,sschiau/swift,jtbandes/swift,tardieu/swift,swiftix/swift,aschwaighofer/swift,Ivacker/swift,sdulal/swift,zisko/swift,jmgc/swift,Jnosh/swift,devincoughlin/swift,dduan/swift,ahoppen/swift,ben-ng/swift,slavapestov/swift,frootloops/swift,mightydeveloper/swift,manavgabhawala/swift,kusl/swift,djwbrown/swift,harlanhaskins/swift,modocache/swift,tkremenek/swift,kusl/swift,dduan/swift,CodaFi/swift,kusl/swift,amraboelela/swift,kusl/swift,johnno1962d/swift,sschiau/swift,JGiola/swift,milseman/swift,deyton/swift,OscarSwanros/swift,bitjammer/swift,swiftix/swift.old,johnno1962d/swift,kstaring/swift,SwiftAndroid/swift,slavapestov/swift,alblue/swift,SwiftAndroid/swift,dduan/swift,hooman/swift,gottesmm/swift,bitjammer/swift,kusl/swift,tinysun212/swift-windows,roambotics/swift,parkera/swift,shajrawi/swift,harlanhaskins/swift,khizkhiz/swift,airspeedswift/swift,jtbandes/swift,calebd/swift,return/swift,danielmartin/swift,swiftix/swift,arvedviehweger/swift,hughbe/swift,milseman/swift,cbrentharris/swift,allevato/swift,adrfer/swift,djwbrown/swift,parkera/swift,CodaFi/swift,shahmishal/swift,xwu/swift,jopamer/swift,kperryua/swift,arvedviehweger/swift,arvedviehweger/swift,tjw/swift,LeoShimonaka/swift,glessard/swift,IngmarStein/swift,practicalswift/swift,MukeshKumarS/Swift,sdulal/swift,amraboelela/swift,rudkx/swift,deyton/swift,xwu/swift,austinzheng/swift,sschiau/swift,JaSpa/swift,jopamer/swift,kstaring/swift,manavgabhawala/swift,tardieu/swift,jmgc/swift,russbishop/swift |
|
8668174b5db5a471a5da1dbf7c9816bd18e561c9 | io/socket/simple_server.h | io/socket/simple_server.h | #ifndef IO_SOCKET_SIMPLE_SERVER_H
#define IO_SOCKET_SIMPLE_SERVER_H
#include <io/socket/socket.h>
/*
* XXX
* This is just one level up from using macros. Would be nice to use abstract
* base classes and something a bit tidier.
*/
template<typename A, typename C, typename L>
class SimpleServer {
LogHandle log_;
A arg_;
L *server_;
Action *accept_action_;
Action *close_action_;
Action *stop_action_;
public:
SimpleServer(LogHandle log, A arg, SocketAddressFamily family, const std::string& interface)
: log_(log),
arg_(arg),
server_(NULL),
accept_action_(NULL),
close_action_(NULL),
stop_action_(NULL)
{
server_ = L::listen(family, interface);
if (server_ == NULL)
HALT(log_) << "Unable to create listener.";
INFO(log_) << "Listening on: " << server_->getsockname();
EventCallback *cb = callback(this, &SimpleServer::accept_complete);
accept_action_ = server_->accept(cb);
Callback *scb = callback(this, &SimpleServer::stop);
stop_action_ = EventSystem::instance()->register_interest(EventInterestStop, scb);
}
~SimpleServer()
{
ASSERT(server_ == NULL);
ASSERT(accept_action_ == NULL);
ASSERT(close_action_ == NULL);
ASSERT(stop_action_ == NULL);
}
private:
void accept_complete(Event e)
{
accept_action_->cancel();
accept_action_ = NULL;
switch (e.type_) {
case Event::Done:
break;
case Event::Error:
ERROR(log_) << "Accept error: " << e;
break;
default:
ERROR(log_) << "Unexpected event: " << e;
break;
}
if (e.type_ == Event::Done) {
Socket *client = (Socket *)e.data_;
INFO(log_) << "Accepted client: " << client->getpeername();
new C(arg_, client);
}
EventCallback *cb = callback(this, &SimpleServer::accept_complete);
accept_action_ = server_->accept(cb);
}
void close_complete(void)
{
close_action_->cancel();
close_action_ = NULL;
ASSERT(server_ != NULL);
delete server_;
server_ = NULL;
delete this;
}
void stop(void)
{
stop_action_->cancel();
stop_action_ = NULL;
accept_action_->cancel();
accept_action_ = NULL;
ASSERT(close_action_ == NULL);
Callback *cb = callback(this, &SimpleServer::close_complete);
close_action_ = server_->close(cb);
}
};
#endif /* !IO_SOCKET_SIMPLE_SERVER_H */
| Add a simple server abstraction. | Add a simple server abstraction.
| C | bsd-2-clause | wanproxy/wanproxy,wanproxy/wanproxy,wanproxy/wanproxy |
|
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 |
4daf51b49667359b113d43fa859967cfe63858de | examples/badness.c | examples/badness.c | #include "rmc.h"
extern int coin(void);
// A test that should be really bad because exponents.
// Only takes like a minute or so!
void welp(int *p, int *q) {
VEDGE(a, b);
L(a, *p = 1);
if (coin()){}
if (coin()){}
if (coin()){}
if (coin()){}
// 4
if (coin()){}
if (coin()){}
if (coin()){}
if (coin()){}
// 8
if (coin()){}
if (coin()){}
if (coin()){}
if (coin()){}
if (coin()){}
if (coin()){}
if (coin()){}
if (coin()){}
// 16
L(b, *q = 1);
}
| Implement a test that demonstrates the exponential blowup of our system | Implement a test that demonstrates the exponential blowup of our system
| C | mit | msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler |
|
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 <[email protected]>
| C | apache-2.0 | google/CFU-Playground,google/CFU-Playground,google/CFU-Playground,google/CFU-Playground |
89cbba52eea1a2ea2c806872b04a3b300f0004da | assembly/printconst.c | assembly/printconst.c | /*
* printconst - Read a constant and print it
*
* Written in 2012 by Prashant P Shah <[email protected]>
*
* To the extent possible under law, the author(s) have dedicated
* all copyright and related and neighboring rights to this software
* to the public domain worldwide. This software is distributed
* without any warranty.
*
* You should have received a copy of the CC0 Public Domain Dedication
* along with this software.
* If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
*/
#include <stdio.h>
int main(int argc, char *argv[])
{
int val = 0;
asm("MOV $100, %0" : "=r"(val));
printf("val = %d\n", val);
return 0;
}
| Copy a constant value to a variable and print it | Copy a constant value to a variable and print it
Signed-off-by: Prashant Shah <[email protected]>
| C | cc0-1.0 | prashants/c |
|
4491397558ef396e81657cae7a2b9e6a4917a1ae | kernel/include/dennix/kernel/hashtable.h | kernel/include/dennix/kernel/hashtable.h | /* Copyright (c) 2021 Dennis Wölfing
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* kernel/include/dennix/kernel/hashtable.h
* Hash table.
*/
#ifndef KERNEL_HASHTABLE_H
#define KERNEL_HASHTABLE_H
#include <string.h>
#include <dennix/kernel/kernel.h>
// The type T must have a function hashKey() returning a unique TKey. It also
// needs to have a member T* nextInHashTable that is managed by the hash table.
// An object can only be member of one hash table at a time. That way we can
// implement the hash table in a way that operations cannot fail.
template <typename T, typename TKey = size_t>
class HashTable {
public:
HashTable(size_t capacity, T* buffer[]) {
table = buffer;
memset(table, 0, capacity * sizeof(T*));
this->capacity = capacity;
}
void add(T* object) {
size_t hash = object->hashKey() % capacity;
object->nextInHashTable = table[hash];
table[hash] = object;
}
T* get(TKey key) {
size_t hash = key % capacity;
T* obj = table[hash];
while (obj) {
if (obj->hashKey() == key) {
return obj;
}
obj = obj->nextInHashTable;
}
return nullptr;
}
void remove(TKey key) {
size_t hash = key % capacity;
T* obj = table[hash];
if (obj->hashKey() == key) {
table[hash] = obj->nextInHashTable;
return;
}
while (obj->nextInHashTable) {
T* next = obj->nextInHashTable;
if (next->hashKey() == key) {
obj->nextInHashTable = next->nextInHashTable;
return;
}
obj = next;
}
}
private:
T** table;
size_t capacity;
};
#endif
| Implement a hash table in the kernel. | Implement a hash table in the kernel.
| C | isc | dennis95/dennix,dennis95/dennix,dennis95/dennix |
|
4ef8edb2ea08f08fcaf8056909d014ccae1e6455 | cc1/tests/test034.c | cc1/tests/test034.c |
/*
name: TEST034
description: Basic test for incomplete structures
output:
X3 S2 x
F4 I E
X5 F4 foo
G6 F4 main
{
\
X7 S2 x
r X7 'P #P0 !I
}
G5 F4 foo
{
\
X3 M9 .I #I0 :I
r X3 M9 .I
}
*/
extern struct X x;
int foo();
int main()
{
extern struct X x;
return &x != 0;
}
struct X {int v;};
int foo()
{
x.v = 0;
return x.v;
}
| Add basic test for incomplete structs | Add basic test for incomplete structs
| C | mit | 8l/scc,k0gaMSX/kcc,k0gaMSX/scc,k0gaMSX/scc,k0gaMSX/kcc,8l/scc,8l/scc,k0gaMSX/scc |
|
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 |
283fd795b2c1d6f43de7ff88ef27167b24e46974 | Code/ApplicationEngine/otbWrapperAddProcessToWatchEvent.h | Code/ApplicationEngine/otbWrapperAddProcessToWatchEvent.h | /*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbWrapperAddProcessToWatchEvent_h
#define __otbWrapperAddProcessToWatchEvent_h
#include "itkEventObject.h"
#include "itkProcessObject.h"
namespace otb
{
namespace Wrapper
{
/** \class AddProcessToWatchEvent
* \brief This class implements an event storing a pointer to
* itk::ProcessObject and a string describing the process.
*
*/
class ITK_EXPORT AddProcessToWatchEvent: public itk::EventObject
{
public:
typedef AddProcessToWatchEvent Self;
typedef itk::EventObject Superclass;
AddProcessToWatchEvent(){}
AddProcessToWatchEvent(const Self& s) :itk::EventObject(s){};
virtual ~AddProcessToWatchEvent() {}
/** Set/Get the process to watch */
virtual void SetProcess(itk::ProcessObject * process)
{
m_Process = process;
}
virtual itk::ProcessObject * GetProcess() const
{
return m_Process;
}
/** Set/Get the process description */
virtual void SetProcessDescription(const std::string desc)
{
m_ProcessDescription = desc;
}
virtual std::string GetProcessDescription() const
{
return m_ProcessDescription;
}
/** Virtual pure method to implement */
virtual itk::EventObject* MakeObject() const
{
return new Self;
}
virtual const char* GetEventName() const
{
return "AddProcess";
}
virtual bool CheckEvent(const itk::EventObject* e) const
{
return dynamic_cast<const Self*>(e);
}
private:
itk::ProcessObject::Pointer m_Process;
std::string m_ProcessDescription;
};
}
}
#endif
| ADD : Class implementing an Event storing a pointer to a itk::ProcessObject and a string describing it. | ADD : Class implementing an Event storing a pointer to a itk::ProcessObject and a string describing it.
| C | apache-2.0 | orfeotoolbox/OTB,orfeotoolbox/OTB,orfeotoolbox/OTB,orfeotoolbox/OTB,orfeotoolbox/OTB,orfeotoolbox/OTB |
|
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 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.