commit
stringlengths 40
40
| old_file
stringlengths 4
237
| new_file
stringlengths 4
237
| old_contents
stringlengths 1
4.24k
| new_contents
stringlengths 1
4.87k
| subject
stringlengths 15
778
| message
stringlengths 15
8.75k
| lang
stringclasses 266
values | license
stringclasses 13
values | repos
stringlengths 5
127k
|
|---|---|---|---|---|---|---|---|---|---|
e584184199f1d8b572455c9d30e0c57223d7b4df
|
src/chip8.c
|
src/chip8.c
|
#include <stdlib.h>
#include <string.h>
#include "chip8.h"
chip8_t * chip8_new(void) {
int i;
chip8_t * self = (chip8_t *) malloc(sizeof(chip8_t));
// The first 512 bytes are used by the interpreter.
self->program_counter = 0x200;
self->index_register = 0;
self->stack_pointer = 0;
self->opcode = 0;
memcpy(self->memory, chip8_hex_font, 50);
return self;
}
void chip8_free(chip8_t * self) {
free(self);
}
|
#include <stdlib.h>
#include <string.h>
#include "chip8.h"
chip8_t * chip8_new(void) {
chip8_t * self = (chip8_t *) malloc(sizeof(chip8_t));
// The first 512 bytes are used by the interpreter.
self->program_counter = 0x200;
self->index_register = 0;
self->stack_pointer = 0;
self->opcode = 0;
memcpy(self->memory, chip8_hex_font, 50);
return self;
}
void chip8_free(chip8_t * self) {
free(self);
}
|
Remove unused variable (int i)
|
Remove unused variable (int i)
|
C
|
mit
|
gsamokovarov/chip8.c,gsamokovarov/chip8.c
|
9a12c4bd62e7b23a69f8adc616f42a8f3c4c1685
|
src/gauge.c
|
src/gauge.c
|
#include <math.h>
#include "gauge.h"
/**
* Initializes the gauge struct
* @arg gauge The gauge struct to initialize
* @return 0 on success.
*/
int init_gauge(gauge_t *gauge) {
gauge->count = 0;
gauge->sum = 0;
gauge->value = 0;
return 0;
}
/**
* Adds a new sample to the struct
* @arg gauge The gauge to add to
* @arg sample The new sample value
* @arg delta Is this a delta update?
* @return 0 on success.
*/
int gauge_add_sample(gauge_t *gauge, double sample, bool delta) {
if (delta) {
gauge->value += sample;
} else {
gauge->value = sample;
}
gauge->sum += sample;
gauge->count++;
return 0;
}
/**
* Returns the number of samples in the gauge
* @arg gauge The gauge to query
* @return The number of samples
*/
uint64_t gauge_count(gauge_t *gauge) {
return gauge->count;
}
/**
* Returns the mean gauge value
* @arg gauge The gauge to query
* @return The mean value of the gauge
*/
double gauge_mean(gauge_t *gauge) {
return (gauge->count) ? gauge->sum / gauge->count : 0;
}
/**
* Returns the sum of the gauge
* @arg gauge The gauge to query
* @return The sum of values
*/
double gauge_sum(gauge_t *gauge) {
return gauge->sum;
}
/**
* Returns the gauge value (for backwards compat)
* @arg gauge the gauge to query
* @return The gauge value
*/
double gauge_value(gauge_t *gauge) {
return gauge->value;
}
|
#include <math.h>
#include "gauge.h"
int init_gauge(gauge_t *gauge) {
gauge->count = 0;
gauge->sum = 0;
gauge->value = 0;
return 0;
}
int gauge_add_sample(gauge_t *gauge, double sample, bool delta) {
if (delta) {
gauge->value += sample;
} else {
gauge->value = sample;
}
gauge->sum += sample;
gauge->count++;
return 0;
}
uint64_t gauge_count(gauge_t *gauge) {
return gauge->count;
}
double gauge_mean(gauge_t *gauge) {
return (gauge->count) ? gauge->sum / gauge->count : 0;
}
double gauge_sum(gauge_t *gauge) {
return gauge->sum;
}
double gauge_value(gauge_t *gauge) {
return gauge->value;
}
|
Remove duplicate comment from the c file
|
Remove duplicate comment from the c file
|
C
|
bsd-3-clause
|
drawks/statsite,theatrus/statsite,theatrus/statsite,drawks/statsite,drawks/statsite,drawks/statsite,theatrus/statsite,drawks/statsite,theatrus/statsite,theatrus/statsite,drawks/statsite
|
0a0b275bc691c879b95028023406e98063a1ce2b
|
sipXportLib/src/test/sipxunittests.h
|
sipXportLib/src/test/sipxunittests.h
|
//
//
// Copyright (C) 2010 SIPfoundry Inc.
// Licensed by SIPfoundry under the LGPL license.
//
// Copyright (C) 2010 SIPez LLC All rights reserved.
// Licensed to SIPfoundry under a Contributor Agreement.
//
// $$
// Author: Daniel Petrie
// dpetrie AT SIPez DOT com
//////////////////////////////////////////////////////////////////////////////
#ifndef _sipxunittests_h_
#define _sipxunittests_h_
#if !defined(NO_CPPUNIT) && defined(ANDROID)
#define NO_CPPUNIT 1
#endif
#if defined(NO_CPPUNIT)
#define SIPX_UNIT_BASE_CLASS SipxPortUnitTestClass
#include <os/OsIntTypes.h>
#include <sipxportunit/SipxPortUnitTest.h>
#include <utl/UtlString.h>
typedef UtlString string;
#else
#define SIPX_UNIT_BASE_CLASS CppUnit::TestCase
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TestCase.h>
using namespace std;
#endif
#endif
|
//
//
// Copyright (C) 2010-2016 SIPez LLC. All rights reserved.
//
// $$
// Author: Daniel Petrie
// dpetrie AT SIPez DOT com
//////////////////////////////////////////////////////////////////////////////
#ifndef _sipxunittests_h_
#define _sipxunittests_h_
//#if !defined(NO_CPPUNIT) && defined(ANDROID)
#define NO_CPPUNIT 1
//#endif
#if defined(NO_CPPUNIT)
#define SIPX_UNIT_BASE_CLASS SipxPortUnitTestClass
#include <os/OsIntTypes.h>
#include <sipxportunit/SipxPortUnitTest.h>
#include <utl/UtlString.h>
typedef UtlString string;
#else
#define SIPX_UNIT_BASE_CLASS CppUnit::TestCase
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TestCase.h>
using namespace std;
#endif
#endif
|
Make portable unit tests default on all platforms. (vs CPPUNIT)
|
Make portable unit tests default on all platforms.
(vs CPPUNIT)
git-svn-id: 8a77b5e12cf30fc5f8c95b12d648985d6db39537@12346 a612230a-c5fa-0310-af8b-88eea846685b
|
C
|
lgpl-2.1
|
sipXtapi/sipXtapi-svn-mirror,sipXtapi/sipXtapi-svn-mirror,sipXtapi/sipXtapi-svn-mirror,sipXtapi/sipXtapi-svn-mirror,sipXtapi/sipXtapi-svn-mirror,sipXtapi/sipXtapi-svn-mirror,sipXtapi/sipXtapi-svn-mirror
|
92dd7b914b878f2172b4d436e9643c4a0d24683b
|
sbr/getarguments.c
|
sbr/getarguments.c
|
/*
* getarguments.c -- Get the argument vector ready to go.
*
* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
* complete copyright information.
*/
#include <h/mh.h>
#include <h/utils.h>
char **
getarguments (char *invo_name, int argc, char **argv, int check_context)
{
char *cp = NULL, **ap = NULL, **bp = NULL, **arguments = NULL;
int n = 0;
/*
* Check if profile/context specifies any arguments
*/
if (check_context && (cp = context_find (invo_name))) {
cp = getcpy (cp); /* make copy */
ap = brkstring (cp, " ", "\n"); /* split string */
/* Count number of arguments split */
bp = ap;
while (*bp++)
n++;
}
arguments = (char **) mh_xmalloc ((argc + n) * sizeof(*arguments));
bp = arguments;
/* Copy any arguments from profile/context */
if (ap != NULL && n > 0) {
while (*ap)
*bp++ = *ap++;
}
/* Copy arguments from command line */
argv++;
while (*argv)
*bp++ = *argv++;
/* Now NULL terminate the array */
*bp = NULL;
return arguments;
}
|
/*
* getarguments.c -- Get the argument vector ready to go.
*
* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
* complete copyright information.
*/
#include <h/mh.h>
#include <h/utils.h>
char **
getarguments (char *invo_name, int argc, char **argv, int check_context)
{
char *cp = NULL, **ap = NULL, **bp = NULL, **arguments = NULL;
int n = 0;
/*
* Check if profile/context specifies any arguments
*/
if (check_context && (cp = context_find (invo_name))) {
cp = mh_xstrdup(cp); /* make copy */
ap = brkstring (cp, " ", "\n"); /* split string */
/* Count number of arguments split */
bp = ap;
while (*bp++)
n++;
}
arguments = (char **) mh_xmalloc ((argc + n) * sizeof(*arguments));
bp = arguments;
/* Copy any arguments from profile/context */
if (ap != NULL && n > 0) {
while (*ap)
*bp++ = *ap++;
}
/* Copy arguments from command line */
argv++;
while (*argv)
*bp++ = *argv++;
/* Now NULL terminate the array */
*bp = NULL;
return arguments;
}
|
Replace getcpy() with mh_xstrdup() where the string isn't NULL.
|
Replace getcpy() with mh_xstrdup() where the string isn't NULL.
|
C
|
bsd-3-clause
|
mcr/nmh,mcr/nmh
|
231ff54e4cc4a6f1ef78fb4e1f94957bbb961aae
|
drivers/scsi/qla2xxx/qla_version.h
|
drivers/scsi/qla2xxx/qla_version.h
|
/*
* QLogic Fibre Channel HBA Driver
* Copyright (c) 2003-2013 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.04.00.08-k"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 4
#define QLA_DRIVER_PATCH_VER 0
#define QLA_DRIVER_BETA_VER 0
|
/*
* QLogic Fibre Channel HBA Driver
* Copyright (c) 2003-2013 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.04.00.13-k"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 4
#define QLA_DRIVER_PATCH_VER 0
#define QLA_DRIVER_BETA_VER 0
|
Update the driver version to 8.04.00.13-k.
|
[SCSI] qla2xxx: Update the driver version to 8.04.00.13-k.
Signed-off-by: Giridhar Malavali <799b6491fce2c7a80b5fedcf9a728560cc9eb954@qlogic.com>
Signed-off-by: Saurav Kashyap <88d6fd94e71a9ac276fc44f696256f466171a3c0@qlogic.com>
Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Parallels.com>
|
C
|
mit
|
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
|
0ce2d5345a145015bc35f8251cf9d82a8f193a86
|
drivers/scsi/qla4xxx/ql4_version.h
|
drivers/scsi/qla4xxx/ql4_version.h
|
/*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2012 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.03.00-k6"
|
/*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2012 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.03.00-k7"
|
Update driver version to 5.03.00-k7
|
[SCSI] qla4xxx: Update driver version to 5.03.00-k7
Signed-off-by: Vikas Chaudhary <c251871a64d7d31888eace0406cb3d4c419d5f73@qlogic.com>
Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Parallels.com>
|
C
|
mit
|
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas
|
7ac5e552ca1d344baa09174c8b9ff1e776399f39
|
Branch-SDK/Branch-SDK/BNCDeviceInfo.h
|
Branch-SDK/Branch-SDK/BNCDeviceInfo.h
|
//
// BNCDeviceInfo.h
// Branch-TestBed
//
// Created by Sojan P.R. on 3/22/16.
// Copyright © 2016 Branch Metrics. All rights reserved.
//
#import <Foundation/Foundation.h>
#ifndef BNCDeviceInfo_h
#define BNCDeviceInfo_h
#endif /* BNCDeviceInfo_h */
@interface BNCDeviceInfo : NSObject
//---------Properties-------------//
@property (nonatomic, strong) NSString *hardwareId;
@property (nonatomic, strong) NSString *hardwareIdType;
@property (nonatomic) BOOL isRealHardwareId;
@property (nonatomic, strong) NSString *vendorId;
@property (nonatomic, strong) NSString *brandName;
@property (nonatomic, strong) NSString *modelName;
@property (nonatomic, strong) NSString *osName;
@property (nonatomic, strong) NSString *osVersion;
@property (nonatomic) NSNumber *screenWidth;
@property (nonatomic) NSNumber *screenHeight;
@property (nonatomic) BOOL isAdTrackingEnabled;
//----------Methods----------------//
+ (BNCDeviceInfo *)getInstance;
@end
|
//
// BNCDeviceInfo.h
// Branch-TestBed
//
// Created by Sojan P.R. on 3/22/16.
// Copyright © 2016 Branch Metrics. All rights reserved.
//
#import <Foundation/Foundation.h>
#ifndef BNCDeviceInfo_h
#define BNCDeviceInfo_h
#endif /* BNCDeviceInfo_h */
@interface BNCDeviceInfo : NSObject
//---------Properties-------------//
@property (nonatomic, strong) NSString *hardwareId;
@property (nonatomic, strong) NSString *hardwareIdType;
@property (nonatomic) BOOL isRealHardwareId;
@property (nonatomic, strong) NSString *vendorId;
@property (nonatomic, strong) NSString *brandName;
@property (nonatomic, strong) NSString *modelName;
@property (nonatomic, strong) NSString *osName;
@property (nonatomic, strong) NSString *osVersion;
@property (nonatomic, strong) NSNumber *screenWidth;
@property (nonatomic, strong) NSNumber *screenHeight;
@property (nonatomic) BOOL isAdTrackingEnabled;
//----------Methods----------------//
+ (BNCDeviceInfo *)getInstance;
@end
|
Change property attribute to strong
|
Change property attribute to strong
|
C
|
mit
|
BranchMetrics/ios-branch-deep-linking,BranchMetrics/ios-branch-deep-linking,BranchMetrics/iOS-Deferred-Deep-Linking-SDK,BranchMetrics/iOS-Deferred-Deep-Linking-SDK,BranchMetrics/ios-branch-deep-linking,BranchMetrics/ios-branch-deep-linking
|
97b487e3f7d68a4ee579bdba1001984055463061
|
src/containers/hash_map.h
|
src/containers/hash_map.h
|
#ifndef JTL_HASH_MAP_H__
#define JTL_HASH_MAP_H__
#include <memory>
namespace jtl {
template <typename Key,
typename Value>
class HashMap {
struct MapNode {
MapNode(Key k, Value v) : key(k), value(v) {}
~MapNode() {
delete key;
delete value;
}
Key key;
Value value;
}; // struct MapNode
class HashMapBase_ {
private:
// bins is an array of pointers to arrays of key-value nodes
MapNode** bins_;
}; // class HashMapBase_
public:
private:
Key* bins_;
}; // class HashMap
} // namespace jtl
#endif
|
#ifndef JTL_FLAT_HASH_MAP_H__
#define JTL_FLAT_HASH_MAP_H__
#include <memory>
#include <cctype>
namespace jtl {
template <typename Key>
struct Hash {
using argument_type = Key;
using result_type = std::size_t;
result_type operator()(const Key& k);
}; // struct Hash
template <typename Key,
typename Value>
class FlatHashMap {
public:
FlatHashMap() : bins_(), hash_() {}
struct MapNode {
MapNode(Key k, Value v) : key(k), value(v) {}
Key key;
Value value;
}; // struct MapNode
private:
std::vector<std::vector<MapNode>> bins_;
Hash<Key> hash_;
}; // class HashMap
} // namespace jtl
#endif // JTL_FLAT_HASH_MAP__
|
Switch hash map class to a flat hash map
|
Switch hash map class to a flat hash map
|
C
|
mit
|
j-haj/algorithms-datastructures
|
7d403dcfb33763e9eb29fd1f4a67e293b1d98f94
|
3RVX/HotkeyInfo.h
|
3RVX/HotkeyInfo.h
|
#pragma once
#include <vector>
class HotkeyInfo {
public:
enum HotkeyActions {
IncreaseVolume,
DecreaseVolume,
SetVolume,
Mute,
VolumeSlider,
RunApp,
Settings,
Exit,
};
static std::vector<std::wstring> ActionNames;
public:
int keyCombination = 0;
int action = -1;
};
|
#pragma once
#include <vector>
class HotkeyInfo {
public:
enum HotkeyActions {
IncreaseVolume,
DecreaseVolume,
SetVolume,
Mute,
VolumeSlider,
RunApp,
Settings,
Exit,
};
static std::vector<std::wstring> ActionNames;
public:
int keyCombination = 0;
int action = -1;
std::vector<std::wstring> args;
};
|
Add instance var for hotkey arguments
|
Add instance var for hotkey arguments
|
C
|
bsd-2-clause
|
Soulflare3/3RVX,Soulflare3/3RVX,malensek/3RVX,malensek/3RVX,malensek/3RVX,Soulflare3/3RVX
|
9fa470e4021c096a808bfa9bb9406e9897f55b70
|
CRToast/CRToast.h
|
CRToast/CRToast.h
|
//
// CRToast
// Copyright (c) 2014-2015 Collin Ruffenach. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for CRToast.
FOUNDATION_EXPORT double CRToastVersionNumber;
//! Project version string for CRToast.
FOUNDATION_EXPORT const unsigned char CRToastVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <CRToast/PublicHeader.h>
#import <CRToast/CRToastConfig.h>
#import <CRToast/CRToastManager.h>
|
//
// CRToast
// Copyright (c) 2014-2015 Collin Ruffenach. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for CRToast.
FOUNDATION_EXPORT double CRToastVersionNumber;
//! Project version string for CRToast.
FOUNDATION_EXPORT const unsigned char CRToastVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <CRToast/PublicHeader.h>
#import "CRToast/CRToastConfig.h"
#import "CRToast/CRToastManager.h"
|
Fix build error with import
|
Fix build error with import
|
C
|
mit
|
Trueey/CRToast
|
abeb3e3e92bd30ccd7f0d6683a97fbb9f828f75b
|
src/genericpage.h
|
src/genericpage.h
|
/*
* dialer - MeeGo Voice Call Manager
* Copyright (c) 2009, 2010, Intel Corporation.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
* http://www.apache.org/licenses/LICENSE-2.0
*
*/
#ifndef GENERICPAGE_H
#define GENERICPAGE_H
#include <MApplicationPage>
class MainWindow;
class MLayout;
class MGridLayoutPolicy;
class GenericPage : public MApplicationPage
{
Q_OBJECT
public:
enum PageType {
PAGE_NONE = -1,
PAGE_DIALER = 0,
PAGE_RECENT = 1,
PAGE_PEOPLE = 2,
PAGE_FAVORITE = 3,
PAGE_DEBUG = 4,
};
GenericPage();
virtual ~GenericPage();
virtual void createContent();
virtual MGridLayoutPolicy * policy(M::Orientation);
MainWindow *mainWindow();
protected:
virtual void showEvent(QShowEvent *event);
virtual void activateWidgets();
virtual void deactivateAndResetWidgets();
MLayout * layout;
MGridLayoutPolicy * landscape;
MGridLayoutPolicy * portrait;
PageType m_pageType;
};
#endif // GENERICPAGE_H
|
/*
* dialer - MeeGo Voice Call Manager
* Copyright (c) 2009, 2010, Intel Corporation.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
* http://www.apache.org/licenses/LICENSE-2.0
*
*/
#ifndef GENERICPAGE_H
#define GENERICPAGE_H
#include <MApplicationPage>
class MainWindow;
class MLayout;
class MGridLayoutPolicy;
class GenericPage : public MApplicationPage
{
Q_OBJECT
public:
enum PageType {
PAGE_NONE = -1,
PAGE_DIALER = 0,
PAGE_RECENT = 1,
PAGE_PEOPLE = 2,
PAGE_FAVORITE = 3,
PAGE_DEBUG = 4,
};
GenericPage();
virtual ~GenericPage();
virtual void createContent();
virtual MGridLayoutPolicy * policy(M::Orientation);
virtual void activateWidgets();
virtual void deactivateAndResetWidgets();
MainWindow *mainWindow();
protected:
virtual void showEvent(QShowEvent *event);
MLayout * layout;
MGridLayoutPolicy * landscape;
MGridLayoutPolicy * portrait;
PageType m_pageType;
};
#endif // GENERICPAGE_H
|
Make the genericPage methods activate and deactivate widgets public instead of protected.
|
Make the genericPage methods activate and deactivate widgets public instead of protected.
Signed-off-by: Michael Demeter <ed571e93df5b6cb8044d8ad4bd1aafe6e72f2a71@intel.com>
|
C
|
apache-2.0
|
lbt/meego-handset-dialer,lbt/meego-handset-dialer,lbt/meego-handset-dialer,lbt/meego-handset-dialer
|
24f16f44b3b2569b8858c453429c3fb42ea02392
|
objc/PromiseKit.h
|
objc/PromiseKit.h
|
#import "PromiseKit/Promise.h"
#ifdef PMK_CORELOCATION
#import "PromiseKit+CoreLocation.h"
#endif
#ifdef PMK_FOUNDATION
#import "PromiseKit+Foundation.h"
#endif
#ifdef PMK_UIKIT
#import "PromiseKit+UIKit.h"
#endif
#ifdef PMK_MAPKIT
#import "PromiseKit+MapKit.h"
#endif
#ifdef PMK_SOCIAL
#import "PromiseKit+Social.h"
#endif
#ifdef PMK_STOREKIT
#import "PromiseKit+StoreKit.h"
#endif
#ifdef PMK_AVFOUNDATION
#import "PromiseKit+AVFoundation.h"
#endif
#ifndef PMK_NO_UNPREFIXATION
// I used a typedef but it broke the tests, turns out typedefs are new
// types that have consequences with isKindOfClass and that
// NOTE I will remove this at 1.0
typedef PMKPromise Promise __attribute__((deprecated("Use PMKPromise. Use of Promise is deprecated. This is a typedef, and since it is a typedef, there may be unintended side-effects.")));
#endif
|
#import "PromiseKit/Promise.h"
#ifdef PMK_CORELOCATION
#import "PromiseKit+CoreLocation.h"
#endif
#ifdef PMK_FOUNDATION
#import "PromiseKit+Foundation.h"
#endif
#ifdef PMK_UIKIT
#import "PromiseKit+UIKit.h"
#endif
#ifdef PMK_MAPKIT
#import "PromiseKit+MapKit.h"
#endif
#ifdef PMK_SOCIAL
#import "PromiseKit+Social.h"
#endif
#ifdef PMK_STOREKIT
#import "PromiseKit+StoreKit.h"
#endif
#ifdef PMK_AVFOUNDATION
#import "PromiseKit+AVFoundation.h"
#endif
#ifdef PMK_ACCOUNTS
#import "PromiseKit+Accounts.h"
#endif
#ifndef PMK_NO_UNPREFIXATION
// I used a typedef but it broke the tests, turns out typedefs are new
// types that have consequences with isKindOfClass and that
// NOTE I will remove this at 1.0
typedef PMKPromise Promise __attribute__((deprecated("Use PMKPromise. Use of Promise is deprecated. This is a typedef, and since it is a typedef, there may be unintended side-effects.")));
#endif
|
Add missing import to umbrella header
|
Add missing import to umbrella header
|
C
|
mit
|
mxcl/PromiseKit,pgherveou/PromiseKit,mxcl/PromiseKit,allen-zeng/PromiseKit,mxcl/PromiseKit,pgherveou/PromiseKit,allen-zeng/PromiseKit,pgherveou/PromiseKit
|
a935263bc17f40ed671abc3157adbc04ade7b3fa
|
Source/SimpleITKMacro.h
|
Source/SimpleITKMacro.h
|
#ifndef __SimpleITKMacro_h
#define __SimpleITKMacro_h
#include <stdint.h>
#include <itkImageBase.h>
#include <itkImage.h>
#include <itkLightObject.h>
#include <itkSmartPointer.h>
// Define macros to aid in the typeless layer
typedef itk::ImageBase<3> SimpleImageBase;
namespace itk {
namespace simple {
// To add a new type you must:
// 1. Add an entry to ImageDataType
// 2. Add to the sitkDataTypeSwitch
// 3. Add the new type to ImageFileReader/ImageFileWriter
enum ImageDataType {
sitkUInt8, // Unsigned 8 bit integer
sitkInt16, // Signed 16 bit integer
sitkInt32, // Signed 32 bit integer
sitkFloat32, // 32 bit float
};
#define sitkImageDataTypeCase(typeN, type, call ) \
case typeN: { typedef type DataType; call; }; break
#define sitkImageDataTypeSwitch( call ) \
sitkImageDataTypeCase ( sitkUInt8, uint8_t, call ); \
sitkImageDataTypeCase ( sitkInt16, int16_t, call ); \
sitkImageDataTypeCase ( sitkInt32, int32_t, call ); \
sitkImageDataTypeCase ( sitkFloat32, float, call );
}
}
#endif
|
#ifndef __SimpleITKMacro_h
#define __SimpleITKMacro_h
// Ideally, take the types from the C99 standard. However,
// VS 8 does not have stdint.h, but they are defined anyway.
#ifndef _MSC_VER
#include <stdint.h>
#endif
#include <itkImageBase.h>
#include <itkImage.h>
#include <itkLightObject.h>
#include <itkSmartPointer.h>
// Define macros to aid in the typeless layer
typedef itk::ImageBase<3> SimpleImageBase;
namespace itk {
namespace simple {
// To add a new type you must:
// 1. Add an entry to ImageDataType
// 2. Add to the sitkDataTypeSwitch
// 3. Add the new type to ImageFileReader/ImageFileWriter
enum ImageDataType {
sitkUInt8, // Unsigned 8 bit integer
sitkInt16, // Signed 16 bit integer
sitkInt32, // Signed 32 bit integer
sitkFloat32, // 32 bit float
};
#define sitkImageDataTypeCase(typeN, type, call ) \
case typeN: { typedef type DataType; call; }; break
#define sitkImageDataTypeSwitch( call ) \
sitkImageDataTypeCase ( sitkUInt8, uint8_t, call ); \
sitkImageDataTypeCase ( sitkInt16, int16_t, call ); \
sitkImageDataTypeCase ( sitkInt32, int32_t, call ); \
sitkImageDataTypeCase ( sitkFloat32, float, call );
}
}
#endif
|
Support for MS Visual Studio 2008.
|
Support for MS Visual Studio 2008.
|
C
|
apache-2.0
|
SimpleITK/Staging,SimpleITK/Staging,SimpleITK/Staging,SimpleITK/Staging,SimpleITK/Staging,SimpleITK/Staging,SimpleITK/Staging
|
6536132facc72b11a630fef777d446e06dfeeed8
|
test/FrontendC/2010-06-28-nowarn.c
|
test/FrontendC/2010-06-28-nowarn.c
|
// RUN: %llvmgcc %s -c -m32 -fasm-blocks -o /dev/null
// This should not warn about unreferenced label. 7729514.
// XFAIL: *
// XTARGET: i386-apple-darwin,x86_64-apple-darwin,i686-apple-darwin
void quarterAsm(int array[], int len)
{
__asm
{
mov esi, array;
mov ecx, len;
shr ecx, 2;
loop:
movdqa xmm0, [esi];
psrad xmm0, 2;
movdqa [esi], xmm0;
add esi, 16;
sub ecx, 1;
jnz loop;
}
}
|
// RUN: %llvmgcc %s -c -m32 -fasm-blocks -o /dev/null
// This should not warn about unreferenced label. 7729514.
// XFAIL: *
// XTARGET: x86,i386,i686
void quarterAsm(int array[], int len)
{
__asm
{
mov esi, array;
mov ecx, len;
shr ecx, 2;
loop:
movdqa xmm0, [esi];
psrad xmm0, 2;
movdqa [esi], xmm0;
add esi, 16;
sub ecx, 1;
jnz loop;
}
}
|
Fix this XTARGET so that this does doesn't XPASS on non-darwin hosts.
|
Fix this XTARGET so that this does doesn't XPASS on non-darwin hosts.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@108040 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm
|
e36c3d63728197449d4e555823d7d07db16e2c3a
|
OCMustache/MustacheToken.h
|
OCMustache/MustacheToken.h
|
//
// MustacheToken.h
// OCMustache
//
// Created by Wesley Moore on 31/10/10.
// Copyright 2010 Wesley Moore. All rights reserved.
//
#import <Foundation/Foundation.h>
enum mustache_token_type {
mustache_token_type_etag = 1, // Escaped tag
mustache_token_type_utag, // Unescaped tag
mustache_token_type_section,
mustache_token_type_inverted,
mustache_token_type_static, // Static text
mustache_token_type_partial
};
@interface MustacheToken : NSObject {
enum mustache_token_type type;
const char *content;
NSUInteger content_length;
}
@property(nonatomic, assign) enum mustache_token_type type;
@property(nonatomic, assign) const char *content;
@property(nonatomic, assign) size_t contentLength;
- (id)initWithType:(enum mustache_token_type)token_type content:(const char *)content contentLength:(NSUInteger)length;
- (NSString *)contentString;
@end
|
//
// MustacheToken.h
// OCMustache
//
// Created by Wesley Moore on 31/10/10.
// Copyright 2010 Wesley Moore. All rights reserved.
//
#import <Foundation/Foundation.h>
enum mustache_token_type {
mustache_token_type_etag = 1, // Escaped tag
mustache_token_type_utag, // Unescaped tag
mustache_token_type_section,
mustache_token_type_inverted,
mustache_token_type_static, // Static text
mustache_token_type_partial
};
@interface MustacheToken : NSObject {
enum mustache_token_type type;
const char *content;
NSUInteger content_length;
}
@property(nonatomic, assign) enum mustache_token_type type;
@property(nonatomic, assign) const char *content;
@property(nonatomic, assign) NSUInteger contentLength;
- (id)initWithType:(enum mustache_token_type)token_type content:(const char *)content contentLength:(NSUInteger)length;
- (NSString *)contentString;
@end
|
Fix type mismatch between property and ivar
|
Fix type mismatch between property and ivar
|
C
|
bsd-3-clause
|
wezm/OCMustache,wezm/OCMustache
|
d4754ea5df0dc77ad9de3d05a36e89ed2a7ebd9b
|
src/libcsg/modules/io/gmxtopologyreader.h
|
src/libcsg/modules/io/gmxtopologyreader.h
|
/*
* Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org)
*
* 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 _VOTCA_CSG_GMXTOPOLOGYREADER_H
#define _VOTCA_CSG_GMXTOPOLOGYREADER_H
#include <string>
#include <votca/csg/topologyreader.h>
namespace votca {
namespace csg {
/**
\brief reader for gromacs topology files
This class encapsulates the gromacs reading functions and provides an
interface to fill a topolgy class
*/
class GMXTopologyReader : public TopologyReader {
public:
GMXTopologyReader() = default;
/// read a topology file
bool ReadTopology(std::string file, Topology &top) override;
private:
};
} // namespace csg
} // namespace votca
#endif /* _VOTCA_CSG_GMXTOPOLOGYREADER_H */
|
/*
* Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org)
*
* 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 _VOTCA_CSG_GMXTOPOLOGYREADER_H
#define _VOTCA_CSG_GMXTOPOLOGYREADER_H
#include <string>
#include <votca/csg/topologyreader.h>
#include <votca/tools/unitconverter.h>
namespace votca {
namespace csg {
/**
\brief reader for gromacs topology files
This class encapsulates the gromacs reading functions and provides an
interface to fill a topolgy class
*/
class GMXTopologyReader : public TopologyReader {
public:
GMXTopologyReader() = default;
/// read a topology file
bool ReadTopology(std::string file, Topology &top) override;
private:
};
} // namespace csg
} // namespace votca
#endif /* _VOTCA_CSG_GMXTOPOLOGYREADER_H */
|
Add unitconverter include to gmx top reader
|
Add unitconverter include to gmx top reader
|
C
|
apache-2.0
|
MrTheodor/csg,MrTheodor/csg,votca/csg,MrTheodor/csg,votca/csg,votca/csg,MrTheodor/csg,MrTheodor/csg,votca/csg
|
c33b5c9ef5b597850f66c66e8b68451f15adcfe7
|
libyaul/scu/bus/a/cs0/dram-cartridge/dram-cartridge.h
|
libyaul/scu/bus/a/cs0/dram-cartridge/dram-cartridge.h
|
/*
* Copyright (c) 2012 Israel Jacques
* See LICENSE for details.
*
* Israel Jacques <mrko@eecs.berkeley.edu>
*/
#ifndef _DRAM_CARTRIDGE_H__
#define _DRAM_CARTRIDGE_H__
extern void dram_init(void);
#endif /* !_DRAM_CARTRIDGE_H_
|
/*
* Copyright (c) 2012 Israel Jacques
* See LICENSE for details.
*
* Israel Jacques <mrko@eecs.berkeley.edu>
*/
#ifndef _DRAM_CARTRIDGE_H__
#define _DRAM_CARTRIDGE_H__
extern void dram_cartridge_init(void);
#endif /* !_DRAM_CARTRIDGE_H_
|
Change incorrect prototype from 'dram_init(void)' to 'dram_cartridge_init(void)'
|
Change incorrect prototype from 'dram_init(void)' to 'dram_cartridge_init(void)'
|
C
|
mit
|
ChillyWillyGuru/libyaul,ChillyWillyGuru/libyaul
|
4a882fe26dab76ae7b0c89459a5808cfef99055a
|
libyaul/kernel/mm/slob.h
|
libyaul/kernel/mm/slob.h
|
/*
* Copyright (c) 2012 Israel Jacquez
* See LICENSE for details.
*
* Israel Jacquez <mrkotfw@gmail.com>
*/
#ifndef _SLOB_H_
#define _SLOB_H_
#include <stddef.h>
/*-
* Restrictions
*
* 1. Allocation requests bigger than SLOB_PAGE_BREAK_2ND cannot be
* serviced. This is due to the memory block manager not able to
* guarantee that sequential allocations of SLOB pages will be
* contiguous.
*/
/*
* Adjust the number of pages to be statically allocated as needed. If
* memory is quickly exhausted, increase the SLOB page count.
*/
#ifndef SLOB_PAGE_COUNT
#define SLOB_PAGE_COUNT 4
#endif /* !SLOB_PAGE_COUNT */
#define SLOB_PAGE_SIZE 0x1000
#define SLOB_PAGE_MASK (~(SLOB_PAGE_SIZE - 1))
#define SLOB_PAGE_BREAK_1ST 0x0100
#define SLOB_PAGE_BREAK_2ND 0x0400
void slob_init(void);
void *slob_alloc(size_t);
void slob_free(void *);
#endif /* _SLOB_H_ */
|
/*
* Copyright (c) 2012 Israel Jacquez
* See LICENSE for details.
*
* Israel Jacquez <mrkotfw@gmail.com>
*/
#ifndef _SLOB_H_
#define _SLOB_H_
#include <stddef.h>
/*-
* Restrictions
*
* 1. Heap size limit: Allocation requests bigger than
* SLOB_PAGE_BREAK_2ND cannot be serviced. This is due to the
* memory block manager not able to guarantee that sequential
* allocations of SLOB pages will be contiguous.
*/
/*
* Adjust the number of pages to be statically allocated as needed. If
* memory is quickly exhausted, increase the SLOB page count.
*/
#ifndef SLOB_PAGE_COUNT
#define SLOB_PAGE_COUNT 4
#endif /* !SLOB_PAGE_COUNT */
#define SLOB_PAGE_SIZE 0x4000
#define SLOB_PAGE_MASK (~(SLOB_PAGE_SIZE - 1))
#define SLOB_PAGE_BREAK_1ST 0x0100
#define SLOB_PAGE_BREAK_2ND 0x0400
void slob_init(void);
void *slob_alloc(size_t);
void slob_free(void *);
#endif /* _SLOB_H_ */
|
Change hard limit on heap
|
Change hard limit on heap
|
C
|
mit
|
ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul
|
8b3bd1defc7baa4537528fb45e7f8f365407992a
|
NUCLEO_L053R8/Button_HAL/src/main.c
|
NUCLEO_L053R8/Button_HAL/src/main.c
|
/**
* Using the HAL library
*/
#include "stm32l0xx.h"
#include "stm32l0xx_nucleo.h"
int main(void) {
HAL_Init();
BSP_LED_Init(LED2);
while (1) {
BSP_LED_Toggle(LED2);
HAL_Delay(500);
}
}
|
/**
* Using the HAL library
*/
#include "stm32l0xx.h"
#include "stm32l0xx_nucleo.h"
GPIO_InitTypeDef GPIO_InitStructure;
int main(void) {
HAL_Init();
BSP_LED_Init(LED2);
// Initialise the button (PC13)
__HAL_RCC_GPIOC_CLK_ENABLE();
GPIO_InitStructure.Pin = GPIO_PIN_13;
GPIO_InitStructure.Mode = GPIO_MODE_INPUT;
GPIO_InitStructure.Pull = GPIO_NOPULL; // External pull up
GPIO_InitStructure.Speed = GPIO_SPEED_LOW;
HAL_GPIO_Init(GPIOC, &GPIO_InitStructure);
while (1) {
if (HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13)) {
BSP_LED_Toggle(LED2);
//HAL_Delay(500);
}
}
}
|
Read the button with the HAL library
|
Read the button with the HAL library
|
C
|
mit
|
theapi/stm32,theapi/stm32
|
6e5eac20ada828fb2fbcd6fd262fe07e3d16fc54
|
TTKMobile/musicmobileglobaldefine.h
|
TTKMobile/musicmobileglobaldefine.h
|
#ifndef MUSICMOBILEGLOBALDEFINE_H
#define MUSICMOBILEGLOBALDEFINE_H
/* =================================================
* This file is part of the TTK Music Player project
* Copyright (c) 2015 - 2017 Greedysky Studio
* All rights reserved!
* Redistribution and use of the source code or any derivative
* works are strictly forbiden.
=================================================*/
#include "musicglobal.h"
//////////////////////////////////////
///exoprt
///
///
#define MUSIC_EXPORT
#ifdef MUSIC_EXPORT
# define MUSIC_MOBILE_EXPORT Q_DECL_EXPORT
#else
# define MUSIC_MOBILE_EXPORT Q_DECL_IMPORT
#endif
#endif // MUSICMOBILEGLOBALDEFINE_H
|
#ifndef MUSICMOBILEGLOBALDEFINE_H
#define MUSICMOBILEGLOBALDEFINE_H
/* =================================================
* This file is part of the TTK Music Player project
* Copyright (c) 2015 - 2017 Greedysky Studio
* All rights reserved!
* Redistribution and use of the source code or any derivative
* works are strictly forbiden.
=================================================*/
#include "musicglobal.h"
//////////////////////////////////////
///exoprt
///
///
#define MUSIC_EXPORT
#ifdef MUSIC_EXPORT
# define MUSIC_MOBILE_EXPORT Q_DECL_EXPORT
#else
# define MUSIC_MOBILE_IMPORT Q_DECL_IMPORT
#endif
#endif // MUSICMOBILEGLOBALDEFINE_H
|
Fix dll import name error[132001]
|
Fix dll import name error[132001]
|
C
|
lgpl-2.1
|
Greedysky/Musicplayer,Greedysky/Musicplayer,Greedysky/Musicplayer
|
4e0739eb319e4283da0616ac64bd2d65168861ef
|
src/backend/utils/resource_manager/resource_manager.c
|
src/backend/utils/resource_manager/resource_manager.c
|
/*-------------------------------------------------------------------------
*
* resource_manager.c
* GPDB resource manager code.
*
*
* Copyright (c) 2006-2017, Greenplum inc.
*
*
-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "utils/guc.h"
#include "utils/resource_manager.h"
/*
* GUC variables.
*/
bool ResourceScheduler; /* Is scheduling enabled? */
ResourceManagerPolicy Gp_resource_manager_policy;
|
/*-------------------------------------------------------------------------
*
* resource_manager.c
* GPDB resource manager code.
*
*
* Copyright (c) 2006-2017, Greenplum inc.
*
*
-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "utils/guc.h"
#include "utils/resource_manager.h"
/*
* GUC variables.
*/
bool ResourceScheduler = false; /* Is scheduling enabled? */
ResourceManagerPolicy Gp_resource_manager_policy;
|
Initialize global var to avoid macOS linker error
|
Initialize global var to avoid macOS linker error
The macOS ld64 linker has an assertion on empty DATA segments
within linker Atoms. This assertion trips on the resource_manager
since it only contains uninitialized variables placed for the BSS
segment. This fails linking the backend on the resource_manager
SUBSYS object. Without anything initialized, an no exported
function symbols, the sections are:
$ nm -mgU src/backend/utils/resource_manager/SUBSYS.o
0000000000000004 (common) (alignment 2^2) external _Gp_resource_manager_policy
0000000000000001 (common) external _ResourceScheduler
With the initialization of the ResourceScheduler GUC variable:
$ nm -mgU src/backend/utils/resource_manager/SUBSYS.o
0000000000000004 (common) (alignment 2^2) external _Gp_resource_manager_policy
0000000000000004 (__DATA,__common) external _ResourceScheduler
Since the resource_manager in its current state is off anyways it
seems harmless to initialize to the correct value.
|
C
|
apache-2.0
|
xinzweb/gpdb,xinzweb/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,Quikling/gpdb,50wu/gpdb,cjcjameson/gpdb,janebeckman/gpdb,50wu/gpdb,janebeckman/gpdb,ashwinstar/gpdb,Chibin/gpdb,yuanzhao/gpdb,50wu/gpdb,cjcjameson/gpdb,50wu/gpdb,Quikling/gpdb,lisakowen/gpdb,xinzweb/gpdb,ashwinstar/gpdb,edespino/gpdb,jmcatamney/gpdb,edespino/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,Quikling/gpdb,edespino/gpdb,Chibin/gpdb,xinzweb/gpdb,yuanzhao/gpdb,lisakowen/gpdb,cjcjameson/gpdb,Chibin/gpdb,50wu/gpdb,ashwinstar/gpdb,rvs/gpdb,janebeckman/gpdb,adam8157/gpdb,Chibin/gpdb,xinzweb/gpdb,yuanzhao/gpdb,Chibin/gpdb,ashwinstar/gpdb,Chibin/gpdb,rvs/gpdb,kaknikhil/gpdb,rvs/gpdb,yuanzhao/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,kaknikhil/gpdb,jmcatamney/gpdb,yuanzhao/gpdb,Quikling/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,yuanzhao/gpdb,xinzweb/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,Quikling/gpdb,lisakowen/gpdb,greenplum-db/gpdb,xinzweb/gpdb,Quikling/gpdb,greenplum-db/gpdb,yuanzhao/gpdb,rvs/gpdb,edespino/gpdb,jmcatamney/gpdb,cjcjameson/gpdb,adam8157/gpdb,yuanzhao/gpdb,janebeckman/gpdb,jmcatamney/gpdb,Chibin/gpdb,edespino/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,50wu/gpdb,janebeckman/gpdb,jmcatamney/gpdb,adam8157/gpdb,jmcatamney/gpdb,Chibin/gpdb,janebeckman/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,rvs/gpdb,lisakowen/gpdb,cjcjameson/gpdb,xinzweb/gpdb,Quikling/gpdb,yuanzhao/gpdb,Quikling/gpdb,lisakowen/gpdb,adam8157/gpdb,kaknikhil/gpdb,adam8157/gpdb,lisakowen/gpdb,adam8157/gpdb,lisakowen/gpdb,edespino/gpdb,Chibin/gpdb,rvs/gpdb,50wu/gpdb,lisakowen/gpdb,edespino/gpdb,rvs/gpdb,rvs/gpdb,edespino/gpdb,Chibin/gpdb,rvs/gpdb,janebeckman/gpdb,kaknikhil/gpdb,janebeckman/gpdb,Quikling/gpdb,edespino/gpdb,50wu/gpdb,yuanzhao/gpdb,edespino/gpdb,jmcatamney/gpdb,kaknikhil/gpdb,janebeckman/gpdb,greenplum-db/gpdb,cjcjameson/gpdb,janebeckman/gpdb,Quikling/gpdb,adam8157/gpdb,adam8157/gpdb,greenplum-db/gpdb,rvs/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,kaknikhil/gpdb
|
4cc26f6ae19b096bae1ec8309671bb415997786c
|
c_solutions_1-10/Euler_1.c
|
c_solutions_1-10/Euler_1.c
|
#include <stdio.h>
#include <time.h>
int multiples_three_five(int limit)
{
long total = 0;
int i;
for (i=1; i < limit; i++)
total += i % 3 == 0 || i % 5 == 0 ? i : 0;
return total;
}
int main(void)
{
clock_t start, stop;
start = clock();
long ans = multiples_three_five(1000);
printf ("Answer: %ld\n", ans);
stop = clock();
printf ("Time: %f\n", ((float)stop - (float)start) / CLOCKS_PER_SEC);
return 0;
}
|
#include <time.h>
#include <stdio.h>
#define NANO 10000000000
int multiples_three_five(int limit)
{
long total = 0;
for (int i=1; i < limit; i++)
total += i % 3 == 0 || i % 5 == 0 ? i : 0;
return total;
}
int main(void)
{
struct timespec start;
clock_gettime(CLOCK_REALTIME, &start);
double start_time = ((float) start.tv_sec) + ((float) start.tv_nsec) / NANO;
long ans = multiples_three_five(1000);
printf ("Answer: %ld\n", ans);
struct timespec stop;
clock_gettime(CLOCK_REALTIME, &stop);
double stop_time = ((float) stop.tv_sec) + ((float) stop.tv_nsec) / NANO;
printf ("Time: %.8f\n", stop_time - start_time);
return 0;
}
|
Use WALL time for timer
|
Use WALL time for timer
|
C
|
mit
|
tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler
|
65931e9f800a97f9fa8af4aa8c26b2ed04ed8eb2
|
src/condor_includes/condor_collector.h
|
src/condor_includes/condor_collector.h
|
#ifndef __COLLECTOR_H__
#define __COLLECTOR_H__
#include "sched.h"
enum AdTypes
{
STARTD_AD,
SCHEDD_AD,
MASTER_AD,
GATEWAY_AD,
CKPT_SRVR_AD,
NUM_AD_TYPES
};
// collector commands
const int UPDATE_STARTD_AD = 0;
const int UPDATE_SCHEDD_AD = 1;
const int UPDATE_MASTER_AD = 2;
const int UPDATE_GATEWAY_AD = 3;
const int UPDATE_CKPT_SRVR_AD = 4;
const int QUERY_STARTD_ADS = 5;
const int QUERY_SCHEDD_ADS = 6;
const int QUERY_MASTER_ADS = 7;
const int QUERY_GATEWAY_ADS = 8;
const int QUERY_CKPT_SRVR_ADS = 9;
#endif // __COLLECTOR_H__
|
#ifndef __COLLECTOR_H__
#define __COLLECTOR_H__
#include "sched.h"
enum AdTypes
{
STARTD_AD,
SCHEDD_AD,
MASTER_AD,
GATEWAY_AD,
CKPT_SRVR_AD,
NUM_AD_TYPES
};
#include "condor_commands.h" // collector commands
#endif // __COLLECTOR_H__
|
Use condor_commands.h instead of defining commands here.
|
Use condor_commands.h instead of defining commands here.
|
C
|
apache-2.0
|
clalancette/condor-dcloud,djw8605/condor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,zhangzhehust/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,htcondor/htcondor,bbockelm/condor-network-accounting,djw8605/condor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,htcondor/htcondor,djw8605/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,djw8605/htcondor,djw8605/htcondor,htcondor/htcondor,bbockelm/condor-network-accounting,zhangzhehust/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,djw8605/condor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,djw8605/htcondor,neurodebian/htcondor,djw8605/condor,neurodebian/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,zhangzhehust/htcondor,djw8605/condor,djw8605/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,djw8605/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/condor,djw8605/condor,mambelli/osg-bosco-marco,neurodebian/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,htcondor/htcondor,clalancette/condor-dcloud,clalancette/condor-dcloud,neurodebian/htcondor,htcondor/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,djw8605/condor,neurodebian/htcondor,zhangzhehust/htcondor
|
d4b91732699737c33c64d949015e0f26bb5f22f2
|
doxygen/input/doc_hashing.h
|
doxygen/input/doc_hashing.h
|
/**
* @file
* Hashing module documentation file.
*/
/**
* @addtogroup hashing_module Hashing module
*
* The Hashing module provides one-way hashing functions. Such functions can be
* used for creating a hash message authentication code (HMAC) when sending a
* message. Such a HMAC can be used in combination with a private key
* for authentication, which is a message integrity control.
*
* All hash algorithms can be accessed via the generic MD layer (see
* \c md_init_ctx())
*
* The following hashing-algorithms are provided:
* - MD2, MD4, MD5 128-bit one-way hash functions by Ron Rivest (see
* \c md2_hmac(), \c md4_hmac() and \c md5_hmac()).
* - SHA-1, SHA-256, SHA-384/512 160-bit or more one-way hash functions by
* NIST and NSA (see\c sha1_hmac(), \c sha256_hmac() and \c sha512_hmac()).
*
* This module provides one-way hashing which can be used for authentication.
*/
|
/**
* @file
* Hashing module documentation file.
*/
/**
* @addtogroup hashing_module Hashing module
*
* The Hashing module provides one-way hashing functions. Such functions can be
* used for creating a hash message authentication code (HMAC) when sending a
* message. Such a HMAC can be used in combination with a private key
* for authentication, which is a message integrity control.
*
* All hash algorithms can be accessed via the generic MD layer (see
* \c md_init_ctx())
*
* The following hashing-algorithms are provided:
* - MD2, MD4, MD5 128-bit one-way hash functions by Ron Rivest.
* - SHA-1, SHA-256, SHA-384/512 160-bit or more one-way hash functions by
* NIST and NSA.
*
* This module provides one-way hashing which can be used for authentication.
*/
|
Update doxygen documentation on HMAC
|
Update doxygen documentation on HMAC
|
C
|
apache-2.0
|
NXPmicro/mbedtls,ARMmbed/mbedtls,Mbed-TLS/mbedtls,Mbed-TLS/mbedtls,NXPmicro/mbedtls,ARMmbed/mbedtls,Mbed-TLS/mbedtls,NXPmicro/mbedtls,ARMmbed/mbedtls,NXPmicro/mbedtls,Mbed-TLS/mbedtls,ARMmbed/mbedtls
|
b0f91c40ff3f623c03b1ecbe5f929d3ef0b1a063
|
as/target/x86/proc.h
|
as/target/x86/proc.h
|
enum args {
AIMM = 1,
AIMM8,
AIMM16,
AIMM32,
AIMM64,
AREG_AX,
AREG_AL,
AREG_AH,
AREG_EAX,
AREG_BC,
AREG_BL,
AREG_BH,
AREG_EBX,
AREG_CX,
AREG_CL,
AREG_CH,
AREG_ECX,
AREG_DX,
AREG_DL,
AREG_DH,
AREG_EDX,
AREG_SI,
AREG_DI,
AREG_SP,
AREG_ESP,
AREG_EBP,
AREP,
};
|
enum args {
AIMM = 1,
AIMM8,
AIMM16,
AIMM32,
AIMM64,
AREG_CS,
AREG_DS,
AREG_SS,
AREG_ES
AREG_FS,
AREG_GS,
AREG_EFLAGS,
AREG_AX,
AREG_AL,
AREG_AH,
AREG_EAX,
AREG_RAX,
AREG_BX,
AREG_BL,
AREG_BH,
AREG_EBX,
AREG_RBX,
AREG_CX,
AREG_CL,
AREG_CH,
AREG_ECX,
AREG_RCX,
AREG_DX,
AREG_DL,
AREG_DH,
AREG_EDX,
AREG_RDX,
AREG_SI,
AREG_DI,
AREG_SP,
AREG_ESP,
AREG_RSP,
AREG_BP,
AREG_EBP,
AREG_RBP,
AREP,
};
|
Extend list of intel registers
|
[as] Extend list of intel registers
|
C
|
isc
|
k0gaMSX/scc,k0gaMSX/scc,k0gaMSX/scc
|
32165dbeaa2f8bac59051b6dc370d478aadc2633
|
pixeltypes.h
|
pixeltypes.h
|
#ifndef __INC_PIXELS_H
#define __INC_PIXELS_H
#include <stdint.h>
struct CRGB {
union {
struct { uint8_t r; uint8_t g; uint8_t b; };
uint8_t raw[3];
};
};
#ifdef SUPPORT_ARGB
struct CARGB {
union {
struct { uint8_t a; uint8_t g; uint8_t r; uint8_t b; };
uint8_t raw[4];
uint32_t all32;
};
};
#endif
struct CHSV {
union {
uint8_t hue;
uint8_t h; };
union {
uint8_t saturation;
uint8_t sat;
uint8_t s; };
union {
uint8_t value;
uint8_t val;
uint8_t v; };
};
// Define RGB orderings
enum EOrder {
RGB=0012,
RBG=0021,
GRB=0102,
GBR=0120,
BRG=0201,
BGR=0210
};
#endif
|
#ifndef __INC_PIXELS_H
#define __INC_PIXELS_H
#include <stdint.h>
struct CRGB {
union {
struct { uint8_t r; uint8_t g; uint8_t b; };
uint8_t raw[3];
};
inline uint8_t& operator[] (uint8_t x) __attribute__((always_inline)) { return raw[x]; }
};
#ifdef SUPPORT_ARGB
struct CARGB {
union {
struct { uint8_t a; uint8_t g; uint8_t r; uint8_t b; };
uint8_t raw[4];
uint32_t all32;
};
};
#endif
struct CHSV {
union {
struct {
union {
uint8_t hue;
uint8_t h; };
union {
uint8_t saturation;
uint8_t sat;
uint8_t s; };
union {
uint8_t value;
uint8_t val;
uint8_t v; };
};
uint8_t raw[3];
};
inline uint8_t& operator[](uint8_t x) __attribute__((always_inline)) { return raw[x]; }
};
// Define RGB orderings
enum EOrder {
RGB=0012,
RBG=0021,
GRB=0102,
GBR=0120,
BRG=0201,
BGR=0210
};
#endif
|
Add raw array access to hsv structure, and operator[] operations to hsv and rgb classes
|
Add raw array access to hsv structure, and operator[] operations to hsv and rgb classes
|
C
|
mit
|
liyanage/FastLED,eshkrab/FastLED-esp32,MattDurr/FastLED,NicoHood/FastLED,PaulStoffregen/FastLED,corbinstreehouse/FastLED,remspoor/FastLED,NicoHood/FastLED,felixLam/FastLED,kcouck/FastLED,neographophobic/FastLED,liyanage/FastLED,remspoor/FastLED,tullo-x86/FastLED,corbinstreehouse/FastLED,MattDurr/FastLED,yaneexy/FastLED,FastLED/FastLED,wsilverio/FastLED,neographophobic/FastLED,wilhelmryan/FastLED,MiketheChap/FastLED,wilhelmryan/FastLED,MiketheChap/FastLED,eshkrab/FastLED-esp32,wsilverio/FastLED,yaneexy/FastLED,ryankenney/FastLED,kcouck/FastLED,ryankenney/FastLED,FastLED/FastLED,PaulStoffregen/FastLED,FastLED/FastLED,felixLam/FastLED,PaulStoffregen/FastLED,FastLED/FastLED,tullo-x86/FastLED
|
9dd93ba12825a3aa6af1bfebf40a60292992d971
|
creator/plugins/docks/componentsdock/componentsdock.h
|
creator/plugins/docks/componentsdock/componentsdock.h
|
/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef GLUON_CREATOR_COMPONENTSDOCK_H
#define GLUON_CREATOR_COMPONENTSDOCK_H
#include <../../home/ahiemstra/Projects/gluon/creator/lib/widgets/dock.h>
namespace Gluon {
namespace Creator {
class ComponentsDock : public Gluon::Creator::Dock
{
public:
ComponentsDock(const QString& title, QWidget* parent = 0, Qt::WindowFlags flags = 0);
~ComponentsDock();
void setSelection(Gluon::GluonObject* obj = 0);
QAbstractItemView* view();
QAbstractItemModel* model();
private:
class ComponentsDockPrivate;
ComponentsDockPrivate* d;
};
}
}
#endif // GLUON_CREATOR_COMPONENTSDOCK_H
|
/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef GLUON_CREATOR_COMPONENTSDOCK_H
#define GLUON_CREATOR_COMPONENTSDOCK_H
#include "widgets/dock.h"
namespace Gluon {
namespace Creator {
class ComponentsDock : public Gluon::Creator::Dock
{
public:
ComponentsDock(const QString& title, QWidget* parent = 0, Qt::WindowFlags flags = 0);
~ComponentsDock();
void setSelection(Gluon::GluonObject* obj = 0);
QAbstractItemView* view();
QAbstractItemModel* model();
private:
class ComponentsDockPrivate;
ComponentsDockPrivate* d;
};
}
}
#endif // GLUON_CREATOR_COMPONENTSDOCK_H
|
Make creator compile without being on ahiemstra's machine ;)
|
Make creator compile without being on ahiemstra's machine ;)
|
C
|
lgpl-2.1
|
cgaebel/gluon,KDE/gluon,pranavrc/example-gluon,pranavrc/example-gluon,pranavrc/example-gluon,pranavrc/example-gluon,KDE/gluon,KDE/gluon,cgaebel/gluon,KDE/gluon,cgaebel/gluon,cgaebel/gluon
|
cd4c34d2a078b78ca31fd3bc5cbb210123dce89d
|
test/CodeGen/struct-passing.c
|
test/CodeGen/struct-passing.c
|
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -emit-llvm -o %t %s
// RUN: grep 'declare i32 @f0() readnone$' %t
// RUN: grep 'declare i32 @f1() readonly$' %t
// RUN: grep 'declare void @f2(.* sret)$' %t
// RUN: grep 'declare void @f3(.* sret)$' %t
// RUN: grep 'declare void @f4(.* byval)$' %t
// RUN: grep 'declare void @f5(.* byval)$' %t
// PR3835
typedef int T0;
typedef struct { int a[16]; } T1;
T0 __attribute__((const)) f0(void);
T0 __attribute__((pure)) f1(void);
T1 __attribute__((const)) f2(void);
T1 __attribute__((pure)) f3(void);
void __attribute__((const)) f4(T1 a);
void __attribute__((pure)) f5(T1 a);
void *ps[] = { f0, f1, f2, f3, f4, f5 };
|
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -emit-llvm -o %t %s
// RUN: grep 'declare i32 @f0() readnone ;' %t
// RUN: grep 'declare i32 @f1() readonly ;' %t
// RUN: grep 'declare void @f2(.* sret) ;' %t
// RUN: grep 'declare void @f3(.* sret) ;' %t
// RUN: grep 'declare void @f4(.* byval) ;' %t
// RUN: grep 'declare void @f5(.* byval) ;' %t
// PR3835
typedef int T0;
typedef struct { int a[16]; } T1;
T0 __attribute__((const)) f0(void);
T0 __attribute__((pure)) f1(void);
T1 __attribute__((const)) f2(void);
T1 __attribute__((pure)) f3(void);
void __attribute__((const)) f4(T1 a);
void __attribute__((pure)) f5(T1 a);
void *ps[] = { f0, f1, f2, f3, f4, f5 };
|
Correct this test for the fact that the number of uses is now printed in a comment.
|
Correct this test for the fact that the number of uses is now printed
in a comment.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@112813 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/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,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
|
6c915905f626c257222181886b7420a9a32d3360
|
src/vast/aliases.h
|
src/vast/aliases.h
|
#ifndef VAST_ALIASES_H
#define VAST_ALIASES_H
#include <cstdint>
#include <limits>
namespace vast {
/// Uniquely identifies a VAST event.
using event_id = uint64_t;
/// The smallest possible event ID.
static constexpr event_id min_event_id = 1;
/// The largest possible event ID.
static constexpr event_id max_event_id =
std::numeric_limits<event_id>::max() - 1;
/// Uniquely identifies a VAST type.
using type_id = uint64_t;
} // namespace vast
#endif
|
#ifndef VAST_ALIASES_H
#define VAST_ALIASES_H
#include <cstdint>
#include <limits>
namespace vast {
/// Uniquely identifies a VAST event.
using event_id = uint64_t;
/// The invalid event ID.
static constexpr event_id invalid_event_id = 0;
/// The smallest possible event ID.
static constexpr event_id min_event_id = 1;
/// The largest possible event ID.
static constexpr event_id max_event_id =
std::numeric_limits<event_id>::max() - 1;
/// Uniquely identifies a VAST type.
using type_id = uint64_t;
} // namespace vast
#endif
|
Add alias for invalid event ID.
|
Add alias for invalid event ID.
|
C
|
bsd-3-clause
|
mavam/vast,pmos69/vast,mavam/vast,mavam/vast,pmos69/vast,pmos69/vast,vast-io/vast,vast-io/vast,vast-io/vast,mavam/vast,vast-io/vast,vast-io/vast,pmos69/vast
|
b90c3bb659a1e0e1f6d1f7715ba96614f25543d3
|
src/clientversion.h
|
src/clientversion.h
|
#ifndef CLIENTVERSION_H
#define CLIENTVERSION_H
//
// client versioning and copyright year
//
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 1
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 0
// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
// Copyright year (2009-this)
// Todo: update this when changing our copyright comments in the source
#define COPYRIGHT_YEAR 2013
// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
#define STRINGIZE(X) DO_STRINGIZE(X)
#define DO_STRINGIZE(X) #X
#endif // CLIENTVERSION_H
|
#ifndef CLIENTVERSION_H
#define CLIENTVERSION_H
//
// client versioning and copyright year
//
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 2
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 0
// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
// Copyright year (2009-this)
// Todo: update this when changing our copyright comments in the source
#define COPYRIGHT_YEAR 2013
// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
#define STRINGIZE(X) DO_STRINGIZE(X)
#define DO_STRINGIZE(X) #X
#endif // CLIENTVERSION_H
|
Change client version number to 1.2.0.0
|
Change client version number to 1.2.0.0
|
C
|
mit
|
TigerCoinDev/Tigercoin,TigerCoinDev/Tigercoin,TigerCoinDev/Tigercoin,TigerCoinDev/Tigercoin,TigerCoinDev/Tigercoin
|
ee8e471d1b658635f9873faa1b2b5de41770216f
|
ghighlighter/gh-datastore.h
|
ghighlighter/gh-datastore.h
|
#ifndef GH_DATASTORE_H
#define GH_DATASTORE_H
#include <sqlite3.h>
struct reading
{
int id;
char *title;
int readmill_id;
int total_pages;
};
sqlite3 *gh_datastore_open_db (char *data_dir);
int gh_datastore_get_db_version (sqlite3 *db);
void gh_datastore_set_db_version (sqlite3 *db, int version);
#endif
|
#ifndef GH_DATASTORE_H
#define GH_DATASTORE_H
#include <sqlite3.h>
typedef struct
{
int id;
char *title;
int readmill_id;
int total_pages;
} Reading;
sqlite3 *gh_datastore_open_db (char *data_dir);
int gh_datastore_get_db_version (sqlite3 *db);
void gh_datastore_set_db_version (sqlite3 *db, int version);
#endif
|
Use typedef for reading struct
|
Use typedef for reading struct
|
C
|
mit
|
chdorner/ghighlighter-c
|
d8d27dc450b5862afa2fbf29579efd70442d0479
|
sandbox/linux/services/linux_syscalls.h
|
sandbox/linux/services/linux_syscalls.h
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This header will be kept up to date so that we can compile system-call
// policies even when system headers are old.
// System call numbers are accessible through __NR_syscall_name.
#ifndef SANDBOX_LINUX_SERVICES_LINUX_SYSCALLS_H_
#define SANDBOX_LINUX_SERVICES_LINUX_SYSCALLS_H_
#if defined(__x86_64__)
#include "sandbox/linux/services/x86_64_linux_syscalls.h"
#endif
#if defined(__i386__)
#include "sandbox/linux/services/x86_32_linux_syscalls.h"
#endif
#if defined(__arm__) && defined(__ARM_EABI__)
#include "sandbox/linux/services/arm_linux_syscalls.h"
#endif
#if defined(__mips__)
#include "sandbox/linux/services/mips_linux_syscalls.h"
#endif
#endif // SANDBOX_LINUX_SERVICES_LINUX_SYSCALLS_H_
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This header will be kept up to date so that we can compile system-call
// policies even when system headers are old.
// System call numbers are accessible through __NR_syscall_name.
#ifndef SANDBOX_LINUX_SERVICES_LINUX_SYSCALLS_H_
#define SANDBOX_LINUX_SERVICES_LINUX_SYSCALLS_H_
#if defined(__x86_64__)
#include "sandbox/linux/services/x86_64_linux_syscalls.h"
#endif
#if defined(__i386__)
#include "sandbox/linux/services/x86_32_linux_syscalls.h"
#endif
#if defined(__arm__) && defined(__ARM_EABI__)
#include "sandbox/linux/services/arm_linux_syscalls.h"
#endif
#if defined(__mips__) && defined(_ABIO32)
#include "sandbox/linux/services/mips_linux_syscalls.h"
#endif
#endif // SANDBOX_LINUX_SERVICES_LINUX_SYSCALLS_H_
|
Add ABI check for syscall numbers definitions
|
[MIPS] Add ABI check for syscall numbers definitions
In file mips_linux_syscalls.h are definitions of syscall
numbers for O32 ABI, so this check is needed in order for
Mips architectures with other ABIs to work properly.
BUG=400684
TEST=compile sandbox_linux_unittest for MIPS32 and MIPS64
Review URL: https://codereview.chromium.org/446213003
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@288252 0039d316-1c4b-4281-b951-d872f2087c98
|
C
|
bsd-3-clause
|
ondra-novak/chromium.src,littlstar/chromium.src,ondra-novak/chromium.src,ondra-novak/chromium.src,littlstar/chromium.src,bright-sparks/chromium-spacewalk,ondra-novak/chromium.src,ondra-novak/chromium.src,bright-sparks/chromium-spacewalk,bright-sparks/chromium-spacewalk,ondra-novak/chromium.src,littlstar/chromium.src,bright-sparks/chromium-spacewalk,ondra-novak/chromium.src,littlstar/chromium.src,littlstar/chromium.src,bright-sparks/chromium-spacewalk,bright-sparks/chromium-spacewalk,ondra-novak/chromium.src,littlstar/chromium.src,littlstar/chromium.src,ondra-novak/chromium.src,bright-sparks/chromium-spacewalk,littlstar/chromium.src,bright-sparks/chromium-spacewalk,bright-sparks/chromium-spacewalk
|
736dc11a46bbdf20c807bca3e7585367c1fbc117
|
lib/ortho/ortho.h
|
lib/ortho/ortho.h
|
/* $Id$Revision: */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (c) 1994-2004 AT&T Corp. *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Corp. *
* *
* Information and Software Systems Research *
* AT&T Research, Florham Park NJ *
**********************************************************/
#ifndef ORTHO_H
#define ORTHO_H
#include <render.h>
void orthoEdges (Agraph_t* g, int useLbls, splineInfo* sinfo);
#endif
|
/* $Id$Revision: */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (c) 1994-2004 AT&T Corp. *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Corp. *
* *
* Information and Software Systems Research *
* AT&T Research, Florham Park NJ *
**********************************************************/
#ifndef ORTHO_H
#define ORTHO_H
#include <render.h>
void orthoEdges (Agraph_t* g, int useLbls);
#endif
|
Add to comments; remove use of sinfo from calling routines; adjust code to play well with other routing functions; add framework for handling loops
|
Add to comments;
remove use of sinfo from calling routines;
adjust code to play well with other routing functions;
add framework for handling loops
|
C
|
epl-1.0
|
kbrock/graphviz,BMJHayward/graphviz,ellson/graphviz,MjAbuz/graphviz,pixelglow/graphviz,MjAbuz/graphviz,pixelglow/graphviz,pixelglow/graphviz,ellson/graphviz,MjAbuz/graphviz,tkelman/graphviz,jho1965us/graphviz,pixelglow/graphviz,MjAbuz/graphviz,tkelman/graphviz,ellson/graphviz,kbrock/graphviz,tkelman/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,kbrock/graphviz,ellson/graphviz,kbrock/graphviz,tkelman/graphviz,tkelman/graphviz,BMJHayward/graphviz,ellson/graphviz,jho1965us/graphviz,pixelglow/graphviz,tkelman/graphviz,BMJHayward/graphviz,tkelman/graphviz,kbrock/graphviz,pixelglow/graphviz,kbrock/graphviz,kbrock/graphviz,ellson/graphviz,ellson/graphviz,ellson/graphviz,BMJHayward/graphviz,kbrock/graphviz,jho1965us/graphviz,ellson/graphviz,kbrock/graphviz,BMJHayward/graphviz,jho1965us/graphviz,tkelman/graphviz,MjAbuz/graphviz,jho1965us/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,jho1965us/graphviz,MjAbuz/graphviz,tkelman/graphviz,BMJHayward/graphviz,jho1965us/graphviz,jho1965us/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,jho1965us/graphviz,jho1965us/graphviz,tkelman/graphviz,tkelman/graphviz,jho1965us/graphviz,pixelglow/graphviz,pixelglow/graphviz,ellson/graphviz,pixelglow/graphviz,ellson/graphviz,MjAbuz/graphviz,pixelglow/graphviz,MjAbuz/graphviz,pixelglow/graphviz,kbrock/graphviz,MjAbuz/graphviz,kbrock/graphviz
|
ab7b4a594efab038c9b40f52b0a525c445a25d8d
|
src/ArticleCellView.h
|
src/ArticleCellView.h
|
//
// ArticleCellView.h
// PXListView
//
// Adapted from PXListView by Alex Rozanski
// Modified by Barijaona Ramaholimihaso
//
#import <Cocoa/Cocoa.h>
#import "PXListViewCell.h"
#import "ArticleView.h"
@interface ArticleCellView : PXListViewCell
{
AppController * controller;
ArticleView *articleView;
NSProgressIndicator * progressIndicator;
}
@property (nonatomic, retain) ArticleView *articleView;
@property BOOL inProgress;
@property int folderId;
// Public functions
-(id)initWithReusableIdentifier: (NSString*)identifier inFrame:(NSRect)frameRect;
@end
|
//
// ArticleCellView.h
// PXListView
//
// Adapted from PXListView by Alex Rozanski
// Modified by Barijaona Ramaholimihaso
//
#import <Cocoa/Cocoa.h>
#import "PXListViewCell.h"
#import "ArticleView.h"
@interface ArticleCellView : PXListViewCell
{
AppController * controller;
ArticleView *articleView;
NSProgressIndicator * progressIndicator;
BOOL inProgress;
int folderId;
}
@property (nonatomic, retain) ArticleView *articleView;
@property BOOL inProgress;
@property int folderId;
// Public functions
-(id)initWithReusableIdentifier: (NSString*)identifier inFrame:(NSRect)frameRect;
@end
|
Fix a static analyzer error
|
Fix a static analyzer error
|
C
|
apache-2.0
|
Feitianyuan/vienna-rss,josh64x2/vienna-rss,lapcat/vienna-rss,Eitot/vienna-rss,aidanamavi/vienna-rss,iamjasonchoi/vienna-rss,tothgy/vienna-rss,barijaona/vienna-rss,ViennaRSS/vienna-rss,Feitianyuan/vienna-rss,barijaona/vienna-rss,iamjasonchoi/vienna-rss,barijaona/vienna-rss,Eitot/vienna-rss,barijaona/vienna-rss,lapcat/vienna-rss,dak180/vienna,tothgy/vienna-rss,ViennaRSS/vienna-rss,barijaona/vienna-rss,tothgy/vienna-rss,ViennaRSS/vienna-rss,Eitot/vienna-rss,lapcat/vienna-rss,josh64x2/vienna-rss,josh64x2/vienna-rss,lapcat/vienna-rss,tothgy/vienna-rss,iamjasonchoi/vienna-rss,aidanamavi/vienna-rss,aidanamavi/vienna-rss,dak180/vienna,josh64x2/vienna-rss,ViennaRSS/vienna-rss,dak180/vienna,ViennaRSS/vienna-rss,Eitot/vienna-rss,Feitianyuan/vienna-rss,josh64x2/vienna-rss,dak180/vienna
|
38d665c82ba3dedc51f597f519dac84546588638
|
include/shmlog_tags.h
|
include/shmlog_tags.h
|
/*
* $Id$
*
* Define the tags in the shared memory in a reusable format.
* Whoever includes this get to define what the SLTM macro does.
*
*/
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionClose)
SLTM(ClientAddr)
SLTM(Request)
SLTM(URL)
SLTM(Protocol)
SLTM(Headers)
|
/*
* $Id$
*
* Define the tags in the shared memory in a reusable format.
* Whoever includes this get to define what the SLTM macro does.
*
*/
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionClose)
SLTM(ClientAddr)
SLTM(Request)
SLTM(URL)
SLTM(Protocol)
SLTM(H_Unknown)
#define HTTPH(a, b) SLTM(b)
#include "http_headers.h"
#undef HTTPH
|
Use http_headers.h to define HTTP header tags for logging
|
Use http_headers.h to define HTTP header tags for logging
git-svn-id: 2c9807fa3ff65b17195bd55dc8a6c4261e10127b@90 d4fa192b-c00b-0410-8231-f00ffab90ce4
|
C
|
bsd-2-clause
|
varnish/Varnish-Cache,ajasty-cavium/Varnish-Cache,ssm/pkg-varnish,zhoualbeart/Varnish-Cache,franciscovg/Varnish-Cache,ajasty-cavium/Varnish-Cache,ambernetas/varnish-cache,zhoualbeart/Varnish-Cache,gauthier-delacroix/Varnish-Cache,drwilco/varnish-cache-drwilco,drwilco/varnish-cache-drwilco,ssm/pkg-varnish,feld/Varnish-Cache,mrhmouse/Varnish-Cache,ssm/pkg-varnish,wikimedia/operations-debs-varnish,ajasty-cavium/Varnish-Cache,1HLtd/Varnish-Cache,1HLtd/Varnish-Cache,gauthier-delacroix/Varnish-Cache,mrhmouse/Varnish-Cache,chrismoulton/Varnish-Cache,gquintard/Varnish-Cache,gauthier-delacroix/Varnish-Cache,feld/Varnish-Cache,alarky/varnish-cache-doc-ja,alarky/varnish-cache-doc-ja,1HLtd/Varnish-Cache,feld/Varnish-Cache,ajasty-cavium/Varnish-Cache,drwilco/varnish-cache-old,gquintard/Varnish-Cache,franciscovg/Varnish-Cache,alarky/varnish-cache-doc-ja,wikimedia/operations-debs-varnish,wikimedia/operations-debs-varnish,ambernetas/varnish-cache,gauthier-delacroix/Varnish-Cache,chrismoulton/Varnish-Cache,varnish/Varnish-Cache,mrhmouse/Varnish-Cache,franciscovg/Varnish-Cache,wikimedia/operations-debs-varnish,alarky/varnish-cache-doc-ja,drwilco/varnish-cache-drwilco,alarky/varnish-cache-doc-ja,zhoualbeart/Varnish-Cache,franciscovg/Varnish-Cache,drwilco/varnish-cache-old,mrhmouse/Varnish-Cache,zhoualbeart/Varnish-Cache,ajasty-cavium/Varnish-Cache,gquintard/Varnish-Cache,zhoualbeart/Varnish-Cache,ambernetas/varnish-cache,chrismoulton/Varnish-Cache,1HLtd/Varnish-Cache,varnish/Varnish-Cache,feld/Varnish-Cache,gauthier-delacroix/Varnish-Cache,feld/Varnish-Cache,ssm/pkg-varnish,gquintard/Varnish-Cache,varnish/Varnish-Cache,chrismoulton/Varnish-Cache,franciscovg/Varnish-Cache,wikimedia/operations-debs-varnish,ssm/pkg-varnish,varnish/Varnish-Cache,chrismoulton/Varnish-Cache,drwilco/varnish-cache-old,mrhmouse/Varnish-Cache
|
4ee20e213b952faeaf1beb08b8f78600f6c79f1c
|
master/mcoils.h
|
master/mcoils.h
|
#define _MASTERCOILS
#include <inttypes.h>
//Functions for building requests
extern uint8_t MODBUSBuildRequest01( uint8_t, uint16_t, uint16_t );
extern uint8_t MODBUSBuildRequest05( uint8_t, uint16_t, uint16_t );
extern uint8_t MODBUSBuildRequest15( uint8_t, uint16_t, uint16_t, uint8_t * );
//Functions for parsing responses
extern void MODBUSParseResponse01( union MODBUSParser *, union MODBUSParser * );
//extern void MODBUSParseResponse05( union MODBUSParser *, union MODBUSParser * );
//extern void MODBUSParseResponse15( union MODBUSParser *, union MODBUSParser * );
|
#define _MASTERCOILS
#include <inttypes.h>
//Functions for building requests
extern uint8_t MODBUSBuildRequest01( uint8_t, uint16_t, uint16_t );
extern uint8_t MODBUSBuildRequest05( uint8_t, uint16_t, uint16_t );
extern uint8_t MODBUSBuildRequest15( uint8_t, uint16_t, uint16_t, uint8_t * );
//Functions for parsing responses
extern void MODBUSParseResponse01( union MODBUSParser *, union MODBUSParser * );
extern void MODBUSParseResponse05( union MODBUSParser *, union MODBUSParser * );
extern void MODBUSParseResponse15( union MODBUSParser *, union MODBUSParser * );
|
Add prototypes for functions for parsing slave's responses
|
Add prototypes for functions for parsing slave's responses
|
C
|
mit
|
Jacajack/modlib
|
15c7a4f2089b5688f7ff3be22fd349d8e3530267
|
test/binaryTreeNode.h
|
test/binaryTreeNode.h
|
#include <unordered_set>
#include "../src/include/gc_obj.h"
#include "../src/include/collector.h"
class BinaryTreeNode : public gc_obj {
public:
BinaryTreeNode(const int id);
~BinaryTreeNode() = delete;
int size() const;
void curtailToLevel(const int lvl);
void extendToLevel(const int size,Collector* collector);
void addLeftChild(BinaryTreeNode* leftChild);
void addRightChild(BinaryTreeNode* rightChild);
virtual void finalize();
virtual std::unordered_set<gc_obj*> getManagedChildren();
private:
int id;
BinaryTreeNode* leftChild;
BinaryTreeNode* rightChild;
};
|
#include <unordered_set>
#include "../src/include/gc_obj.h"
class BinaryTreeNode : public gc_obj {
public:
BinaryTreeNode(const int id);
int size() const;
void curtailToLevel(const int lvl);
void extendToLevel(const int size);
void addLeftChild(BinaryTreeNode* leftChild);
void addRightChild(BinaryTreeNode* rightChild);
virtual void finalize();
virtual std::unordered_set<gc_obj*> getManagedChildren();
private:
int id;
BinaryTreeNode* leftChild;
BinaryTreeNode* rightChild;
};
|
Remove manual addObject usage from the collector
|
Remove manual addObject usage from the collector
|
C
|
mit
|
henfredemars/simple-collector
|
5c443e8dd6db31588d8926af0ebb6dc60501c5f2
|
src/plugins/render/weather/BBCWeatherItem.h
|
src/plugins/render/weather/BBCWeatherItem.h
|
//
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2009 Bastian Holst <bastianholst@gmx.de>
//
#ifndef BBCWEATHERITEM_H
#define BBCWEATHERITEM_H
#include "WeatherItem.h"
class QString;
class QUrl;
namespace Marble
{
class BBCWeatherItem : public WeatherItem
{
public:
BBCWeatherItem( QObject *parent = 0 );
~BBCWeatherItem();
virtual bool request( const QString& type );
QString service() const;
void addDownloadedFile( const QString& url, const QString& type );
QUrl observationUrl() const;
QUrl forecastUrl() const;
quint32 bbcId() const;
void setBbcId( quint32 id );
QString creditHtml() const;
private:
quint32 m_bbcId;
bool m_observationRequested;
bool m_forecastRequested;
};
} // namespace Marble
#endif // BBCWEATHERITEM_H
|
//
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2009 Bastian Holst <bastianholst@gmx.de>
//
#ifndef BBCWEATHERITEM_H
#define BBCWEATHERITEM_H
#include "WeatherItem.h"
class QString;
class QUrl;
namespace Marble
{
class BBCWeatherItem : public WeatherItem
{
Q_OBJECT
public:
BBCWeatherItem( QObject *parent = 0 );
~BBCWeatherItem();
virtual bool request( const QString& type );
QString service() const;
void addDownloadedFile( const QString& url, const QString& type );
QUrl observationUrl() const;
QUrl forecastUrl() const;
quint32 bbcId() const;
void setBbcId( quint32 id );
QString creditHtml() const;
private:
quint32 m_bbcId;
bool m_observationRequested;
bool m_forecastRequested;
};
} // namespace Marble
#endif // BBCWEATHERITEM_H
|
Add Q_OBJECT macro (requested by lupdate).
|
Add Q_OBJECT macro (requested by lupdate).
svn path=/trunk/KDE/kdeedu/marble/; revision=1205732
|
C
|
lgpl-2.1
|
David-Gil/marble-dev,oberluz/marble,quannt24/marble,adraghici/marble,tzapzoor/marble,rku/marble,tzapzoor/marble,David-Gil/marble-dev,utkuaydin/marble,probonopd/marble,quannt24/marble,adraghici/marble,oberluz/marble,adraghici/marble,utkuaydin/marble,Earthwings/marble,Earthwings/marble,oberluz/marble,tzapzoor/marble,utkuaydin/marble,adraghici/marble,tzapzoor/marble,utkuaydin/marble,Earthwings/marble,Earthwings/marble,probonopd/marble,tzapzoor/marble,quannt24/marble,rku/marble,adraghici/marble,tucnak/marble,probonopd/marble,tucnak/marble,Earthwings/marble,David-Gil/marble-dev,tucnak/marble,probonopd/marble,quannt24/marble,probonopd/marble,tucnak/marble,utkuaydin/marble,utkuaydin/marble,rku/marble,oberluz/marble,David-Gil/marble-dev,rku/marble,Earthwings/marble,AndreiDuma/marble,tucnak/marble,AndreiDuma/marble,tzapzoor/marble,adraghici/marble,AndreiDuma/marble,oberluz/marble,quannt24/marble,tucnak/marble,David-Gil/marble-dev,quannt24/marble,probonopd/marble,AndreiDuma/marble,AndreiDuma/marble,tucnak/marble,AndreiDuma/marble,David-Gil/marble-dev,rku/marble,rku/marble,tzapzoor/marble,oberluz/marble,quannt24/marble,tzapzoor/marble,probonopd/marble
|
b157c4c47402d1086d3324bca15aba09db54e03f
|
KTp/message-filters-private.h
|
KTp/message-filters-private.h
|
#include "message-processor.h"
class UrlFilter : public AbstractMessageFilter
{
virtual void filterMessage(Message& message);
};
|
#include "message-processor.h"
class UrlFilter : public AbstractMessageFilter
{
virtual void filterMessage(Message& message);
};
class ImageFilter : public AbstractMessageFilter
{
virtual void filterMessage(Message& message);
};
class EmoticonFilter : public AbstractMessageFilter
{
virtual void filterMessage(Message& message);
};
|
Create headers for ImageFilter and EmoticonFilter
|
Create headers for ImageFilter and EmoticonFilter
|
C
|
lgpl-2.1
|
KDE/ktp-common-internals,leonhandreke/ktp-common-internals,KDE/ktp-common-internals,leonhandreke/ktp-common-internals,KDE/ktp-common-internals,leonhandreke/ktp-common-internals
|
8b22cf8108255c4771386ad3101e0058684cd757
|
SSPSolution/SSPSolution/DebugHandler.h
|
SSPSolution/SSPSolution/DebugHandler.h
|
#ifndef SSPAPPLICATION_DEBUG_DEBUGHANDLER_H
#define SSPAPPLICATION_DEBUG_DEBUGHANDLER_H
#include <vector>
#include <iostream>
#include <Windows.h>
class DebugHandler
{
private:
std::vector<LARGE_INTEGER> m_timers;
std::vector<std::string> m_labels;
std::vector<unsigned short int> m_timerMins;
std::vector<unsigned short int> m_timerMaxs;
std::vector<float> m_customValues;
unsigned short int m_lastFPS[10];
unsigned short int m_lastFPSCurr;
public:
DebugHandler();
~DebugHandler();
int StartTimer(std::string label); //returns timer ID, -1 fail
int EndTimer();
int EndTimer(int timerID);
int StartProgram();
int EndProgram();
int ShowFPS(bool show);
int CreateCustomLabel(std::string label, float value); //returns label ID, -1 fail
int UpdateCustomLabel(int labelID, float newValue);
int Display();
};
#endif
|
#ifndef SSPAPPLICATION_DEBUG_DEBUGHANDLER_H
#define SSPAPPLICATION_DEBUG_DEBUGHANDLER_H
#include <vector>
#include <iostream>
#include <Windows.h>
class DebugHandler
{
private:
std::vector<LARGE_INTEGER> m_timers;
std::vector<std::string> m_labels;
std::vector<unsigned short int> m_timerMins;
std::vector<unsigned short int> m_timerMaxs;
std::vector<float> m_customValues;
unsigned short int m_frameTimes[10];
unsigned short int m_currFrameTimesPtr;
public:
DebugHandler();
~DebugHandler();
int StartTimer(std::string label); //returns timer ID, -1 fail
int EndTimer();
int EndTimer(int timerID);
int StartProgram();
int EndProgram();
int ShowFPS(bool show);
int CreateCustomLabel(std::string label, float value); //returns label ID, -1 fail
int UpdateCustomLabel(int labelID, float newValue);
int Display();
};
#endif
|
UPDATE some variable name changes
|
UPDATE some variable name changes
|
C
|
apache-2.0
|
Chringo/SSP,Chringo/SSP
|
9e08143850140aa3ebc764c25c8ca85ae7e30bdb
|
hab/proxr/cb-set-resource.c
|
hab/proxr/cb-set-resource.c
|
#include <string.h>
#include "proxrcmds.h"
#include "sim-hab.h"
void cb_set_resource(bionet_resource_t *resource, bionet_value_t *value)
{
uint8_t data;
float content;
int id;
bionet_node_t *node;
bionet_value_get_uint8(value, &data);
if(data < 0 || data > 255)
return;
node = bionet_resource_get_node(resource);
// get index of resource
//FIXME: probably a better way to do this
for(int i=0; i<16; i++)
{
char buf[5];
char name[24];
strcpy(name, "Potentiometer\0");
sprintf(buf,"%d", i);
int len = strlen(buf);
buf[len] = '\0';
strcat(name, buf);
if(bionet_resource_matches_id(resource, name))
{
id = i;
break;
}
}
// command proxr to adjust to new value
set_potentiometer(id, data);
// set resources datapoint to new value
content = data*POT_CONVERSION;
bionet_resource_set_float(resource, content, NULL);
hab_report_datapoints(node);
}
|
#include <string.h>
#include "proxrcmds.h"
#include "sim-hab.h"
void cb_set_resource(bionet_resource_t *resource, bionet_value_t *value)
{
float data;
float content;
int id;
bionet_node_t *node;
bionet_value_get_float(value, &data);
if(data < 0 || data > 255)
return;
node = bionet_resource_get_node(resource);
// get index of resource
//FIXME: probably a better way to do this
for(int i=0; i<16; i++)
{
char buf[5];
char name[24];
strcpy(name, "Potentiometer\0");
sprintf(buf,"%d", i);
int len = strlen(buf);
buf[len] = '\0';
strcat(name, buf);
if(bionet_resource_matches_id(resource, name))
{
id = i;
break;
}
}
// command proxr to adjust to new value
set_potentiometer(id, (int)data);
// set resources datapoint to new value
content = data*POT_CONVERSION;
bionet_resource_set_float(resource, content, NULL);
hab_report_datapoints(node);
}
|
Modify set resource. Using floats now.
|
Modify set resource. Using floats now.
|
C
|
lgpl-2.1
|
ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead
|
d826393cdebe340b3716002bfb1298ab19b57e83
|
include/asm-ia64/resource.h
|
include/asm-ia64/resource.h
|
#ifndef _ASM_IA64_RESOURCE_H
#define _ASM_IA64_RESOURCE_H
#include <asm/ustack.h>
#define _STK_LIM_MAX DEFAULT_USER_STACK_SIZE
#include <asm-generic/resource.h>
#endif /* _ASM_IA64_RESOURCE_H */
|
#ifndef _ASM_IA64_RESOURCE_H
#define _ASM_IA64_RESOURCE_H
#include <asm/ustack.h>
#include <asm-generic/resource.h>
#endif /* _ASM_IA64_RESOURCE_H */
|
Remove stack hard limit on ia64
|
[IA64] Remove stack hard limit on ia64
Un-Breaks pthreads, since Oct 2003.
Signed-off-by: Olaf Hering <ded022db89399a060a39da31922f173c6556c2d9@aepfle.de>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Tony Luck <e7984595ec0368ff920a7b3521dc7093683f6f26@intel.com>
|
C
|
mit
|
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,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
|
312dfd2307f1acc406d61135b91081b3d4115e8a
|
Settings/Controls/Control.h
|
Settings/Controls/Control.h
|
#pragma once
#include <Windows.h>
#include <functional>
#include <string>
class Control {
public:
Control();
Control(int id, HWND parent);
~Control();
virtual RECT Dimensions();
virtual void Enable();
virtual void Disable();
virtual bool Enabled();
virtual void Enabled(bool enabled);
virtual std::wstring Text();
virtual int TextAsInt();
virtual bool Text(std::wstring text);
virtual bool Text(int value);
void WindowExStyle();
void WindowExStyle(long exStyle);
void AddWindowExStyle(long exStyle);
void RemoveWindowExStyle(long exStyle);
/// <summary>Handles WM_COMMAND messages.</summary>
/// <param name="nCode">Control-defined notification code</param>
virtual DLGPROC Command(unsigned short nCode);
/// <summary>Handles WM_NOTIFY messages.</summary>
/// <param name="nHdr">Notification header structure</param>
virtual DLGPROC Notification(NMHDR *nHdr);
protected:
int _id;
HWND _hWnd;
HWND _parent;
protected:
static const int MAX_EDITSTR = 0x4000;
};
|
#pragma once
#include <Windows.h>
#include <functional>
#include <string>
class Control {
public:
Control();
Control(int id, HWND parent);
~Control();
virtual RECT Dimensions();
virtual void Enable();
virtual void Disable();
virtual bool Enabled();
virtual void Enabled(bool enabled);
virtual std::wstring Text();
virtual int TextAsInt();
virtual bool Text(std::wstring text);
virtual bool Text(int value);
void WindowExStyle();
void WindowExStyle(long exStyle);
void AddWindowExStyle(long exStyle);
void RemoveWindowExStyle(long exStyle);
/// <summary>Handles WM_COMMAND messages.</summary>
/// <param name="nCode">Control-defined notification code</param>
virtual DLGPROC Command(unsigned short nCode);
/// <summary>Handles WM_NOTIFY messages.</summary>
/// <param name="nHdr">Notification header structure</param>
virtual DLGPROC Notification(NMHDR *nHdr);
protected:
int _id;
HWND _hWnd;
HWND _parent;
protected:
static const int MAX_EDITSTR = 4096;
};
|
Decrease MAX_EDITSTR. Was way too big.
|
Decrease MAX_EDITSTR. Was way too big.
|
C
|
bsd-2-clause
|
malensek/3RVX,malensek/3RVX,Soulflare3/3RVX,Soulflare3/3RVX,Soulflare3/3RVX,malensek/3RVX
|
9db141ce4a4033e3c1ac5b7b69d55ff85d62a27f
|
libtu/util.h
|
libtu/util.h
|
/*
* libtu/util.h
*
* Copyright (c) Tuomo Valkonen 1999-2002.
*
* You may distribute and modify this library under the terms of either
* the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
*/
#ifndef LIBTU_UTIL_H
#define LIBTU_UTIL_H
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include "types.h"
#include "optparser.h"
extern void libtu_init(const char *argv0);
extern const char *libtu_progname();
extern const char *libtu_progbasename();
#endif /* LIBTU_UTIL_H */
|
/*
* libtu/util.h
*
* Copyright (c) Tuomo Valkonen 1999-2002.
*
* You may distribute and modify this library under the terms of either
* the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
*/
#ifndef LIBTU_UTIL_H
#define LIBTU_UTIL_H
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include "types.h"
#include "optparser.h"
/**
* @parame argv0 The program name used to invoke the current program, with
* path (if specified). Unfortunately it is generally not easy to determine
* the encoding of this string, so we don't require a specific one here.
*
* @see http://stackoverflow.com/questions/5408730/what-is-the-encoding-of-argv
*/
extern void libtu_init(const char *argv0);
/**
* The program name used to invoke the current program, with path (if
* supplied). Unfortunately the encoding is undefined.
*/
extern const char *libtu_progname();
/**
* The program name used to invoke the current program, without path.
* Unfortunately the encoding is undefined.
*/
extern const char *libtu_progbasename();
#endif /* LIBTU_UTIL_H */
|
Document (lack of) character encoding rules in the API
|
Document (lack of) character encoding rules in the API
|
C
|
lgpl-2.1
|
p5n/notion,dkogan/notion.xfttest,anoduck/notion,anoduck/notion,raboof/notion,knixeur/notion,p5n/notion,dkogan/notion.xfttest,dkogan/notion,dkogan/notion,dkogan/notion.xfttest,neg-serg/notion,anoduck/notion,dkogan/notion,raboof/notion,anoduck/notion,knixeur/notion,dkogan/notion,anoduck/notion,knixeur/notion,neg-serg/notion,neg-serg/notion,dkogan/notion,p5n/notion,p5n/notion,p5n/notion,knixeur/notion,neg-serg/notion,knixeur/notion,raboof/notion,dkogan/notion.xfttest,raboof/notion
|
95d75ab83bf01bea87cc27af747e6da9c6c4b19d
|
ProcessLauncher/Util.h
|
ProcessLauncher/Util.h
|
#pragma once
#include <type_traits>
namespace ugly
{
template<typename T> constexpr const bool is_enum_flag = false;
template<typename T = typename std::enable_if<is_enum_flag<T>, T>::type>
class auto_bool
{
private:
T val_;
public:
constexpr auto_bool(T val) : val_(val) {}
constexpr operator T() const { return val_; }
constexpr explicit operator bool() const
{
return static_cast<std::underlying_type_t<T>>(val_) != 0;
}
};
template <typename T>
std::enable_if_t<is_enum_flag<T>, auto_bool<T>> operator&(T lhs, T rhs)
{
return static_cast<T>(
static_cast<typename std::underlying_type<T>::type>(lhs) &
static_cast<typename std::underlying_type<T>::type>(rhs));
}
template <typename T>
std::enable_if_t<is_enum_flag<T>, T> operator|(T lhs, T rhs)
{
return static_cast<T>(
static_cast<typename std::underlying_type<T>::type>(lhs) |
static_cast<typename std::underlying_type<T>::type>(rhs));
}
}
|
#pragma once
#include <type_traits>
namespace ugly
{
template<typename T> constexpr const bool is_enum_flag = false;
template<typename T, typename = typename std::enable_if<is_enum_flag<T>>::type>
class auto_bool
{
private:
T val_;
public:
constexpr auto_bool(T val) : val_(val) {}
constexpr operator T() const { return val_; }
constexpr explicit operator bool() const
{
return static_cast<std::underlying_type_t<T>>(val_) != 0;
}
};
template <typename T>
std::enable_if_t<is_enum_flag<T>, auto_bool<T>> operator&(T lhs, T rhs)
{
return static_cast<T>(
static_cast<typename std::underlying_type<T>::type>(lhs) &
static_cast<typename std::underlying_type<T>::type>(rhs));
}
template <typename T>
std::enable_if_t<is_enum_flag<T>, T> operator|(T lhs, T rhs)
{
return static_cast<T>(
static_cast<typename std::underlying_type<T>::type>(lhs) |
static_cast<typename std::underlying_type<T>::type>(rhs));
}
}
|
Fix bad template SFINAE declaration
|
Fix bad template SFINAE declaration
|
C
|
mit
|
Ilod/ugly,Ilod/ugly,Ilod/ugly
|
f3994034c767f5c181d09bdb08e395eb11dfe18e
|
tests/embedded/main.c
|
tests/embedded/main.c
|
/*
* Copyright © 2009 CNRS, INRIA, Université Bordeaux 1
* Copyright © 2009 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
*/
#include <hwloc.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
mytest_hwloc_topology_t topology;
unsigned depth;
hwloc_cpuset_t cpu_set;
/* Just call a bunch of functions to see if we can link and run */
cpu_set = mytest_hwloc_cpuset_alloc();
mytest_hwloc_topology_init(&topology);
mytest_hwloc_topology_load(topology);
depth = mytest_hwloc_topology_get_depth(topology);
printf("Max depth: %u\n", depth);
mytest_hwloc_topology_destroy(topology);
mytest_hwloc_cpuset_free(cpu_set);
return 0;
}
|
/*
* Copyright © 2009 CNRS, INRIA, Université Bordeaux 1
* Copyright © 2009 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
*/
#include <hwloc.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
mytest_hwloc_topology_t topology;
unsigned depth;
hwloc_cpuset_t cpu_set;
/* Just call a bunch of functions to see if we can link and run */
printf("*** Test 1: cpuset alloc\n");
cpu_set = mytest_hwloc_cpuset_alloc();
printf("*** Test 2: topology init\n");
mytest_hwloc_topology_init(&topology);
printf("*** Test 3: topology load\n");
mytest_hwloc_topology_load(topology);
printf("*** Test 4: topology get depth\n");
depth = mytest_hwloc_topology_get_depth(topology);
printf(" Max depth: %u\n", depth);
printf("*** Test 5: topology destroy\n");
mytest_hwloc_topology_destroy(topology);
printf("*** Test 6: cpuset free\n");
mytest_hwloc_cpuset_free(cpu_set);
return 0;
}
|
Add some more print statements to this test, just to help differentiate the output when debugging is enabled
|
Add some more print statements to this test, just to help
differentiate the output when debugging is enabled
git-svn-id: 14be032f8f42541b1a281b51ae8ea69814daf20e@1752 4b44e086-7f34-40ce-a3bd-00e031736276
|
C
|
bsd-3-clause
|
BlueBrain/hwloc,BlueBrain/hwloc,BlueBrain/hwloc,BlueBrain/hwloc
|
d9ace0273fba4d7da6da20f36183c2b9bf1ad305
|
libevmjit/Common.h
|
libevmjit/Common.h
|
#pragma once
#include <vector>
#include <boost/multiprecision/cpp_int.hpp>
namespace dev
{
namespace eth
{
namespace jit
{
using byte = uint8_t;
using bytes = std::vector<byte>;
using u256 = boost::multiprecision::uint256_t;
using bigint = boost::multiprecision::cpp_int;
struct NoteChannel {}; // FIXME: Use some log library?
enum class ReturnCode
{
Stop = 0,
Return = 1,
Suicide = 2,
BadJumpDestination = 101,
OutOfGas = 102,
StackTooSmall = 103,
BadInstruction = 104,
LLVMConfigError = 201,
LLVMCompileError = 202,
LLVMLinkError = 203,
};
/// Representation of 256-bit value binary compatible with LLVM i256
// TODO: Replace with h256
struct i256
{
uint64_t a;
uint64_t b;
uint64_t c;
uint64_t d;
};
static_assert(sizeof(i256) == 32, "Wrong i265 size");
#define UNTESTED assert(false)
}
}
}
|
#pragma once
#include <vector>
#include <boost/multiprecision/cpp_int.hpp>
namespace dev
{
namespace eth
{
namespace jit
{
using byte = uint8_t;
using bytes = std::vector<byte>;
using u256 = boost::multiprecision::uint256_t;
using bigint = boost::multiprecision::cpp_int;
struct NoteChannel {}; // FIXME: Use some log library?
enum class ReturnCode
{
Stop = 0,
Return = 1,
Suicide = 2,
BadJumpDestination = 101,
OutOfGas = 102,
StackTooSmall = 103,
BadInstruction = 104,
LLVMConfigError = 201,
LLVMCompileError = 202,
LLVMLinkError = 203,
};
/// Representation of 256-bit value binary compatible with LLVM i256
// TODO: Replace with h256
struct i256
{
uint64_t a = 0;
uint64_t b = 0;
uint64_t c = 0;
uint64_t d = 0;
};
static_assert(sizeof(i256) == 32, "Wrong i265 size");
#define UNTESTED assert(false)
}
}
}
|
Fix some GCC initialization warnings
|
Fix some GCC initialization warnings
|
C
|
mit
|
ethereum/evmjit,ethereum/evmjit,ethereum/evmjit
|
af65de668c8b6ab55e46e07ca5235feee23e86dc
|
src/GameState.h
|
src/GameState.h
|
/******************************************************************************
GameState.h
Game State Management
Copyright (c) 2013 Jeffrey Carpenter
Portions Copyright (c) 2013 Fielding Johnston
******************************************************************************/
#ifndef GAMEAPP_GAMESTATE_HEADERS
#define GAMEAPP_GAMESTATE_HEADERS
#include <iostream>
#include <string>
#include "SDL.h"
#include "SDLInput.h"
#include "gamelib.h"
{
public:
virtual ~GameState();
virtual void Pause() = 0;
virtual void Resume() = 0;
virtual void Input ( void ) = 0;
virtual void Update ( void ) = 0;
virtual void Draw ( void ) = 0;
private:
// ...
};
#endif // GAMEAPP_GAMESTATE_HEADERS defined
|
/******************************************************************************
GameState.h
Game State Management
Copyright (c) 2013 Jeffrey Carpenter
Portions Copyright (c) 2013 Fielding Johnston
******************************************************************************/
#ifndef GAMEAPP_GAMESTATE_HEADERS
#define GAMEAPP_GAMESTATE_HEADERS
#include <iostream>
#include <string>
#include "SDL.h"
#include "SDLInput.h"
#include "gamelib.h"
{
public:
virtual ~GameState();
virtual void Pause() = 0;
virtual void Resume() = 0;
virtual void HandleInput ( void ) = 0;
virtual void Update ( void ) = 0;
virtual void Draw ( void ) = 0;
private:
// ...
};
#endif // GAMEAPP_GAMESTATE_HEADERS defined
|
Rename of Input to HandleInput
|
Rename of Input to HandleInput
|
C
|
bsd-2-clause
|
i8degrees/nomlib,i8degrees/nomlib,i8degrees/nomlib,i8degrees/nomlib
|
6530ca82a95042e90d3cb6147472c8f9768dbfda
|
nbip4.c
|
nbip4.c
|
#define _BSD_SOURCE
#include <stdio.h>
#include <arpa/inet.h>
#include <netinet/ip.h>
#include "config.h"
#include "common.h"
void printpkt(void)
{
struct ip *iphdr = (struct ip *) pkt;
printf("ip.version=%d "
"ip.ihl=%d "
"ip.tos=%02x "
"ip.length=%d "
"ip.id=%d "
"ip.flags=%d%c%c "
"ip.offset=%d "
"ip.ttl=%d "
"ip.protocol=%d "
"ip.checksum=%04x "
"ip.src=%s ",
iphdr->ip_v,
iphdr->ip_hl,
iphdr->ip_tos,
iphdr->ip_len,
iphdr->ip_id,
iphdr->ip_off & IP_RF,
flag('d', iphdr->ip_off & IP_DF),
flag('m', iphdr->ip_off & IP_MF),
iphdr->ip_off & IP_OFFMASK,
iphdr->ip_ttl,
iphdr->ip_p,
iphdr->ip_sum,
inet_ntoa(iphdr->ip_src));
printf("ip.dst=%s ", inet_ntoa(iphdr->ip_dst));
dumppkt(iphdr->ip_hl * 4);
}
|
#define _BSD_SOURCE
#include <stdio.h>
#include <arpa/inet.h>
#include <netinet/ip.h>
#include "config.h"
#include "common.h"
void printpkt(void)
{
struct ip *iphdr = (struct ip *) pkt;
printf("ip.version=%u "
"ip.ihl=%u "
"ip.tos=%02x "
"ip.length=%u "
"ip.id=%u "
"ip.flags=%u%c%c "
"ip.offset=%u "
"ip.ttl=%u "
"ip.protocol=%u "
"ip.checksum=%04x "
"ip.src=%s ",
iphdr->ip_v,
iphdr->ip_hl,
iphdr->ip_tos,
iphdr->ip_len,
iphdr->ip_id,
iphdr->ip_off & IP_RF,
flag('d', iphdr->ip_off & IP_DF),
flag('m', iphdr->ip_off & IP_MF),
iphdr->ip_off & IP_OFFMASK,
iphdr->ip_ttl,
iphdr->ip_p,
iphdr->ip_sum,
inet_ntoa(iphdr->ip_src));
printf("ip.dst=%s ", inet_ntoa(iphdr->ip_dst));
dumppkt(iphdr->ip_hl * 4);
}
|
Change printf format %d -> %u
|
Change printf format %d -> %u
|
C
|
mit
|
grn/netbox,grn/netbox
|
8cb2fd424309fa6ff70cf00bfcedc4e66d3355c0
|
platforms/app_fuzz/fuzzer.c
|
platforms/app_fuzz/fuzzer.c
|
//
// Wasm3 - high performance WebAssembly interpreter written in C.
//
// Copyright © 2019 Steven Massey, Volodymyr Shymanskyy.
// All rights reserved.
//
#include <stdint.h>
#include <stddef.h>
#include "wasm3.h"
#define FATAL(...) __builtin_trap()
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
M3Result result = m3Err_none;
if (size < 8 || size > 256*1024) {
return 0;
}
IM3Environment env = m3_NewEnvironment ();
if (env) {
IM3Runtime runtime = m3_NewRuntime (env, 128, NULL);
if (runtime) {
IM3Module module = NULL;
result = m3_ParseModule (env, &module, data, size);
if (module) {
result = m3_LoadModule (runtime, module);
if (result == 0) {
IM3Function f = NULL;
result = m3_FindFunction (&f, runtime, "fib");
if (f) {
m3_CallV (f, 10);
}
} else {
m3_FreeModule (module);
}
}
m3_FreeRuntime(runtime);
}
m3_FreeEnvironment(env);
}
return 0;
}
|
//
// Wasm3 - high performance WebAssembly interpreter written in C.
//
// Copyright © 2019 Steven Massey, Volodymyr Shymanskyy.
// All rights reserved.
//
#include <stdint.h>
#include <stddef.h>
#include "wasm3.h"
#define FATAL(...) __builtin_trap()
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
M3Result result = m3Err_none;
if (size < 8 || size > 256*1024) {
return 0;
}
IM3Environment env = m3_NewEnvironment ();
if (env) {
IM3Runtime runtime = m3_NewRuntime (env, 128, NULL);
if (runtime) {
IM3Module module = NULL;
result = m3_ParseModule (env, &module, data, size);
if (module) {
result = m3_LoadModule (runtime, module);
if (result == 0) {
IM3Function f = NULL;
result = m3_FindFunction (&f, runtime, "fib");
/* TODO:
if (f) {
m3_CallV (f, 10);
}*/
} else {
m3_FreeModule (module);
}
}
m3_FreeRuntime(runtime);
}
m3_FreeEnvironment(env);
}
return 0;
}
|
Disable function execution for now, to focus on parsing issues
|
Disable function execution for now, to focus on parsing issues
|
C
|
mit
|
wasm3/wasm3,wasm3/wasm3,wasm3/wasm3,wasm3/wasm3,wasm3/wasm3,wasm3/wasm3,wasm3/wasm3
|
649f41482e6114d7bdd67afc311a0eea06cbdeaa
|
samples/Qt/basic/mythread.h
|
samples/Qt/basic/mythread.h
|
#ifndef MYTHREAD_H
#define MYTHREAD_H
#include <QThread>
#include "easylogging++.h"
class MyThread : public QThread {
Q_OBJECT
public:
MyThread(int id) : threadId(id) {}
private:
int threadId;
protected:
void run() {
LINFO <<"Writing from a thread " << threadId;
LVERBOSE(2) << "This is verbose level 2 logging from thread #" << threadId;
// Following line will be logged only once from second running thread (which every runs second into
// this line because of interval 2)
LWARNING_EVERY_N(2) << "This will be logged only once from thread who every reaches this line first. Currently running from thread #" << threadId;
for (int i = 1; i <= 10; ++i) {
LVERBOSE_EVERY_N(2, 3) << "Verbose level 3 log every two times. This is at " << i << " from thread #" << threadId;
}
// Following line will be logged once with every thread because of interval 1
LINFO_EVERY_N(1) << "This interval log will be logged with every thread, this one is from thread #" << threadId;
LINFO_IF(threadId == 2) << "This log is only for thread 2 and is ran by thread #" << threadId;
std::vector<std::string> myLoggers;
easyloggingpp::Loggers::getAllLogIdentifiers(myLoggers);
for (unsigned int i = 0; i < myLoggers.size(); ++i) {
std::cout << "Logger ID [" << myLoggers.at(i) << "]";
}
easyloggingpp::Configurations c;
c.parseFromText("*ALL:\n\nFORMAT = %level");
}
};
#endif
|
#ifndef MYTHREAD_H
#define MYTHREAD_H
#include <QThread>
#include "easylogging++.h"
class MyThread : public QThread {
Q_OBJECT
public:
MyThread(int id) : threadId(id) {}
private:
int threadId;
protected:
void run() {
LINFO <<"Writing from a thread " << threadId;
LVERBOSE(2) << "This is verbose level 2 logging from thread #" << threadId;
// Following line will be logged only once from second running thread (which every runs second into
// this line because of interval 2)
LWARNING_EVERY_N(2) << "This will be logged only once from thread who every reaches this line first. Currently running from thread #" << threadId;
for (int i = 1; i <= 10; ++i) {
LVERBOSE_EVERY_N(2, 3) << "Verbose level 3 log every two times. This is at " << i << " from thread #" << threadId;
}
// Following line will be logged once with every thread because of interval 1
LINFO_EVERY_N(1) << "This interval log will be logged with every thread, this one is from thread #" << threadId;
LINFO_IF(threadId == 2) << "This log is only for thread 2 and is ran by thread #" << threadId;
}
};
#endif
|
Remove logger ids loop from sample
|
Remove logger ids loop from sample
|
C
|
mit
|
orchid-hybrid/easyloggingpp,orchid-hybrid/easyloggingpp,orchid-hybrid/easyloggingpp
|
b6c2b3c712ab2b879b727fdb02dba169695de698
|
src/host/os_isfile.c
|
src/host/os_isfile.c
|
/**
* \file os_isfile.c
* \brief Returns true if the given file exists on the file system.
* \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
*/
#include <sys/stat.h>
#include "premake.h"
int os_isfile(lua_State* L)
{
const char* filename = luaL_checkstring(L, 1);
lua_pushboolean(L, do_isfile(filename));
return 1;
}
int do_isfile(const char* filename)
{
struct stat buf;
if (stat(filename, &buf) == 0)
{
return ((buf.st_mode & S_IFDIR) == 0);
}
else
{
return 0;
}
}
|
/**
* \file os_isfile.c
* \brief Returns true if the given file exists on the file system.
* \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
*/
#include <sys/stat.h>
#include "premake.h"
int os_isfile(lua_State* L)
{
const char* filename = luaL_checkstring(L, 1);
lua_pushboolean(L, do_isfile(filename));
return 1;
}
int do_isfile(const char* filename)
{
struct stat buf;
#if PLATFORM_WINDOWS
DWORD attrib = GetFileAttributesA(filename);
if (attrib != INVALID_FILE_ATTRIBUTES)
{
return (attrib & FILE_ATTRIBUTE_DIRECTORY) == 0;
}
#else
if (stat(filename, &buf) == 0)
{
return ((buf.st_mode & S_IFDIR) == 0);
}
#endif
return 0;
}
|
Fix do_isfile to support symbolic links on Windows.
|
Fix do_isfile to support symbolic links on Windows.
|
C
|
bsd-3-clause
|
mendsley/premake-core,noresources/premake-core,CodeAnxiety/premake-core,bravnsgaard/premake-core,starkos/premake-core,bravnsgaard/premake-core,mendsley/premake-core,TurkeyMan/premake-core,premake/premake-core,noresources/premake-core,resetnow/premake-core,noresources/premake-core,noresources/premake-core,starkos/premake-core,Blizzard/premake-core,Blizzard/premake-core,LORgames/premake-core,mandersan/premake-core,mandersan/premake-core,tvandijck/premake-core,dcourtois/premake-core,dcourtois/premake-core,soundsrc/premake-core,aleksijuvani/premake-core,Blizzard/premake-core,sleepingwit/premake-core,mandersan/premake-core,LORgames/premake-core,lizh06/premake-core,LORgames/premake-core,sleepingwit/premake-core,soundsrc/premake-core,premake/premake-core,martin-traverse/premake-core,LORgames/premake-core,jstewart-amd/premake-core,aleksijuvani/premake-core,martin-traverse/premake-core,Blizzard/premake-core,starkos/premake-core,sleepingwit/premake-core,xriss/premake-core,mendsley/premake-core,mendsley/premake-core,martin-traverse/premake-core,starkos/premake-core,starkos/premake-core,starkos/premake-core,Zefiros-Software/premake-core,resetnow/premake-core,xriss/premake-core,jstewart-amd/premake-core,tvandijck/premake-core,jstewart-amd/premake-core,noresources/premake-core,noresources/premake-core,martin-traverse/premake-core,premake/premake-core,xriss/premake-core,jstewart-amd/premake-core,resetnow/premake-core,premake/premake-core,dcourtois/premake-core,lizh06/premake-core,bravnsgaard/premake-core,dcourtois/premake-core,sleepingwit/premake-core,soundsrc/premake-core,tvandijck/premake-core,aleksijuvani/premake-core,aleksijuvani/premake-core,mandersan/premake-core,Zefiros-Software/premake-core,Zefiros-Software/premake-core,noresources/premake-core,dcourtois/premake-core,resetnow/premake-core,bravnsgaard/premake-core,premake/premake-core,lizh06/premake-core,tvandijck/premake-core,jstewart-amd/premake-core,mendsley/premake-core,Zefiros-Software/premake-core,CodeAnxiety/premake-core,tvandijck/premake-core,TurkeyMan/premake-core,sleepingwit/premake-core,CodeAnxiety/premake-core,soundsrc/premake-core,TurkeyMan/premake-core,CodeAnxiety/premake-core,Blizzard/premake-core,dcourtois/premake-core,bravnsgaard/premake-core,starkos/premake-core,CodeAnxiety/premake-core,Zefiros-Software/premake-core,TurkeyMan/premake-core,LORgames/premake-core,lizh06/premake-core,resetnow/premake-core,dcourtois/premake-core,premake/premake-core,aleksijuvani/premake-core,mandersan/premake-core,Blizzard/premake-core,premake/premake-core,TurkeyMan/premake-core,xriss/premake-core,xriss/premake-core,soundsrc/premake-core
|
b7ce10aacc06b17d1e47c6da0d00a570e8517566
|
kmail/kmversion.h
|
kmail/kmversion.h
|
// KMail Version Information
//
#ifndef kmversion_h
#define kmversion_h
#define KMAIL_VERSION "1.8.91"
#endif /*kmversion_h*/
|
// KMail Version Information
//
#ifndef kmversion_h
#define kmversion_h
#define KMAIL_VERSION "1.9.50"
#endif /*kmversion_h*/
|
Use a fresh version number for the trunk version
|
Use a fresh version number for the trunk version
svn path=/trunk/KDE/kdepim/; revision=466318
|
C
|
lgpl-2.1
|
lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi
|
f7ee1dbbeb58a7d59fde269e7f11ffbf2e3e9e4a
|
src/lib/annis/join/nestedloop.h
|
src/lib/annis/join/nestedloop.h
|
#pragma once
#include <annis/types.h>
#include <annis/graphstorage/graphstorage.h>
#include <annis/db.h>
#include <annis/iterators.h>
namespace annis
{
class Operator;
/**
* A join that checks all combinations of the left and right matches if their are connected.
*
* @param lhsIdx the column of the LHS tuple to join on
* @param rhsIdx the column of the RHS tuple to join on
*/
class NestedLoopJoin : public Iterator
{
public:
NestedLoopJoin(std::shared_ptr<Operator> op,
std::shared_ptr<Iterator> lhs, std::shared_ptr<Iterator> rhs,
size_t lhsIdx, size_t rhsIdx,
bool materializeInner=true,
bool leftIsOuter=true);
virtual ~NestedLoopJoin();
virtual bool next(std::vector<Match>& tuple) override;
virtual void reset() override;
private:
std::shared_ptr<Operator> op;
const bool materializeInner;
const bool leftIsOuter;
bool initialized;
std::vector<Match> matchOuter;
std::vector<Match> matchInner;
std::shared_ptr<Iterator> outer;
std::shared_ptr<Iterator> inner;
const size_t outerIdx;
const size_t innerIdx;
bool firstOuterFinished;
std::list<std::vector<Match>> innerCache;
std::list<std::vector<Match>>::const_iterator itInnerCache;
private:
bool fetchNextInner();
};
} // end namespace annis
|
#pragma once
#include <annis/types.h>
#include <annis/graphstorage/graphstorage.h>
#include <annis/db.h>
#include <annis/iterators.h>
#include <deque>
namespace annis
{
class Operator;
/**
* A join that checks all combinations of the left and right matches if their are connected.
*
* @param lhsIdx the column of the LHS tuple to join on
* @param rhsIdx the column of the RHS tuple to join on
*/
class NestedLoopJoin : public Iterator
{
public:
NestedLoopJoin(std::shared_ptr<Operator> op,
std::shared_ptr<Iterator> lhs, std::shared_ptr<Iterator> rhs,
size_t lhsIdx, size_t rhsIdx,
bool materializeInner=true,
bool leftIsOuter=true);
virtual ~NestedLoopJoin();
virtual bool next(std::vector<Match>& tuple) override;
virtual void reset() override;
private:
std::shared_ptr<Operator> op;
const bool materializeInner;
const bool leftIsOuter;
bool initialized;
std::vector<Match> matchOuter;
std::vector<Match> matchInner;
std::shared_ptr<Iterator> outer;
std::shared_ptr<Iterator> inner;
const size_t outerIdx;
const size_t innerIdx;
bool firstOuterFinished;
std::deque<std::vector<Match>> innerCache;
std::deque<std::vector<Match>>::const_iterator itInnerCache;
private:
bool fetchNextInner();
};
} // end namespace annis
|
Use a deque instead of a list as inner cache in nested loop.
|
Use a deque instead of a list as inner cache in nested loop.
|
C
|
apache-2.0
|
thomaskrause/graphANNIS,thomaskrause/graphANNIS,thomaskrause/graphANNIS,thomaskrause/graphANNIS,thomaskrause/graphANNIS,thomaskrause/graphANNIS,thomaskrause/graphANNIS
|
72ff7ba9c9ed6436625c27b2616d1efb0f782a0a
|
Pathfinder-Core/include/pathfinder.h
|
Pathfinder-Core/include/pathfinder.h
|
#ifndef PATHFINDER_H_DEF
#define PATHFINDER_H_DEF
#include "pathfinder/mathutil.h"
#include "pathfinder/structs.h"
#include "pathfinder/fit.h"
#include "pathfinder/spline.h"
#include "pathfinder/trajectory.h"
#include "pathfinder/modifiers/tank.h"
#include "pathfinder/modifiers/swerve.h"
#include "pathfinder/followers/encoder.h"
#include "pathfinder/followers/distance.h"
#include "pathfinder/io.h"
#endif
|
#ifndef PATHFINDER_H_DEF
#define PATHFINDER_H_DEF
#ifdef __cplusplus
extern "C" {
#endif
#include "pathfinder/mathutil.h"
#include "pathfinder/structs.h"
#include "pathfinder/fit.h"
#include "pathfinder/spline.h"
#include "pathfinder/trajectory.h"
#include "pathfinder/modifiers/tank.h"
#include "pathfinder/modifiers/swerve.h"
#include "pathfinder/followers/encoder.h"
#include "pathfinder/followers/distance.h"
#include "pathfinder/io.h"
#ifdef __cplusplus
}
#endif
#endif
|
Use extern C if C++
|
Use extern C if C++
|
C
|
mit
|
JacisNonsense/Pathfinder,JacisNonsense/Pathfinder,JacisNonsense/Pathfinder
|
c5bac4e6a4c55baedd93abb0b9e0ad0dcc93a2f3
|
macos/compat/sys/types.h
|
macos/compat/sys/types.h
|
#ifndef __SYS_TYPES_H__
#define __SYS_TYPES_H__ 1
#include <MacTypes.h>
#include <alloca.h>
#include <string.h>
typedef short int16_t;
typedef long int32_t;
typedef long long int64_t;
#define vorbis_size32_t long
#if defined(__cplusplus)
extern "C" {
#endif
#pragma options align=power
char *strdup(const char *inStr);
#pragma options align=reset
#if defined(__cplusplus)
}
#endif
#endif /* __SYS_TYPES_H__ */
|
#ifndef __SYS_TYPES_H__
#define __SYS_TYPES_H__ 1
#include <MacTypes.h>
#include <alloca.h>
#include <string.h>
typedef short int16_t;
// typedef long int32_t;
typedef long long int64_t;
#define vorbis_size32_t long
#if defined(__cplusplus)
extern "C" {
#endif
#pragma options align=power
char *strdup(const char *inStr);
#pragma options align=reset
#if defined(__cplusplus)
}
#endif
#endif /* __SYS_TYPES_H__ */
|
Fix osx build (this is going to be removed soon anyways)
|
Fix osx build (this is going to be removed soon anyways)
|
C
|
bsd-3-clause
|
jhotovy/libvorbis,jhotovy/libvorbis,jhotovy/libvorbis,jhotovy/libvorbis,jhotovy/libvorbis
|
6944671e2648a0bf4b380865227c3486b0c83612
|
pzlib.h
|
pzlib.h
|
#ifndef PZLIB_H
#define PZLIB_H
typedef unsigned int psize_type;
typedef int pssize_type;
typedef pssize_type writerfunc(void *cookie, const void *buf, psize_type len);
typedef void closefunc(void*);
struct pz {
writerfunc *wf;
closefunc *cf;
};
inline pssize_type do_write(void *cookie, const void *buf, psize_type len) {
struct pz* p = (struct pz*)cookie;
return (p->wf)(cookie, buf, len);
}
inline void do_close(void *cookie) {
struct pz* p = (struct pz*)cookie;
(p->cf)(cookie);
}
#ifdef __cplusplus
extern "C" {
#endif
void *make_fd(int fd);
extern writerfunc write_fd;
extern closefunc free_fd;
#ifdef __cplusplus
}
#endif
#endif
|
#ifndef PZLIB_H
#define PZLIB_H
typedef unsigned int psize_type;
typedef int pssize_type;
typedef pssize_type writerfunc(void *cookie, const void *buf, psize_type len);
typedef void closefunc(void*);
struct pz {
writerfunc *wf;
closefunc *cf;
};
static inline pssize_type do_write(void *cookie, const void *buf, psize_type len) {
struct pz* p = (struct pz*)cookie;
return (p->wf)(cookie, buf, len);
}
static inline void do_close(void *cookie) {
struct pz* p = (struct pz*)cookie;
(p->cf)(cookie);
}
#ifdef __cplusplus
extern "C" {
#endif
void *make_fd(int fd);
extern writerfunc write_fd;
extern closefunc free_fd;
#ifdef __cplusplus
}
#endif
#endif
|
Replace inline with static inline to enable DEBUG build (linking actually)
|
Replace inline with static inline to enable DEBUG build (linking actually)
It's all about bloody C89 vs C99 semantic...
|
C
|
mit
|
yandex/sdch_module,yandex/sdch_module,yandex/sdch_module,yandex/sdch_module
|
65fe3d63f25760fa643c39d665bad6ead63a3e08
|
queue.c
|
queue.c
|
#include "queue.h"
struct Queue
{
size_t head;
size_t tail;
size_t size;
void** e;
};
Queue* Queue_Create(size_t n)
{
Queue* q = (Queue *)malloc(sizeof(Queue));
q->size = n;
q->head = q->tail = 1;
q->e = (void **)malloc(sizeof(void*) * (n + 1));
return q;
}
|
#include "queue.h"
struct Queue
{
size_t head;
size_t tail;
size_t size;
void** e;
};
Queue* Queue_Create(size_t n)
{
Queue* q = (Queue *)malloc(sizeof(Queue));
q->size = n;
q->head = q->tail = 1;
q->e = (void **)malloc(sizeof(void*) * (n + 1));
return q;
}
int Queue_Empty(Queue* q)
{
return (q->head == q->tail);
}
|
Add helper function Queue empty implementation
|
Add helper function Queue empty implementation
|
C
|
mit
|
MaxLikelihood/CADT
|
ddd0a6ac92572a6e6016f5fbc9fda7eaedc7b114
|
numpy/core/src/multiarray/buffer.h
|
numpy/core/src/multiarray/buffer.h
|
#ifndef _NPY_PRIVATE_BUFFER_H_
#define _NPY_PRIVATE_BUFFER_H_
#ifdef NPY_ENABLE_MULTIPLE_COMPILATION
extern NPY_NO_EXPORT PyBufferProcs array_as_buffer;
#else
NPY_NO_EXPORT PyBufferProcs array_as_buffer;
#endif
#endif
|
#ifndef _NPY_PRIVATE_BUFFER_H_
#define _NPY_PRIVATE_BUFFER_H_
#ifdef NPY_ENABLE_SEPARATE_COMPILATION
extern NPY_NO_EXPORT PyBufferProcs array_as_buffer;
#else
NPY_NO_EXPORT PyBufferProcs array_as_buffer;
#endif
#endif
|
Fix mispelled separate compilation macro.
|
Fix mispelled separate compilation macro.
|
C
|
bsd-3-clause
|
numpy/numpy-refactor,ESSS/numpy,mhvk/numpy,ddasilva/numpy,gmcastil/numpy,sonnyhu/numpy,dwf/numpy,Srisai85/numpy,cjermain/numpy,mindw/numpy,GrimDerp/numpy,matthew-brett/numpy,anntzer/numpy,jorisvandenbossche/numpy,felipebetancur/numpy,mingwpy/numpy,SiccarPoint/numpy,rherault-insa/numpy,pbrod/numpy,pelson/numpy,has2k1/numpy,solarjoe/numpy,CMartelLML/numpy,drasmuss/numpy,pelson/numpy,utke1/numpy,MaPePeR/numpy,rgommers/numpy,ChristopherHogan/numpy,anntzer/numpy,behzadnouri/numpy,pdebuyl/numpy,dch312/numpy,rgommers/numpy,Srisai85/numpy,abalkin/numpy,ChanderG/numpy,rmcgibbo/numpy,skwbc/numpy,jankoslavic/numpy,GaZ3ll3/numpy,WarrenWeckesser/numpy,Linkid/numpy,cowlicks/numpy,sinhrks/numpy,mattip/numpy,Yusa95/numpy,mattip/numpy,sonnyhu/numpy,rherault-insa/numpy,solarjoe/numpy,rhythmsosad/numpy,sigma-random/numpy,cowlicks/numpy,njase/numpy,ahaldane/numpy,cjermain/numpy,andsor/numpy,hainm/numpy,charris/numpy,Srisai85/numpy,ssanderson/numpy,stefanv/numpy,rajathkumarmp/numpy,ajdawson/numpy,nguyentu1602/numpy,mwiebe/numpy,charris/numpy,tynn/numpy,BabeNovelty/numpy,trankmichael/numpy,yiakwy/numpy,dch312/numpy,dwillmer/numpy,mattip/numpy,jakirkham/numpy,pizzathief/numpy,seberg/numpy,rajathkumarmp/numpy,MSeifert04/numpy,Anwesh43/numpy,bmorris3/numpy,BabeNovelty/numpy,kiwifb/numpy,rmcgibbo/numpy,githubmlai/numpy,seberg/numpy,seberg/numpy,brandon-rhodes/numpy,KaelChen/numpy,mathdd/numpy,argriffing/numpy,immerrr/numpy,njase/numpy,andsor/numpy,simongibbons/numpy,jorisvandenbossche/numpy,Anwesh43/numpy,WillieMaddox/numpy,endolith/numpy,naritta/numpy,ewmoore/numpy,trankmichael/numpy,bertrand-l/numpy,ddasilva/numpy,dato-code/numpy,MichaelAquilina/numpy,NextThought/pypy-numpy,mathdd/numpy,grlee77/numpy,MSeifert04/numpy,pyparallel/numpy,ogrisel/numpy,brandon-rhodes/numpy,nbeaver/numpy,musically-ut/numpy,astrofrog/numpy,skymanaditya1/numpy,SiccarPoint/numpy,numpy/numpy,bertrand-l/numpy,jorisvandenbossche/numpy,numpy/numpy-refactor,simongibbons/numpy,ChristopherHogan/numpy,skwbc/numpy,felipebetancur/numpy,jakirkham/numpy,ContinuumIO/numpy,charris/numpy,leifdenby/numpy,njase/numpy,stuarteberg/numpy,drasmuss/numpy,BMJHayward/numpy,nguyentu1602/numpy,rudimeier/numpy,githubmlai/numpy,ewmoore/numpy,ewmoore/numpy,mhvk/numpy,embray/numpy,dimasad/numpy,simongibbons/numpy,BabeNovelty/numpy,stuarteberg/numpy,Eric89GXL/numpy,pizzathief/numpy,rmcgibbo/numpy,musically-ut/numpy,jakirkham/numpy,jonathanunderwood/numpy,utke1/numpy,bertrand-l/numpy,sigma-random/numpy,cowlicks/numpy,abalkin/numpy,rgommers/numpy,Yusa95/numpy,Eric89GXL/numpy,stefanv/numpy,nbeaver/numpy,ajdawson/numpy,brandon-rhodes/numpy,KaelChen/numpy,groutr/numpy,mortada/numpy,githubmlai/numpy,tynn/numpy,yiakwy/numpy,pizzathief/numpy,endolith/numpy,nbeaver/numpy,Eric89GXL/numpy,jorisvandenbossche/numpy,larsmans/numpy,embray/numpy,pizzathief/numpy,GrimDerp/numpy,anntzer/numpy,BabeNovelty/numpy,pbrod/numpy,SunghanKim/numpy,tdsmith/numpy,sigma-random/numpy,mindw/numpy,rudimeier/numpy,larsmans/numpy,rudimeier/numpy,sinhrks/numpy,CMartelLML/numpy,astrofrog/numpy,astrofrog/numpy,pbrod/numpy,pelson/numpy,b-carter/numpy,WarrenWeckesser/numpy,tacaswell/numpy,has2k1/numpy,stefanv/numpy,ekalosak/numpy,naritta/numpy,rherault-insa/numpy,empeeu/numpy,stuarteberg/numpy,chiffa/numpy,groutr/numpy,cjermain/numpy,jakirkham/numpy,WillieMaddox/numpy,immerrr/numpy,tdsmith/numpy,WarrenWeckesser/numpy,Dapid/numpy,mwiebe/numpy,ChanderG/numpy,shoyer/numpy,stefanv/numpy,WarrenWeckesser/numpy,numpy/numpy-refactor,mhvk/numpy,CMartelLML/numpy,jankoslavic/numpy,mindw/numpy,grlee77/numpy,skymanaditya1/numpy,stefanv/numpy,Srisai85/numpy,Anwesh43/numpy,MaPePeR/numpy,sinhrks/numpy,mwiebe/numpy,ewmoore/numpy,MaPePeR/numpy,skymanaditya1/numpy,gfyoung/numpy,empeeu/numpy,KaelChen/numpy,grlee77/numpy,trankmichael/numpy,musically-ut/numpy,tynn/numpy,jonathanunderwood/numpy,BMJHayward/numpy,mortada/numpy,shoyer/numpy,Linkid/numpy,ssanderson/numpy,Eric89GXL/numpy,has2k1/numpy,charris/numpy,numpy/numpy-refactor,Anwesh43/numpy,naritta/numpy,joferkington/numpy,githubmlai/numpy,ajdawson/numpy,pdebuyl/numpy,dimasad/numpy,SunghanKim/numpy,matthew-brett/numpy,AustereCuriosity/numpy,dimasad/numpy,cowlicks/numpy,ajdawson/numpy,bringingheavendown/numpy,ssanderson/numpy,empeeu/numpy,mathdd/numpy,ddasilva/numpy,madphysicist/numpy,hainm/numpy,brandon-rhodes/numpy,madphysicist/numpy,sonnyhu/numpy,astrofrog/numpy,mhvk/numpy,WillieMaddox/numpy,dwf/numpy,MichaelAquilina/numpy,ViralLeadership/numpy,rudimeier/numpy,rajathkumarmp/numpy,grlee77/numpy,shoyer/numpy,gmcastil/numpy,maniteja123/numpy,SiccarPoint/numpy,rmcgibbo/numpy,hainm/numpy,seberg/numpy,b-carter/numpy,Linkid/numpy,larsmans/numpy,ahaldane/numpy,rhythmsosad/numpy,dwillmer/numpy,AustereCuriosity/numpy,pelson/numpy,numpy/numpy,madphysicist/numpy,ekalosak/numpy,CMartelLML/numpy,argriffing/numpy,ChanderG/numpy,ahaldane/numpy,chiffa/numpy,rhythmsosad/numpy,musically-ut/numpy,rajathkumarmp/numpy,moreati/numpy,empeeu/numpy,jschueller/numpy,BMJHayward/numpy,GaZ3ll3/numpy,chatcannon/numpy,tacaswell/numpy,mattip/numpy,anntzer/numpy,kirillzhuravlev/numpy,ChanderG/numpy,ogrisel/numpy,ChristopherHogan/numpy,Dapid/numpy,GaZ3ll3/numpy,hainm/numpy,endolith/numpy,mindw/numpy,felipebetancur/numpy,nguyentu1602/numpy,MichaelAquilina/numpy,jschueller/numpy,Dapid/numpy,ogrisel/numpy,SiccarPoint/numpy,Linkid/numpy,dch312/numpy,madphysicist/numpy,madphysicist/numpy,mortada/numpy,ogrisel/numpy,WarrenWeckesser/numpy,kirillzhuravlev/numpy,ogrisel/numpy,chiffa/numpy,matthew-brett/numpy,MichaelAquilina/numpy,groutr/numpy,sonnyhu/numpy,mhvk/numpy,numpy/numpy,chatcannon/numpy,ekalosak/numpy,MaPePeR/numpy,ahaldane/numpy,naritta/numpy,andsor/numpy,skymanaditya1/numpy,drasmuss/numpy,mathdd/numpy,dwillmer/numpy,dato-code/numpy,bringingheavendown/numpy,felipebetancur/numpy,yiakwy/numpy,joferkington/numpy,dimasad/numpy,abalkin/numpy,KaelChen/numpy,jonathanunderwood/numpy,numpy/numpy,pyparallel/numpy,numpy/numpy-refactor,ContinuumIO/numpy,pbrod/numpy,ahaldane/numpy,rgommers/numpy,joferkington/numpy,joferkington/numpy,jschueller/numpy,matthew-brett/numpy,skwbc/numpy,Yusa95/numpy,dwf/numpy,MSeifert04/numpy,bmorris3/numpy,nguyentu1602/numpy,NextThought/pypy-numpy,MSeifert04/numpy,SunghanKim/numpy,maniteja123/numpy,simongibbons/numpy,mingwpy/numpy,dch312/numpy,maniteja123/numpy,leifdenby/numpy,ChristopherHogan/numpy,bmorris3/numpy,tdsmith/numpy,yiakwy/numpy,pelson/numpy,Yusa95/numpy,ContinuumIO/numpy,tacaswell/numpy,argriffing/numpy,grlee77/numpy,kiwifb/numpy,shoyer/numpy,behzadnouri/numpy,gfyoung/numpy,jankoslavic/numpy,NextThought/pypy-numpy,ViralLeadership/numpy,kirillzhuravlev/numpy,andsor/numpy,mingwpy/numpy,jankoslavic/numpy,mortada/numpy,BMJHayward/numpy,jorisvandenbossche/numpy,embray/numpy,tdsmith/numpy,behzadnouri/numpy,stuarteberg/numpy,kirillzhuravlev/numpy,solarjoe/numpy,embray/numpy,immerrr/numpy,GrimDerp/numpy,dwillmer/numpy,ESSS/numpy,larsmans/numpy,dato-code/numpy,leifdenby/numpy,simongibbons/numpy,ViralLeadership/numpy,SunghanKim/numpy,GrimDerp/numpy,moreati/numpy,bmorris3/numpy,NextThought/pypy-numpy,mingwpy/numpy,cjermain/numpy,jakirkham/numpy,sigma-random/numpy,ESSS/numpy,utke1/numpy,bringingheavendown/numpy,dwf/numpy,embray/numpy,GaZ3ll3/numpy,dwf/numpy,gfyoung/numpy,dato-code/numpy,pizzathief/numpy,ekalosak/numpy,jschueller/numpy,shoyer/numpy,pbrod/numpy,pyparallel/numpy,sinhrks/numpy,MSeifert04/numpy,rhythmsosad/numpy,pdebuyl/numpy,AustereCuriosity/numpy,kiwifb/numpy,endolith/numpy,astrofrog/numpy,moreati/numpy,pdebuyl/numpy,b-carter/numpy,matthew-brett/numpy,chatcannon/numpy,trankmichael/numpy,gmcastil/numpy,has2k1/numpy,immerrr/numpy,ewmoore/numpy
|
7a332a1a17f9026e27b7df22bb44d6532f4232b6
|
modlib.c
|
modlib.c
|
#include "modlib.h"
uint16_t MODBUSSwapEndian( uint16_t Data )
{
//Change big-endian to little-endian and vice versa
uint8_t Swap;
//Create 2 bytes long union
union Conversion
{
uint16_t Data;
uint8_t Bytes[2];
} Conversion;
//Swap bytes
Conversion.Data = Data;
Swap = Conversion.Bytes[0];
Conversion.Bytes[0] = Conversion.Bytes[1];
Conversion.Bytes[1] = Swap;
return Conversion.Data;
}
uint16_t MODBUSCRC16( uint8_t *Data, uint16_t Length )
{
//Calculate CRC16 checksum using given data and length
uint16_t CRC = 0xFFFF;
uint16_t i;
uint8_t j;
for ( i = 0; i < Length; i++ )
{
CRC ^= Data[i]; //XOR current data byte with CRC value
for ( j = 8; j != 0; j-- )
{
//For each bit
//Is least-significant-bit is set?
if ( ( CRC & 0x0001 ) != 0 )
{
CRC >>= 1; //Shift to right and xor
CRC ^= 0xA001;
}
else
CRC >>= 1;
}
}
return CRC;
}
|
#include "modlib.h"
uint16_t MODBUSSwapEndian( uint16_t Data )
{
//Change big-endian to little-endian and vice versa
uint8_t Swap;
//Create 2 bytes long union
union Conversion
{
uint16_t Data;
uint8_t Bytes[2];
} Conversion;
//Swap bytes
Conversion.Data = Data;
Swap = Conversion.Bytes[0];
Conversion.Bytes[0] = Conversion.Bytes[1];
Conversion.Bytes[1] = Swap;
return Conversion.Data;
}
uint16_t MODBUSCRC16( uint8_t *Data, uint16_t Length )
{
//Calculate CRC16 checksum using given data and length
uint16_t CRC = 0xFFFF;
uint16_t i;
uint8_t j;
for ( i = 0; i < Length; i++ )
{
CRC ^= (uint16_t) Data[i]; //XOR current data byte with CRC value
for ( j = 8; j != 0; j-- )
{
//For each bit
//Is least-significant-bit is set?
if ( ( CRC & 0x0001 ) != 0 )
{
CRC >>= 1; //Shift to right and xor
CRC ^= 0xA001;
}
else
CRC >>= 1;
}
}
return CRC;
}
|
Add cast to uint16_t in CRC function
|
Add cast to uint16_t in CRC function
|
C
|
mit
|
Jacajack/modlib
|
2240257c7f7cb075b43e844bae0749bd59005c80
|
src/GNSMenuDelegate.h
|
src/GNSMenuDelegate.h
|
#import <Cocoa/Cocoa.h>
#include <gtk/gtk.h>
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6)
@interface _GNSMenuDelegate : NSObject <NSMenuDelegate> {}
#else
@interface _GNSMenuDelegate : NSObject {}
#endif
@end
|
#import <Cocoa/Cocoa.h>
#include <gtk/gtk.h>
#if (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5)
@interface _GNSMenuDelegate : NSObject <NSMenuDelegate> {}
#else
@interface _GNSMenuDelegate : NSObject {}
#endif
@end
|
Fix minimum version to one that exists in 10.5
|
Fix minimum version to one that exists in 10.5
|
C
|
lgpl-2.1
|
sharoonthomas/gtk-mac-integration,GNOME/gtk-mac-integration,jralls/gtk-mac-integration,GNOME/gtk-mac-integration,jralls/gtk-mac-integration,sharoonthomas/gtk-mac-integration,GNOME/gtk-mac-integration,jralls/gtk-mac-integration,sharoonthomas/gtk-mac-integration,sharoonthomas/gtk-mac-integration,sharoonthomas/gtk-mac-integration
|
b94bcd4c0aa74f4f963aec368f8417add005fafe
|
lilthumb.h
|
lilthumb.h
|
#ifndef lilthumb
#define lilthumb
#include <ctime>
namespace lilthumb{
std::string timeString()
{
time_t rawtime;
struct tm * timeinfo;
char buffer[80];
time (&rawtime);
timeinfo = localtime(&rawtime);
strftime(buffer,80,"%d-%m-%Y %I:%M:%S",timeinfo);
std::string str(buffer);
return str;
}
}
#define logger(stream,message) stream << lilthumb::timeString() << " | "<< message << std::endl;
#endif
|
#ifndef lilthumb
#define lilthumb
#include <ctime>
#include <ostream>
namespace lilthumb{
std::string timeString()
{
time_t rawtime;
struct tm * timeinfo;
char buffer[80];
time (&rawtime);
timeinfo = localtime(&rawtime);
strftime(buffer,80,"%d-%m-%Y %I:%M:%S",timeinfo);
std::string str(buffer);
return str;
}
void stone( std::ostream& stream, std::string message )
{
stream << timeString() << " | " << message << std::endl;
}
}
#endif
|
Change logger define to namespace stone function
|
Change logger define to namespace stone function
|
C
|
apache-2.0
|
jeromevelut/lilthumb
|
3ea520fdbc396ba8d1b859b669d8c16ee34820ad
|
util/parser/conf.h
|
util/parser/conf.h
|
#ifndef __LWP_CONFIG_H
#define __LWP_CONFIG_H
#include <stdint.h>
#include <stdbool.h>
typedef enum{
CFLAG_NWKSKEY = (1<<0),
CFLAG_APPSKEY = (1<<1),
CFLAG_APPKEY = (1<<2),
CFLAG_JOINR = (1<<3),
CFLAG_JOINA = (1<<4),
}config_flag_t;
typedef struct message{
uint8_t *buf;
int16_t len;
struct message *next;
}message_t;
typedef struct{
uint32_t flag;
uint8_t nwkskey[16];
uint8_t appskey[16];
uint8_t appkey[16];
uint8_t band;
bool joinkey;
uint8_t *joinr;
uint8_t joinr_size;
uint8_t *joina;
uint8_t joina_size;
message_t *message;
message_t *maccmd;
}config_t;
int config_parse(const char *file, config_t *config);
void config_free(config_t *config);
#endif // __CONFIG_H
|
#ifndef __LWP_CONFIG_H
#define __LWP_CONFIG_H
#include <stdint.h>
#include <stdbool.h>
typedef enum{
CFLAG_NWKSKEY = (1<<0),
CFLAG_APPSKEY = (1<<1),
CFLAG_APPKEY = (1<<2),
CFLAG_JOINR = (1<<3),
CFLAG_JOINA = (1<<4),
}config_flag_t;
typedef struct message{
uint8_t *buf;
int16_t len;
struct message *next;
}message_t;
typedef struct motes_abp{
uint8_t band;
uint8_t devaddr[4];
uint8_t nwkskey[16];
uint8_t appskey[16];
struct message *next;
}motes_abp_t;
typedef struct motes_abp{
uint8_t band;
uint8_t devaddr[4];
uint8_t nwkskey[16];
uint8_t appskey[16];
struct message *next;
}motes_abp_t;
typedef struct{
uint32_t flag;
uint8_t nwkskey[16];
uint8_t appskey[16];
uint8_t appkey[16];
uint8_t band;
bool joinkey;
uint8_t *joinr;
uint8_t joinr_size;
uint8_t *joina;
uint8_t joina_size;
message_t *message;
message_t *maccmd;
}config_t;
int config_parse(const char *file, config_t *config);
void config_free(config_t *config);
#endif // __CONFIG_H
|
Add motes_abp and motes_otaa link list structure definition.
|
Add motes_abp and motes_otaa link list structure definition.
|
C
|
mit
|
JiapengLi/lorawan-parser,JiapengLi/lorawan-parser
|
053300cfd6d2800cd3f744b1ffe4deca6c04082c
|
interpreter/cling/include/cling/Interpreter/RuntimeExceptions.h
|
interpreter/cling/include/cling/Interpreter/RuntimeExceptions.h
|
//--------------------------------------------------------------------*- C++ -*-
// CLING - the C++ LLVM-based InterpreterG :)
// version: $Id$
// author: Vassil Vassilev <vasil.georgiev.vasilev@cern.ch>
//------------------------------------------------------------------------------
#ifndef CLING_RUNTIME_EXCEPTIONS_H
#define CLING_RUNTIME_EXCEPTIONS_H
namespace cling {
namespace runtime {
///\brief Exception that is thrown when a null pointer dereference is found
/// or a method taking non-null arguments is called with NULL argument.
///
class cling_null_deref_exception { };
} // end namespace runtime
} // end namespace cling
#endif // CLING_RUNTIME_EXCEPTIONS_H
|
//--------------------------------------------------------------------*- C++ -*-
// CLING - the C++ LLVM-based InterpreterG :)
// version: $Id$
// author: Vassil Vassilev <vasil.georgiev.vasilev@cern.ch>
//------------------------------------------------------------------------------
#ifndef CLING_RUNTIME_EXCEPTIONS_H
#define CLING_RUNTIME_EXCEPTIONS_H
namespace clang {
class Sema;
}
namespace cling {
namespace runtime {
///\brief Exception that is thrown when a null pointer dereference is found
/// or a method taking non-null arguments is called with NULL argument.
///
class cling_null_deref_exception {
private:
unsigned m_Location;
clang::Sema* m_Sema;
public:
cling_null_deref_exception(void* Loc, clang::Sema* S);
~cling_null_deref_exception();
void what() throw();
};
} // end namespace runtime
} // end namespace cling
#endif // CLING_RUNTIME_EXCEPTIONS_H
|
Add missing header method declarations.
|
Add missing header method declarations.
|
C
|
lgpl-2.1
|
sirinath/root,esakellari/root,gganis/root,omazapa/root-old,cxx-hep/root-cern,CristinaCristescu/root,nilqed/root,CristinaCristescu/root,root-mirror/root,sbinet/cxx-root,gganis/root,sawenzel/root,mattkretz/root,thomaskeck/root,buuck/root,abhinavmoudgil95/root,veprbl/root,esakellari/root,agarciamontoro/root,pspe/root,omazapa/root,buuck/root,beniz/root,pspe/root,dfunke/root,0x0all/ROOT,CristinaCristescu/root,abhinavmoudgil95/root,veprbl/root,root-mirror/root,evgeny-boger/root,nilqed/root,krafczyk/root,veprbl/root,lgiommi/root,zzxuanyuan/root-compressor-dummy,esakellari/root,georgtroska/root,CristinaCristescu/root,alexschlueter/cern-root,CristinaCristescu/root,omazapa/root-old,mattkretz/root,perovic/root,Duraznos/root,omazapa/root,smarinac/root,esakellari/my_root_for_test,jrtomps/root,sirinath/root,smarinac/root,root-mirror/root,esakellari/my_root_for_test,0x0all/ROOT,satyarth934/root,zzxuanyuan/root-compressor-dummy,smarinac/root,abhinavmoudgil95/root,Y--/root,zzxuanyuan/root-compressor-dummy,alexschlueter/cern-root,lgiommi/root,lgiommi/root,vukasinmilosevic/root,dfunke/root,zzxuanyuan/root,omazapa/root,mkret2/root,pspe/root,buuck/root,pspe/root,arch1tect0r/root,root-mirror/root,abhinavmoudgil95/root,mattkretz/root,krafczyk/root,zzxuanyuan/root-compressor-dummy,davidlt/root,karies/root,nilqed/root,davidlt/root,georgtroska/root,buuck/root,cxx-hep/root-cern,BerserkerTroll/root,olifre/root,simonpf/root,zzxuanyuan/root-compressor-dummy,satyarth934/root,perovic/root,omazapa/root-old,dfunke/root,beniz/root,omazapa/root,mhuwiler/rootauto,arch1tect0r/root,satyarth934/root,esakellari/my_root_for_test,0x0all/ROOT,root-mirror/root,omazapa/root,vukasinmilosevic/root,Y--/root,omazapa/root-old,mattkretz/root,Duraznos/root,sawenzel/root,gbitzes/root,beniz/root,mattkretz/root,perovic/root,BerserkerTroll/root,smarinac/root,lgiommi/root,bbockelm/root,georgtroska/root,sbinet/cxx-root,evgeny-boger/root,veprbl/root,gganis/root,buuck/root,smarinac/root,mkret2/root,olifre/root,zzxuanyuan/root,esakellari/my_root_for_test,gbitzes/root,smarinac/root,thomaskeck/root,karies/root,agarciamontoro/root,omazapa/root,sirinath/root,olifre/root,vukasinmilosevic/root,abhinavmoudgil95/root,sirinath/root,arch1tect0r/root,beniz/root,abhinavmoudgil95/root,karies/root,sirinath/root,zzxuanyuan/root,Duraznos/root,smarinac/root,esakellari/my_root_for_test,agarciamontoro/root,nilqed/root,mhuwiler/rootauto,omazapa/root-old,arch1tect0r/root,arch1tect0r/root,gbitzes/root,Duraznos/root,dfunke/root,BerserkerTroll/root,zzxuanyuan/root-compressor-dummy,gbitzes/root,bbockelm/root,thomaskeck/root,olifre/root,veprbl/root,vukasinmilosevic/root,root-mirror/root,jrtomps/root,mhuwiler/rootauto,sirinath/root,BerserkerTroll/root,omazapa/root-old,CristinaCristescu/root,nilqed/root,sirinath/root,gganis/root,georgtroska/root,nilqed/root,BerserkerTroll/root,mattkretz/root,gbitzes/root,dfunke/root,zzxuanyuan/root,krafczyk/root,cxx-hep/root-cern,Duraznos/root,beniz/root,sawenzel/root,georgtroska/root,arch1tect0r/root,evgeny-boger/root,gganis/root,buuck/root,satyarth934/root,davidlt/root,veprbl/root,mhuwiler/rootauto,Duraznos/root,veprbl/root,sawenzel/root,evgeny-boger/root,Y--/root,jrtomps/root,Duraznos/root,bbockelm/root,zzxuanyuan/root,arch1tect0r/root,bbockelm/root,omazapa/root,thomaskeck/root,vukasinmilosevic/root,agarciamontoro/root,bbockelm/root,simonpf/root,root-mirror/root,cxx-hep/root-cern,esakellari/my_root_for_test,dfunke/root,davidlt/root,abhinavmoudgil95/root,mattkretz/root,Y--/root,mhuwiler/rootauto,esakellari/root,zzxuanyuan/root-compressor-dummy,beniz/root,perovic/root,simonpf/root,omazapa/root-old,jrtomps/root,mkret2/root,perovic/root,vukasinmilosevic/root,gganis/root,jrtomps/root,abhinavmoudgil95/root,sbinet/cxx-root,mattkretz/root,karies/root,CristinaCristescu/root,mkret2/root,Y--/root,dfunke/root,agarciamontoro/root,nilqed/root,jrtomps/root,pspe/root,zzxuanyuan/root-compressor-dummy,sbinet/cxx-root,Duraznos/root,esakellari/root,nilqed/root,olifre/root,evgeny-boger/root,thomaskeck/root,gbitzes/root,omazapa/root-old,mkret2/root,simonpf/root,mhuwiler/rootauto,olifre/root,0x0all/ROOT,root-mirror/root,beniz/root,satyarth934/root,0x0all/ROOT,sirinath/root,CristinaCristescu/root,sbinet/cxx-root,abhinavmoudgil95/root,arch1tect0r/root,sawenzel/root,Duraznos/root,simonpf/root,davidlt/root,Y--/root,nilqed/root,buuck/root,karies/root,vukasinmilosevic/root,mkret2/root,davidlt/root,veprbl/root,mhuwiler/rootauto,BerserkerTroll/root,pspe/root,smarinac/root,mhuwiler/rootauto,omazapa/root,lgiommi/root,Y--/root,arch1tect0r/root,olifre/root,esakellari/my_root_for_test,bbockelm/root,sawenzel/root,georgtroska/root,esakellari/root,alexschlueter/cern-root,jrtomps/root,karies/root,pspe/root,davidlt/root,root-mirror/root,agarciamontoro/root,gbitzes/root,vukasinmilosevic/root,sbinet/cxx-root,sirinath/root,Y--/root,cxx-hep/root-cern,krafczyk/root,esakellari/root,perovic/root,sbinet/cxx-root,root-mirror/root,esakellari/my_root_for_test,0x0all/ROOT,karies/root,beniz/root,zzxuanyuan/root-compressor-dummy,Duraznos/root,evgeny-boger/root,CristinaCristescu/root,gganis/root,jrtomps/root,lgiommi/root,pspe/root,gbitzes/root,mattkretz/root,CristinaCristescu/root,arch1tect0r/root,omazapa/root,esakellari/root,dfunke/root,olifre/root,veprbl/root,veprbl/root,sawenzel/root,krafczyk/root,cxx-hep/root-cern,krafczyk/root,Y--/root,simonpf/root,evgeny-boger/root,zzxuanyuan/root,beniz/root,lgiommi/root,gganis/root,davidlt/root,vukasinmilosevic/root,dfunke/root,BerserkerTroll/root,esakellari/my_root_for_test,sirinath/root,georgtroska/root,sawenzel/root,cxx-hep/root-cern,thomaskeck/root,buuck/root,root-mirror/root,agarciamontoro/root,sawenzel/root,zzxuanyuan/root,sbinet/cxx-root,omazapa/root,Duraznos/root,satyarth934/root,perovic/root,perovic/root,esakellari/my_root_for_test,veprbl/root,krafczyk/root,simonpf/root,Y--/root,krafczyk/root,simonpf/root,krafczyk/root,abhinavmoudgil95/root,sawenzel/root,omazapa/root,gganis/root,jrtomps/root,thomaskeck/root,olifre/root,dfunke/root,davidlt/root,evgeny-boger/root,thomaskeck/root,zzxuanyuan/root,gbitzes/root,mkret2/root,agarciamontoro/root,agarciamontoro/root,bbockelm/root,lgiommi/root,satyarth934/root,mattkretz/root,alexschlueter/cern-root,karies/root,mattkretz/root,mkret2/root,pspe/root,buuck/root,jrtomps/root,Y--/root,alexschlueter/cern-root,evgeny-boger/root,mhuwiler/rootauto,agarciamontoro/root,zzxuanyuan/root-compressor-dummy,thomaskeck/root,agarciamontoro/root,0x0all/ROOT,gganis/root,sbinet/cxx-root,smarinac/root,zzxuanyuan/root-compressor-dummy,krafczyk/root,BerserkerTroll/root,perovic/root,BerserkerTroll/root,evgeny-boger/root,esakellari/root,simonpf/root,olifre/root,gbitzes/root,sbinet/cxx-root,0x0all/ROOT,mkret2/root,zzxuanyuan/root,davidlt/root,omazapa/root-old,dfunke/root,zzxuanyuan/root,georgtroska/root,satyarth934/root,BerserkerTroll/root,buuck/root,omazapa/root-old,karies/root,beniz/root,nilqed/root,arch1tect0r/root,bbockelm/root,zzxuanyuan/root,bbockelm/root,gbitzes/root,sirinath/root,BerserkerTroll/root,cxx-hep/root-cern,satyarth934/root,alexschlueter/cern-root,beniz/root,perovic/root,karies/root,smarinac/root,satyarth934/root,satyarth934/root,bbockelm/root,bbockelm/root,mhuwiler/rootauto,0x0all/ROOT,evgeny-boger/root,lgiommi/root,karies/root,pspe/root,davidlt/root,lgiommi/root,nilqed/root,georgtroska/root,simonpf/root,esakellari/root,alexschlueter/cern-root,sawenzel/root,perovic/root,vukasinmilosevic/root,vukasinmilosevic/root,mkret2/root,pspe/root,krafczyk/root,abhinavmoudgil95/root,omazapa/root-old,sbinet/cxx-root,jrtomps/root,CristinaCristescu/root,georgtroska/root,buuck/root,mkret2/root,georgtroska/root,lgiommi/root,gganis/root,zzxuanyuan/root,mhuwiler/rootauto,olifre/root,simonpf/root,esakellari/root,thomaskeck/root
|
aa81908f7a649ade93036b5f30b91307e20cb464
|
include/clang/Rewrite/ASTConsumers.h
|
include/clang/Rewrite/ASTConsumers.h
|
//===--- ASTConsumers.h - ASTConsumer implementations -----------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// AST Consumers.
//
//===----------------------------------------------------------------------===//
#ifndef REWRITE_ASTCONSUMERS_H
#define REWRITE_ASTCONSUMERS_H
#include <string>
namespace llvm {
class raw_ostream;
}
namespace clang {
class ASTConsumer;
class Diagnostic;
class LangOptions;
class Preprocessor;
// ObjC rewriter: attempts tp rewrite ObjC constructs into pure C code.
// This is considered experimental, and only works with Apple's ObjC runtime.
ASTConsumer *CreateObjCRewriter(const std::string &InFile,
llvm::raw_ostream *OS,
Diagnostic &Diags,
const LangOptions &LOpts,
bool SilenceRewriteMacroWarning);
/// CreateHTMLPrinter - Create an AST consumer which rewrites source code to
/// HTML with syntax highlighting suitable for viewing in a web-browser.
ASTConsumer *CreateHTMLPrinter(llvm::raw_ostream *OS, Preprocessor &PP,
bool SyntaxHighlight = true,
bool HighlightMacros = true);
} // end clang namespace
#endif
|
//===--- ASTConsumers.h - ASTConsumer implementations -----------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// AST Consumers.
//
//===----------------------------------------------------------------------===//
#ifndef REWRITE_ASTCONSUMERS_H
#define REWRITE_ASTCONSUMERS_H
#include <string>
namespace llvm {
class raw_ostream;
}
namespace clang {
class ASTConsumer;
class Diagnostic;
class LangOptions;
class Preprocessor;
// ObjC rewriter: attempts to rewrite ObjC constructs into pure C code.
// This is considered experimental, and only works with Apple's ObjC runtime.
ASTConsumer *CreateObjCRewriter(const std::string &InFile,
llvm::raw_ostream *OS,
Diagnostic &Diags,
const LangOptions &LOpts,
bool SilenceRewriteMacroWarning);
/// CreateHTMLPrinter - Create an AST consumer which rewrites source code to
/// HTML with syntax highlighting suitable for viewing in a web-browser.
ASTConsumer *CreateHTMLPrinter(llvm::raw_ostream *OS, Preprocessor &PP,
bool SyntaxHighlight = true,
bool HighlightMacros = true);
} // end clang namespace
#endif
|
Fix typo spotted by Nico Weber.
|
Fix typo spotted by Nico Weber.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@117870 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
apple/swift-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,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang
|
3a5041e79cbd70903d43608296e5b74e6473bd13
|
config.h
|
config.h
|
/* Uncomment to compile with tcpd/libwrap support. */
//#define WITH_WRAP
/* Compile with database upgrading support? If disabled, mosquitto won't
* automatically upgrade old database versions. */
#define WITH_DB_UPGRADE
/* Compile with memory tracking support? If disabled, mosquitto won't track
* heap memory usage nor export '$SYS/broker/heap/current size', but will use
* slightly less memory and CPU time. */
#define WITH_MEMORY_TRACKING
|
/* Uncomment to compile with tcpd/libwrap support. */
//#define WITH_WRAP
/* Compile with database upgrading support? If disabled, mosquitto won't
* automatically upgrade old database versions. */
//#define WITH_DB_UPGRADE
/* Compile with memory tracking support? If disabled, mosquitto won't track
* heap memory usage nor export '$SYS/broker/heap/current size', but will use
* slightly less memory and CPU time. */
#define WITH_MEMORY_TRACKING
|
Disable db upgrade code for the moment.
|
Disable db upgrade code for the moment.
|
C
|
bsd-3-clause
|
tempbottle/mosquitto,tempbottle/mosquitto,tempbottle/mosquitto,tempbottle/mosquitto,tempbottle/mosquitto
|
d3e46ddf119944613580925c30d38a0dfa8f380e
|
test/CodeGen/pr5406.c
|
test/CodeGen/pr5406.c
|
// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | FileCheck %s
// PR 5406
// XFAIL: *
// XTARGET: arm
typedef struct { char x[3]; } A0;
void foo (int i, ...);
// CHECK: call void (i32, ...)* @foo(i32 1, i32 {{.*}}) nounwind
int main (void)
{
A0 a3;
a3.x[0] = 0;
a3.x[0] = 0;
a3.x[2] = 26;
foo (1, a3 );
return 0;
}
|
// RUN: %clang_cc1 %s -emit-llvm -triple arm-apple-darwin -o - | FileCheck %s
// PR 5406
typedef struct { char x[3]; } A0;
void foo (int i, ...);
// CHECK: call arm_aapcscc void (i32, ...)* @foo(i32 1, [1 x i32] {{.*}})
int main (void)
{
A0 a3;
a3.x[0] = 0;
a3.x[0] = 0;
a3.x[2] = 26;
foo (1, a3 );
return 0;
}
|
Add a triple to this test and make sure it passes on arm where it was supposed to.
|
Add a triple to this test and make sure it passes on arm where it was
supposed to.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@136305 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
|
56b0b9bc9059bb25a5d7ea2ab8723f63fe1fed9f
|
src/Pomade.c
|
src/Pomade.c
|
#include "pebble_os.h"
#include "pebble_app.h"
#include "pebble_fonts.h"
#define MY_UUID { 0x78, 0x1D, 0x21, 0x66, 0x09, 0x09, 0x4F, 0x9C, 0x88, 0xFD, 0x89, 0x9B, 0x04, 0xBF, 0x5E, 0x32 }
PBL_APP_INFO(MY_UUID,
"Pomade", "Jon Speicher",
0, 1, /* App version */
DEFAULT_MENU_ICON,
APP_INFO_STANDARD_APP);
Window window;
void handle_init(AppContextRef ctx) {
window_init(&window, "Pomade");
window_stack_push(&window, true /* Animated */);
}
void pbl_main(void *params) {
PebbleAppHandlers handlers = {
.init_handler = &handle_init
};
app_event_loop(params, &handlers);
}
|
#include "pebble_os.h"
#include "pebble_app.h"
#include "pebble_fonts.h"
#define MY_UUID { 0x78, 0x1D, 0x21, 0x66, 0x09, 0x09, 0x4F, 0x9C, 0x88, 0xFD, 0x89, 0x9B, 0x04, 0xBF, 0x5E, 0x32 }
PBL_APP_INFO(MY_UUID,
"Pomade", "Jon Speicher",
0, 1, /* App version */
DEFAULT_MENU_ICON,
APP_INFO_STANDARD_APP);
Window window;
TextLayer timerLayer;
AppTimerHandle timer_handle;
#define COOKIE_MY_TIMER 1
void handle_timer(AppContextRef ctx, AppTimerHandle handle, uint32_t cookie) {
if (cookie == COOKIE_MY_TIMER) {
text_layer_set_text(&timerLayer, "Timer happened!");
}
// If you want the timer to run again you need to call `app_timer_send_event()`
// again here.
}
void handle_init(AppContextRef ctx) {
window_init(&window, "Pomade");
window_stack_push(&window, true /* Animated */);
text_layer_init(&timerLayer, window.layer.frame);
text_layer_set_text(&timerLayer, "Waiting for timer...");
layer_add_child(&window.layer, &timerLayer.layer);
timer_handle = app_timer_send_event(ctx, 1500 /* milliseconds */, COOKIE_MY_TIMER);
}
void pbl_main(void *params) {
PebbleAppHandlers handlers = {
.init_handler = &handle_init,
.timer_handler = &handle_timer
};
app_event_loop(params, &handlers);
}
|
Add framework timer code from Pebble feature_timer demo app
|
Add framework timer code from Pebble feature_timer demo app
|
C
|
mit
|
jonspeicher/Pomade,jonspeicher/Pomade,elliots/simple-demo-pebble
|
c8801b3611431a17c12c8b0842230ff8cf31033f
|
compiler/native/src/class/function_header.h
|
compiler/native/src/class/function_header.h
|
namespace NJS::Class
{
class Function
{
public:
int cnt = 0;
string code = "[native code]";
void Delete();
Function(void *_f);
void *__NJS_VALUE;
vector<pair<const char *, NJS::VAR>> __OBJECT;
template <class... Args>
NJS::VAR operator()(Args... args);
explicit NJS::Class::Function::operator std::string() const
{
return "function () { " + code + " }";
}
};
} // namespace NJS::CLASS
|
namespace NJS::Class
{
class Function
{
public:
int cnt = 0;
string code = "[native code]";
void Delete();
Function(void *_f);
void *__NJS_VALUE;
vector<pair<const char *, NJS::VAR>> __OBJECT;
template <class... Args>
NJS::VAR operator()(Args... args);
explicit operator std::string() const
{
return "function () { " + code + " }";
}
};
} // namespace NJS::CLASS
|
Add function.toString() and source code if --debug
|
Add function.toString() and source code if --debug
|
C
|
mit
|
seraum/nectarjs,seraum/nectarjs,seraum/nectarjs,seraum/nectarjs,seraum/nectarjs
|
685cc22bc92f5b35c9ec6fcc7fe8e65bda3ecf1e
|
src/math/p_asin.c
|
src/math/p_asin.c
|
#include <pal.h>
/**
*
* Caclulates the inverse sine (arc sine) of the argument 'a'. Arguments must be
* in the range -1 to 1. The function does not check for illegal input values.
* Results are in the range -pi/2 to pi/2.
*
* @param a Pointer to input vector
*
* @param c Pointer to output vector
*
* @param n Size of 'a' and 'c' vector.
*
* @return None
*
*/
#include <math.h>
void p_asin_f32(const float *a, float *c, int n)
{
int i;
for (i = 0; i < n; i++) {
*(c + i) = asinf(*(a + i));
}
}
|
#include <math.h>
#include <pal.h>
static const float pi_2 = (float) M_PI / 2.f;
/*
* 0 <= x <= 1
* asin x = pi/2 - (1 - x)^(1/2) * (a0 + a1 * x + ... + a3 * x^3) + e(x)
* |e(x)| <= 5 * 10^-5
*/
static inline float __p_asin_pos(const float x)
{
const float a0 = 1.5707288f;
const float a1 = -0.2121144f;
const float a2 = 0.0742610f;
const float a3 = -0.0187293f;
float a_ = 1.f - x;
float a;
p_sqrt_f32(&a_, &a, 1);
return pi_2 - a * (a0 + a1 * x + a2 * x * x + a3 * x * x * x);
}
/*
* -1 <= x <= 1
* asin(-x) = - asin x
*/
static inline float _p_asin(const float x)
{
if (x >= 0.f)
return __p_asin_pos(x);
else
return -1.f * __p_asin_pos(-x);
}
/**
*
* Caclulates the inverse sine (arc sine) of the argument 'a'. Arguments must be
* in the range -1 to 1. The function does not check for illegal input values.
* Results are in the range -pi/2 to pi/2.
*
* @param a Pointer to input vector
*
* @param c Pointer to output vector
*
* @param n Size of 'a' and 'c' vector.
*
* @return None
*
*/
void p_asin_f32(const float *a, float *c, int n)
{
int i;
for (i = 0; i < n; i++) {
c[i] = _p_asin(a[i]);
}
}
|
Implement the inverse sine function.
|
math:asin: Implement the inverse sine function.
Signed-off-by: Mansour Moufid <ac5f6b12fab5e0d4efa7215e6c2dac9d55ab77dc@gmail.com>
|
C
|
apache-2.0
|
debug-de-su-ka/pal,8l/pal,eliteraspberries/pal,Adamszk/pal3,8l/pal,Adamszk/pal3,Adamszk/pal3,aolofsson/pal,debug-de-su-ka/pal,mateunho/pal,parallella/pal,parallella/pal,8l/pal,aolofsson/pal,debug-de-su-ka/pal,olajep/pal,mateunho/pal,8l/pal,eliteraspberries/pal,olajep/pal,parallella/pal,parallella/pal,debug-de-su-ka/pal,mateunho/pal,parallella/pal,debug-de-su-ka/pal,Adamszk/pal3,eliteraspberries/pal,mateunho/pal,aolofsson/pal,eliteraspberries/pal,olajep/pal,olajep/pal,eliteraspberries/pal,aolofsson/pal,mateunho/pal
|
70c33ced375baeccbb500446a861c7a61d04abc2
|
tools/regression/bpf/bpf_filter/tests/test0083.h
|
tools/regression/bpf/bpf_filter/tests/test0083.h
|
/*-
* Test 0083: Check that the last instruction is BPF_RET.
*
* $FreeBSD$
*/
/* BPF program */
struct bpf_insn pc[] = {
BPF_JUMP(BPF_JMP+BPF_JA, 0, 0, 0),
};
/* Packet */
u_char pkt[] = {
0x00,
};
/* Packet length seen on wire */
u_int wirelen = sizeof(pkt);
/* Packet length passed on buffer */
u_int buflen = sizeof(pkt);
/* Invalid instruction */
int invalid = 1;
/* Expected return value */
u_int expect = 0;
/* Expected signal */
#ifdef BPF_JIT_COMPILER
int expect_signal = SIGSEGV;
#else
int expect_signal = SIGABRT;
#endif
|
/*-
* Test 0083: Check that the last instruction is BPF_RET.
*
* $FreeBSD$
*/
/* BPF program */
struct bpf_insn pc[] = {
BPF_STMT(BPF_LD|BPF_IMM, 0),
};
/* Packet */
u_char pkt[] = {
0x00,
};
/* Packet length seen on wire */
u_int wirelen = sizeof(pkt);
/* Packet length passed on buffer */
u_int buflen = sizeof(pkt);
/* Invalid instruction */
int invalid = 1;
/* Expected return value */
u_int expect = 0;
/* Expected signal */
#ifdef BPF_JIT_COMPILER
int expect_signal = SIGSEGV;
#else
int expect_signal = SIGABRT;
#endif
|
Adjust a test case and make it more jump optimization neutral for JIT case.
|
Adjust a test case and make it more jump optimization neutral for JIT case.
|
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
|
ce580a9f30cc5d4058cb650498efe21b63f39d65
|
src/toolbox/tbx/dns_cache.h
|
src/toolbox/tbx/dns_cache.h
|
/*
Copyright 2016 Vanderbilt University
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.
*/
#pragma once
#ifndef ACCRE_DNS_CACHE_H_INCLUDED
#define ACCRE_DNS_CACHE_H_INCLUDED
#include "tbx/toolbox_visibility.h"
#ifdef __cplusplus
extern "C" {
#endif
// Functions
TBX_API int tbx_dnsc_lookup(const char * name, char * byte_addr, char * ip_addr);
TBX_API int tbx_dnsc_shutdown();
TBX_API int tbx_dnsc_startup();
TBX_API int tbx_dnsc_startup_sized(int size);
// Preprocessor macros
#define DNS_ADDR_MAX 4
#define DNS_IPV4 0
#define DNS_IPV6 1
#ifdef __cplusplus
}
#endif
#endif
|
/*
Copyright 2016 Vanderbilt University
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.
*/
#pragma once
#ifndef ACCRE_DNS_CACHE_H_INCLUDED
#define ACCRE_DNS_CACHE_H_INCLUDED
#include "tbx/toolbox_visibility.h"
#ifdef __cplusplus
extern "C" {
#endif
// Functions
TBX_API int tbx_dnsc_lookup(const char * name, char * byte_addr, char * ip_addr);
TBX_API int tbx_dnsc_shutdown();
TBX_API int tbx_dnsc_startup();
TBX_API int tbx_dnsc_startup_sized(int size);
// Preprocessor macros
#define DNS_ADDR_MAX 16
#define DNS_IPV4 0
#define DNS_IPV6 1
#ifdef __cplusplus
}
#endif
#endif
|
Add enough space in DNS cache for IPV6
|
Add enough space in DNS cache for IPV6
We have code supporting IPV6, but the structs only have enough space for
IPV4.
|
C
|
apache-2.0
|
PerilousApricot/lstore,accre/lstore,accre/lstore,PerilousApricot/lstore,tacketar/lstore,tacketar/lstore,PerilousApricot/lstore,accre/lstore,tacketar/lstore,accre/lstore,tacketar/lstore,PerilousApricot/lstore
|
70beeb5a61cbf12a59000c8fd1e56c638e3a6aa4
|
src/hardware_dep/dpdk/data_plane/dpdkx_hash.c
|
src/hardware_dep/dpdk/data_plane/dpdkx_hash.c
|
// SPDX-License-Identifier: Apache-2.0
// Copyright 2021 Eotvos Lorand University, Budapest, Hungary
#include "dpdk_model_v1model.h"
#include "util_packet.h"
#include "util_debug.h"
#include "dpdk_lib.h"
#include "stateful_memory.h"
#include <rte_ip.h>
void hash(uint16_t* result, enum_HashAlgorithm_t hash, uint16_t base, uint8_buffer_t data, uint32_t max, SHORT_STDPARAMS) {
debug(" : Executing hash\n");
}
|
// SPDX-License-Identifier: Apache-2.0
// Copyright 2021 Eotvos Lorand University, Budapest, Hungary
#include "dpdk_model_v1model.h"
#include "util_packet.h"
#include "util_debug.h"
#include "dpdk_lib.h"
#include "stateful_memory.h"
#include "rte_hash_crc.h"
#include <rte_ip.h>
void hash(uint16_t* result, enum_HashAlgorithm_t hash, uint16_t base, uint8_buffer_t data, uint32_t max, SHORT_STDPARAMS) {
debug(" : Executing hash\n");
dbg_bytes(data.buffer, data.buffer_size, " Input: " T4LIT(%d) " bytes: ", data.buffer_size);
if (hash == enum_HashAlgorithm_crc32){
uint32_t crc32_result = rte_hash_crc(data.buffer, data.buffer_size, 0xffffffff);
memcpy(result, &crc32_result, 4);
}
else if (hash == enum_HashAlgorithm_identity) {
memcpy(result, data.buffer, data.buffer_size > 8 ? 8 : data.buffer_size);
}
else {
debug(" : Unkown hashing method!\n");
}
dbg_bytes(result, 4, " Result:");
}
|
Add crc32 and identity hash functions
|
Add crc32 and identity hash functions
|
C
|
apache-2.0
|
P4ELTE/t4p4s,P4ELTE/t4p4s,P4ELTE/t4p4s
|
128380f9f4693249367c5b34ea67507fd2e822c5
|
src/ext/mruby_UI_control_hierarchy.c
|
src/ext/mruby_UI_control_hierarchy.c
|
{
struct RClass *Control_class = mrb_define_class_under(mrb, UI_module(mrb), "Control", mrb->object_class);
#define CONTROL_SUBCLASS(name) { struct RClass* subclass = mrb_define_class_under(mrb, UI_module(mrb), #name, Control_class); }
CONTROL_SUBCLASS(Area)
CONTROL_SUBCLASS(Box)
CONTROL_SUBCLASS(Button)
CONTROL_SUBCLASS(Checkbox)
CONTROL_SUBCLASS(ColorButton)
CONTROL_SUBCLASS(Combobox)
CONTROL_SUBCLASS(DateTimePicker)
CONTROL_SUBCLASS(EditableCombobox)
CONTROL_SUBCLASS(Entry)
CONTROL_SUBCLASS(FontButton)
CONTROL_SUBCLASS(Form)
CONTROL_SUBCLASS(Grid)
CONTROL_SUBCLASS(Group)
CONTROL_SUBCLASS(Label)
CONTROL_SUBCLASS(MultilineEntry)
CONTROL_SUBCLASS(ProgressBar)
CONTROL_SUBCLASS(RadioButtons)
CONTROL_SUBCLASS(Separator)
CONTROL_SUBCLASS(Slider)
CONTROL_SUBCLASS(Spinbox)
CONTROL_SUBCLASS(Tab)
CONTROL_SUBCLASS(Window)
#undef CONTROL_SUBCLASS
}
|
{
struct RClass *Control_class = mrb_define_class_under(mrb, UI_module(mrb), "Control", mrb->object_class);
#define CONTROL_SUBCLASS(name) { mrb_define_class_under(mrb, UI_module(mrb), #name, Control_class); }
CONTROL_SUBCLASS(Area)
CONTROL_SUBCLASS(Box)
CONTROL_SUBCLASS(Button)
CONTROL_SUBCLASS(Checkbox)
CONTROL_SUBCLASS(ColorButton)
CONTROL_SUBCLASS(Combobox)
CONTROL_SUBCLASS(DateTimePicker)
CONTROL_SUBCLASS(EditableCombobox)
CONTROL_SUBCLASS(Entry)
CONTROL_SUBCLASS(FontButton)
CONTROL_SUBCLASS(Form)
CONTROL_SUBCLASS(Grid)
CONTROL_SUBCLASS(Group)
CONTROL_SUBCLASS(Label)
CONTROL_SUBCLASS(MultilineEntry)
CONTROL_SUBCLASS(ProgressBar)
CONTROL_SUBCLASS(RadioButtons)
CONTROL_SUBCLASS(Separator)
CONTROL_SUBCLASS(Slider)
CONTROL_SUBCLASS(Spinbox)
CONTROL_SUBCLASS(Tab)
CONTROL_SUBCLASS(Window)
#undef CONTROL_SUBCLASS
}
|
Address compiler warning - unused variable
|
Address compiler warning - unused variable
|
C
|
mit
|
jbreeden/mruby-ui,jbreeden/mruby-ui,jbreeden/mruby-ui
|
7bc887f8c78d37decdb91612decd7dfd463c9727
|
UIColor-Expanded.h
|
UIColor-Expanded.h
|
#import <UIKit/UIKit.h>
#define SUPPORTS_UNDOCUMENTED_API 1
@interface UIColor (expanded)
- (CGColorSpaceModel) colorSpaceModel;
- (NSString *) colorSpaceString;
- (BOOL) canProvideRGBComponents;
- (NSArray *) arrayFromRGBAComponents;
- (CGFloat) red;
- (CGFloat) blue;
- (CGFloat) green;
- (CGFloat) alpha;
- (NSString *) stringFromColor;
- (NSString *) hexStringFromColor;
#if SUPPORTS_UNDOCUMENTED_API
// Optional Undocumented API calls
- (NSString *) fetchStyleString;
- (UIColor *) rgbColor; // Via Poltras
#endif
+ (UIColor *) colorWithString: (NSString *) stringToConvert;
+ (UIColor *) colorWithHexString: (NSString *) stringToConvert;
@property (readonly) CGFloat red;
@property (readonly) CGFloat green;
@property (readonly) CGFloat blue;
@property (readonly) CGFloat alpha;
@end
|
#import <UIKit/UIKit.h>
#define SUPPORTS_UNDOCUMENTED_API 1
@interface UIColor (expanded)
- (CGColorSpaceModel) colorSpaceModel;
- (NSString *) colorSpaceString;
- (BOOL) canProvideRGBComponents;
- (NSArray *) arrayFromRGBAComponents;
- (CGFloat) red;
- (CGFloat) blue;
- (CGFloat) green;
- (CGFloat) alpha;
- (NSString *) stringFromColor;
- (NSString *) hexStringFromColor;
#if SUPPORTS_UNDOCUMENTED_API
// Optional Undocumented API calls
- (NSString *) fetchStyleString;
- (UIColor *) rgbColor; // Via Poltras
#endif
+ (UIColor *) colorWithString: (NSString *) stringToConvert;
+ (UIColor *) colorWithHexString: (NSString *) stringToConvert;
@property (nonatomic, readonly) CGFloat red;
@property (nonatomic, readonly) CGFloat green;
@property (nonatomic, readonly) CGFloat blue;
@property (nonatomic, readonly) CGFloat alpha;
@end
|
Declare the properties as nonatomic
|
Declare the properties as nonatomic
|
C
|
bsd-3-clause
|
fcanas/uicolor-utilities
|
12dea43b35daf92a6087f3a980aff767ac0b7043
|
base/win/comptr.h
|
base/win/comptr.h
|
// LAF Base Library
// Copyright (c) 2017 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef BASE_WIN_COMPTR_H_INCLUDED
#define BASE_WIN_COMPTR_H_INCLUDED
#pragma once
#if !defined(_WIN32)
#error This header file can be used only on Windows platform
#endif
#include "base/disable_copying.h"
namespace base {
template<class T>
class ComPtr {
public:
ComPtr() : m_ptr(nullptr) { }
~ComPtr() { reset(); }
T** operator&() { return &m_ptr; }
T* operator->() { return m_ptr; }
T* get() {
return m_ptr;
}
void reset() {
if (m_ptr) {
m_ptr->Release();
m_ptr = nullptr;
}
}
private:
T* m_ptr;
DISABLE_COPYING(ComPtr);
};
} // namespace base
#endif
|
// LAF Base Library
// Copyright (c) 2021 Igara Studio S.A.
// Copyright (c) 2017 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef BASE_WIN_COMPTR_H_INCLUDED
#define BASE_WIN_COMPTR_H_INCLUDED
#pragma once
#if !defined(_WIN32)
#error This header file can be used only on Windows platform
#endif
#include <algorithm>
namespace base {
template<class T>
class ComPtr {
public:
ComPtr() : m_ptr(nullptr) {
}
ComPtr<T>(const ComPtr<T>& p) : m_ptr(p.m_ptr) {
if (m_ptr)
m_ptr->AddRef();
}
ComPtr(ComPtr&& tmp) {
std::swap(m_ptr, tmp.m_ptr);
}
~ComPtr() {
reset();
}
T** operator&() { return &m_ptr; }
T* operator->() { return m_ptr; }
operator bool() const { return m_ptr != nullptr; }
// Add new reference using operator=()
ComPtr<T>& operator=(const ComPtr<T>& p) {
if (m_ptr)
m_ptr->Release();
m_ptr = p.m_ptr;
if (m_ptr)
m_ptr->AddRef();
return *this;
}
ComPtr& operator=(std::nullptr_t) {
reset();
return *this;
}
T* get() {
return m_ptr;
}
void reset() {
if (m_ptr) {
m_ptr->Release();
m_ptr = nullptr;
}
}
private:
T* m_ptr;
};
} // namespace base
#endif
|
Add some extra operators to base::ComPtr
|
[win] Add some extra operators to base::ComPtr
|
C
|
mit
|
aseprite/laf,aseprite/laf
|
8ef7b8f1894730da660155b00e2c3b4e394ed4d7
|
src/id.h
|
src/id.h
|
extern void change_id(const char *string);
|
/*=============================================================================
Copyright 2008 Francois Laupretre (francois@tekwire.net)
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 __ID_H
#define __ID_H
/*----------------------------------------------*/
extern void change_id(const char *string);
/*----------------------------------------------*/
#endif /* __ID_H */
|
Add copyright banner to source file
|
Add copyright banner to source file
|
C
|
apache-2.0
|
flaupretre/managelogs,flaupretre/managelogs
|
412bbb8121b91e7447b05839df64b526edec2786
|
event/timeout_queue.h
|
event/timeout_queue.h
|
#ifndef TIMEOUT_QUEUE_H
#define TIMEOUT_QUEUE_H
#include <map>
class TimeoutQueue {
typedef std::map<NanoTime, CallbackQueue> timeout_map_t;
LogHandle log_;
timeout_map_t timeout_queue_;
public:
TimeoutQueue(void)
: log_("/event/timeout/queue"),
timeout_queue_()
{ }
~TimeoutQueue()
{ }
bool empty(void) const
{
timeout_map_t::const_iterator it;
/*
* Since we allow elements within each CallbackQueue to be
* cancelled, we must scan them.
*
* XXX
* We really shouldn't allow this, even if it means we have
* to specialize CallbackQueue for this purpose or add
* virtual methods to it. As it is, we can return true
* for empty and for ready at the same time. And in those
* cases we have to call perform to garbage collect the
* unused CallbackQueues. We'll, quite conveniently,
* never make that call. Yikes.
*/
for (it = timeout_queue_.begin(); it != timeout_queue_.end(); ++it) {
if (it->second.empty())
continue;
return (false);
}
return (true);
}
Action *append(uintmax_t, SimpleCallback *);
uintmax_t interval(void) const;
void perform(void);
bool ready(void) const;
};
#endif /* !TIMEOUT_QUEUE_H */
|
#ifndef TIMEOUT_QUEUE_H
#define TIMEOUT_QUEUE_H
#include <map>
#include <common/time/time.h>
class TimeoutQueue {
typedef std::map<NanoTime, CallbackQueue> timeout_map_t;
LogHandle log_;
timeout_map_t timeout_queue_;
public:
TimeoutQueue(void)
: log_("/event/timeout/queue"),
timeout_queue_()
{ }
~TimeoutQueue()
{ }
bool empty(void) const
{
timeout_map_t::const_iterator it;
/*
* Since we allow elements within each CallbackQueue to be
* cancelled, we must scan them.
*
* XXX
* We really shouldn't allow this, even if it means we have
* to specialize CallbackQueue for this purpose or add
* virtual methods to it. As it is, we can return true
* for empty and for ready at the same time. And in those
* cases we have to call perform to garbage collect the
* unused CallbackQueues. We'll, quite conveniently,
* never make that call. Yikes.
*/
for (it = timeout_queue_.begin(); it != timeout_queue_.end(); ++it) {
if (it->second.empty())
continue;
return (false);
}
return (true);
}
Action *append(uintmax_t, SimpleCallback *);
uintmax_t interval(void) const;
void perform(void);
bool ready(void) const;
};
#endif /* !TIMEOUT_QUEUE_H */
|
Use new NanoTime location header, oops.
|
Use new NanoTime location header, oops.
git-svn-id: 9e2532540f1574e817ce42f20b9d0fb64899e451@799 4068ffdb-0463-0410-8185-8cc71e3bd399
|
C
|
bsd-2-clause
|
diegows/wanproxy,splbio/wanproxy,diegows/wanproxy,diegows/wanproxy,splbio/wanproxy,splbio/wanproxy
|
d38a75138ffc03fd7a1fff4e00a85229549c1492
|
lib/libc/alpha/gen/_set_tp.c
|
lib/libc/alpha/gen/_set_tp.c
|
/*-
* Copyright (c) 2004 Doug Rabson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#include <stdint.h>
#include <machine/alpha_cpu.h>
void
_set_tp(void *tp)
{
alpha_pal_wrunique((uintptr_t) tp);
}
|
/*-
* Copyright (c) 2004 Doug Rabson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <machine/alpha_cpu.h>
void
_set_tp(void *tp)
{
alpha_pal_wrunique((uintptr_t) tp);
}
|
Fix alpha build and add __FBSDID.
|
Fix alpha build and add __FBSDID.
PR: 70518
|
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
|
307f1a7087c28f139693feb9f0a773c5e4f0ec33
|
SSPSolution/SSPSolution/GameState.h
|
SSPSolution/SSPSolution/GameState.h
|
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATE_H
#define SSPAPPLICATION_GAMESTATES_GAMESTATE_H
#include "InputHandler.h"
#include "ComponentHandler.h"
#include "../GraphicsDLL/Camera.h"
#include "../NetworkDLL/NetworkModule.h"
//class NetworkModule;
class GameStateHandler;
class GameState
{
private: //Variables
protected:
GameStateHandler* m_gsh;
ComponentHandler* m_cHandler;
Camera* m_cameraRef;
//static NetworkModule* m_networkModule;
char* m_ip = "192.168.1.25"; //Tobias NUC Specific local ip
int InitializeBase(GameStateHandler* gsh, ComponentHandler* cHandler, Camera* cameraRef);
public:
GameState();
virtual ~GameState();
virtual int ShutDown() = 0;
//Returns 1 for success and 0 for failure
virtual int Initialize(GameStateHandler* gsh, ComponentHandler* cHandler, Camera* cameraRef) = 0;
virtual int Update(float dt, InputHandler * inputHandler) = 0;
private: //Helper functions
};
#endif
|
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATE_H
#define SSPAPPLICATION_GAMESTATES_GAMESTATE_H
#include "InputHandler.h"
#include "ComponentHandler.h"
#include "../GraphicsDLL/Camera.h"
//#include "../NetworkDLL/NetworkModule.h"
//class NetworkModule;
class GameStateHandler;
class GameState
{
private: //Variables
protected:
GameStateHandler* m_gsh;
ComponentHandler* m_cHandler;
Camera* m_cameraRef;
//static NetworkModule* m_networkModule;
char* m_ip = "192.168.1.25"; //Tobias NUC Specific local ip
int InitializeBase(GameStateHandler* gsh, ComponentHandler* cHandler, Camera* cameraRef);
public:
GameState();
virtual ~GameState();
virtual int ShutDown() = 0;
//Returns 1 for success and 0 for failure
virtual int Initialize(GameStateHandler* gsh, ComponentHandler* cHandler, Camera* cameraRef) = 0;
virtual int Update(float dt, InputHandler * inputHandler) = 0;
private: //Helper functions
};
#endif
|
UPDATE doubble checked for Fransisco
|
UPDATE doubble checked for Fransisco
|
C
|
apache-2.0
|
Chringo/SSP,Chringo/SSP
|
233f4d4e5bc298dbb9acf5bde745cd8504ce3f07
|
stratego-libraries/lib/native/stratego-lib/collection-list-common.c
|
stratego-libraries/lib/native/stratego-lib/collection-list-common.c
|
#include <srts/stratego.h>
#include "stratego-lib-common.h"
ATerm SSL_get_list_length(ATerm term)
{
ATermList list = NULL;
ATerm result = NULL;
if(!ATisList(term)) {
_fail(term);
}
list = (ATermList) term;
result = (ATerm) ATmakeInt(ATgetLength(term));
return result;
}
|
#include <srts/stratego.h>
#include "stratego-lib-common.h"
ATerm SSL_get_list_length(ATerm term)
{
ATermList list = NULL;
ATerm result = NULL;
if(!ATisList(term)) {
_fail(term);
}
list = (ATermList) term;
result = (ATerm) ATmakeInt(ATgetLength(list));
return result;
}
|
Fix in native implementation of length strategy: ATgetLength should be applied to an ATermList.
|
Fix in native implementation of length strategy: ATgetLength should be
applied to an ATermList.
svn path=/strategoxt/trunk/; revision=16203
|
C
|
apache-2.0
|
Apanatshka/strategoxt,lichtemo/strategoxt,lichtemo/strategoxt,lichtemo/strategoxt,Apanatshka/strategoxt,metaborg/strategoxt,lichtemo/strategoxt,metaborg/strategoxt,metaborg/strategoxt,metaborg/strategoxt,Apanatshka/strategoxt,Apanatshka/strategoxt,Apanatshka/strategoxt,metaborg/strategoxt,lichtemo/strategoxt
|
91b3d8878edeba4c7d1d1ba0c75e171bb38e46d4
|
arch/powerpc/powerpc/db_interface.c
|
arch/powerpc/powerpc/db_interface.c
|
/* $OpenBSD: db_interface.c,v 1.2 1996/12/28 06:21:50 rahnds Exp $ */
#include <sys/param.h>
#include <sys/proc.h>
#include <machine/db_machdep.h>
void
Debugger()
{
db_trap(T_BREAKPOINT);
/*
__asm volatile ("tw 4,2,2");
*/
}
|
/* $OpenBSD: db_interface.c,v 1.3 1999/07/05 20:23:08 rahnds Exp $ */
#include <sys/param.h>
#include <sys/proc.h>
#include <machine/db_machdep.h>
void
Debugger()
{
/*
db_trap(T_BREAKPOINT);
*/
__asm volatile ("tw 4,2,2");
}
|
Use a breakpoint to cause an exception to cause the registers to be saved for debugging purposes.
|
Use a breakpoint to cause an exception to cause the registers to be
saved for debugging purposes.
|
C
|
isc
|
orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars
|
e5a8e3198f1990871e65d354b1cc53ed234f75d6
|
src/navigationwidget.h
|
src/navigationwidget.h
|
#ifndef NAVIGATIONWIDGET_H
#define NAVIGATIONWIDGET_H
#include <QWidget>
#include <QLabel>
#include "qnavigation_global.h"
class QLabel;
class QPushButton;
namespace QNavigation
{
class SlidingStackedWidget;
class NavigationWidgetPrivate;
class NavigationWidget : public QWidget
{
Q_OBJECT
Q_DECLARE_PRIVATE(NavigationWidget)
NavigationWidgetPrivate * const d_ptr;
Q_PRIVATE_SLOT(d_func(), void cleanup())
public:
explicit NavigationWidget(QWidget *parent = 0);
virtual ~NavigationWidget();
bool level() const;
QLabel *titleLabel() const;
QPushButton *backButton() const;
SlidingStackedWidget *stackedWidget() const;
bool navigationBarHidden() const;
void setNavigationBarHidden(bool hidden);
public slots:
void push(QWidget *item);
void pop();
void popToTop();
};
} // namespace QNavigation
#endif // NAVIGATIONWIDGET_H
|
#ifndef QNAVIGATION_NAVIGATIONWIDGET_H
#define QNAVIGATION_NAVIGATIONWIDGET_H
#include <QWidget>
#include <QLabel>
#include "qnavigation_global.h"
class QLabel;
class QPushButton;
namespace QNavigation
{
class SlidingStackedWidget;
class NavigationWidgetPrivate;
class NavigationWidget : public QWidget
{
Q_OBJECT
Q_DECLARE_PRIVATE(NavigationWidget)
NavigationWidgetPrivate * const d_ptr;
Q_PRIVATE_SLOT(d_func(), void cleanup())
public:
explicit NavigationWidget(QWidget *parent = 0);
virtual ~NavigationWidget();
bool level() const;
QLabel *titleLabel() const;
QPushButton *backButton() const;
SlidingStackedWidget *stackedWidget() const;
bool navigationBarHidden() const;
void setNavigationBarHidden(bool hidden);
public slots:
void push(QWidget *item);
void pop();
void popToTop();
};
} // namespace QNavigation
#endif // QNAVIGATION_NAVIGATIONWIDGET_H
|
Fix inclusion guard for NavigationWidget
|
Fix inclusion guard for NavigationWidget
|
C
|
bsd-3-clause
|
bimetek/qnavigation,bimetek/qnavigation
|
2c3316530d25d46038526902079fde1c3c643516
|
Classes/Instapaper/InstapaperAPI.h
|
Classes/Instapaper/InstapaperAPI.h
|
//
// InstapaperAPI.h
// newsyc
//
// Created by Grant Paul on 3/10/11.
// Copyright 2011 Xuzz Productions, LLC. All rights reserved.
//
#import <HNKit/NSString+URLEncoding.h>
#define kInstapaperAPIRootURL [NSURL URLWithString:@"https://instapaper.com/api/"]
#define kInstapaperAPIAuthenticationURL [NSURL URLWithString:[[kInstapaperAPIRootURL absoluteString] stringByAppendingString:@"authenticate"]]
#define kInstapaperAPIAddItemURL [NSURL URLWithString:[[kInstapaperAPIRootURL absoluteString] stringByAppendingString:@"add"]]
|
//
// InstapaperAPI.h
// newsyc
//
// Created by Grant Paul on 3/10/11.
// Copyright 2011 Xuzz Productions, LLC. All rights reserved.
//
#import <HNKit/NSString+URLEncoding.h>
#define kInstapaperAPIRootURL [NSURL URLWithString:@"https://www.instapaper.com/api/"]
#define kInstapaperAPIAuthenticationURL [NSURL URLWithString:[[kInstapaperAPIRootURL absoluteString] stringByAppendingString:@"authenticate"]]
#define kInstapaperAPIAddItemURL [NSURL URLWithString:[[kInstapaperAPIRootURL absoluteString] stringByAppendingString:@"add"]]
|
Fix Instapaper Root API issue
|
Fix Instapaper Root API issue
Fixed issue that was causing login request to return a 403.
|
C
|
bsd-3-clause
|
ukkari/newsyc,tangqiaoboy/newsyc,ukkari/newsyc
|
c2ed6a161b3242ff1f1222134fae6621e813362c
|
src/cons.h
|
src/cons.h
|
#ifndef MCLISP_CONS_H_
#define MCLISP_CONS_H_
namespace mclisp
{
class ConsCell
{
public:
ConsCell(): car_(nullptr), cdr_(nullptr) {}
ConsCell(ConsCell* car, ConsCell* cdr): car_(car), cdr_(cdr) {}
private:
ConsCell* car_;
ConsCell* cdr_;
};
} // namespace mclisp
#endif // MCLISP_CONS_H_
|
#ifndef MCLISP_CONS_H_
#define MCLISP_CONS_H_
namespace mclisp
{
class ConsCell
{
public:
ConsCell(): car_(nullptr), cdr_(nullptr) {}
ConsCell(ConsCell* car, ConsCell* cdr): car_(car), cdr_(cdr) {}
ConsCell* car_;
ConsCell* cdr_;
};
} // namespace mclisp
#endif // MCLISP_CONS_H_
|
Make Cons::car_ and Cons::cdr_ public members.
|
Make Cons::car_ and Cons::cdr_ public members.
|
C
|
mit
|
appleby/mccarthy-lisp,appleby/mccarthy-lisp,appleby/mccarthy-lisp,appleby/mccarthy-lisp,appleby/mccarthy-lisp
|
be81aa72665eaa6f2e4c84bbb7eab165dd918ad8
|
src/os/emscripten/preamble.c
|
src/os/emscripten/preamble.c
|
#include "emscripten.h"
#include <stdlib.h>
#include <unistd.h>
#include "param.h"
int os_preamble()
{
if (access("/dev/zero", R_OK))
EM_ASM(({ FS.createDevice('/dev', 'zero', function () { return 0; }); }),/* dummy arg */0);
EM_ASM_(({
if (ENVIRONMENT_IS_NODE) {
var mnt = Pointer_stringify($0);
FS.mkdir(mnt);
FS.mount(NODEFS, { root: '/' }, mnt);
FS.chdir(mnt + process.cwd());
}
}), MOUNT_POINT);
return 0;
}
|
#include "emscripten.h"
#include <stdlib.h>
#include <unistd.h>
#include "param.h"
int os_preamble()
{
if (access("/dev/zero", R_OK))
EM_ASM(({ FS.createDevice('/dev', 'zero', function () { return 0; }); }),/* dummy arg */0);
EM_ASM_(({
if (ENVIRONMENT_IS_NODE) {
var len = 1024; /* arbitrary */
var mnt = UTF8ToString($0, len);
FS.mkdir(mnt);
FS.mount(NODEFS, { root: '/' }, mnt);
FS.chdir(mnt + process.cwd());
}
}), MOUNT_POINT);
return 0;
}
|
Replace removed Pointer_stringify with UTF8ToString
|
Replace removed Pointer_stringify with UTF8ToString
|
C
|
mit
|
kulp/tenyr,kulp/tenyr,kulp/tenyr
|
3d895b974d01f2c562a869921274f1198e29ff87
|
test/FrontendC/2010-06-24-DbgInlinedFnParameter.c
|
test/FrontendC/2010-06-24-DbgInlinedFnParameter.c
|
// RUN: %llvmgcc -S -O2 -g %s -o - | llc -O2 -o %t.s
// RUN: grep "# DW_TAG_formal_parameter" %t.s | count 4
// Radar 8122864
// XFAIL: powerpc
static int foo(int a, int j) {
int k = 0;
if (a)
k = a + j;
else
k = j;
return k;
}
int bar(int o, int p) {
return foo(o, p);
}
|
// RUN: %llvmgcc -S -O2 -g %s -o - | llc -O2 -o %t.s
// RUN: grep "# DW_TAG_formal_parameter" %t.s | count 4
// Radar 8122864
// XTARGET: x86,darwin
static int foo(int a, int j) {
int k = 0;
if (a)
k = a + j;
else
k = j;
return k;
}
int bar(int o, int p) {
return foo(o, p);
}
|
Make this test darwin specific.
|
Make this test darwin specific.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@107025 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm
|
23b1acc06565d92692ce2e56ed7ede7b45c1e3a1
|
iobuf/obuf_copyfromfd.c
|
iobuf/obuf_copyfromfd.c
|
#include <unistd.h>
#include "iobuf.h"
/** Copy all the data from an \c ibuf to an \c obuf. */
int obuf_copyfromfd(int in, obuf* out)
{
long rd;
if (obuf_error(out)) return 0;
out->count = 0;
for (;;) {
if ((rd = read(in,
out->io.buffer + out->bufpos,
out->io.bufsize - out->bufpos)) == -1)
return 0;
if (rd == 0)
break;
out->count += rd;
if (!obuf_flush(out))
return 0;
}
return 1;
}
|
#include <unistd.h>
#include "iobuf.h"
/** Copy all the data from an \c ibuf to an \c obuf. */
int obuf_copyfromfd(int in, obuf* out)
{
long rd;
if (obuf_error(out)) return 0;
out->count = 0;
for (;;) {
if ((rd = read(in,
out->io.buffer + out->bufpos,
out->io.bufsize - out->bufpos)) == -1)
return 0;
if (rd == 0)
break;
out->bufpos += rd;
if (out->io.buflen < out->bufpos)
out->io.buflen = out->bufpos;
if (!obuf_flush(out))
return 0;
out->count += rd;
}
return 1;
}
|
Mark the copied-in data as being present before flushing the buffer. Without this patch, no data is ever written.
|
Mark the copied-in data as being present before flushing the buffer.
Without this patch, no data is ever written.
|
C
|
lgpl-2.1
|
bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs
|
0cbe606c96c439637b2468663f1b74891c917ee3
|
test/test_parser_and.c
|
test/test_parser_and.c
|
#include "test_parser.h"
void and_false(void **state) {
grammar_t *grammar = grammar_init(
non_terminal("And"),
rule_init(
"And",
sequence(
and(terminal("hello")),
terminal("h")
)
), 1
);
parse_t *result = parse("help", grammar);
assert_null(result);
}
void and_true(void **state) {
grammar_t *grammar = grammar_init(
non_terminal("And"),
rule_init(
"And",
sequence(
and(terminal("hello")),
terminal("h")
)
), 1
);
parse_t *result = parse("hello", grammar);
assert_non_null(result);
assert_int_equal(result->length, 1);
assert_int_equal(result->n_children, 1);
assert_int_equal(result->children[0].length, 1);
assert_int_equal(result->children[0].n_children, 0);
}
|
#include "test_parser.h"
void and_false(void **state) {
grammar_t *grammar = grammar_init(
non_terminal("And"),
rule_init(
"And",
sequence(
and(terminal("hello")),
terminal("h")
)
), 1
);
parse_result_t *result = parse("help", grammar);
assert_non_null(result);
assert_true(is_error(result));
}
void and_true(void **state) {
grammar_t *grammar = grammar_init(
non_terminal("And"),
rule_init(
"And",
sequence(
and(terminal("hello")),
terminal("h")
)
), 1
);
parse_result_t *result = parse("hello", grammar);
assert_non_null(result);
assert_true(is_success(result));
parse_t *suc = result->data.result;
assert_int_equal(suc->length, 1);
assert_int_equal(suc->n_children, 1);
assert_int_equal(suc->children[0].length, 1);
assert_int_equal(suc->children[0].n_children, 0);
}
|
Use new API for and parsing
|
Use new API for and parsing
|
C
|
mit
|
Baltoli/peggo,Baltoli/peggo
|
dd059c831429f6d3706ff8e824cb3afcde383d37
|
check/tests/check_check_main.c
|
check/tests/check_check_main.c
|
#include <stdlib.h>
#include <stdio.h>
#include <check.h>
#include "check_check.h"
int main (void)
{
int n;
SRunner *sr;
fork_setup();
setup_fixture();
sr = srunner_create (make_master_suite());
srunner_add_suite(sr, make_list_suite());
srunner_add_suite(sr, make_msg_suite());
srunner_add_suite(sr, make_log_suite());
srunner_add_suite(sr, make_limit_suite());
srunner_add_suite(sr, make_fork_suite());
srunner_add_suite(sr, make_fixture_suite());
srunner_add_suite(sr, make_pack_suite());
setup();
printf ("Ran %d tests in subordinate suite\n", sub_nfailed);
srunner_run_all (sr, CK_NORMAL);
cleanup();
fork_teardown();
teardown_fixture();
n = srunner_ntests_failed(sr);
srunner_free(sr);
return (n == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
|
#include <stdlib.h>
#include <stdio.h>
#include <check.h>
#include "check_check.h"
int main (void)
{
int n;
SRunner *sr;
fork_setup();
setup_fixture();
sr = srunner_create (make_master_suite());
srunner_add_suite(sr, make_list_suite());
srunner_add_suite(sr, make_msg_suite());
srunner_add_suite(sr, make_log_suite());
srunner_add_suite(sr, make_limit_suite());
srunner_add_suite(sr, make_fork_suite());
srunner_add_suite(sr, make_fixture_suite());
srunner_add_suite(sr, make_pack_suite());
setup();
printf ("Ran %d tests in subordinate suite\n", sub_ntests);
srunner_run_all (sr, CK_NORMAL);
cleanup();
fork_teardown();
teardown_fixture();
n = srunner_ntests_failed(sr);
srunner_free(sr);
return (n == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
|
Use correct variable for number of tests
|
Use correct variable for number of tests
|
C
|
lgpl-2.1
|
tarruda/check,tarruda/check,tarruda/check,tarruda/check,tarruda/check
|
461bf4f7c74b56d5944aab9b886ff30a50019e0e
|
check/tests/check_check_main.c
|
check/tests/check_check_main.c
|
#include <stdlib.h>
#include <stdio.h>
#include <check.h>
#include "check_check.h"
int main (void)
{
int n;
SRunner *sr;
fork_setup();
setup_fixture();
sr = srunner_create (make_master_suite());
srunner_add_suite(sr, make_list_suite());
srunner_add_suite(sr, make_msg_suite());
srunner_add_suite(sr, make_log_suite());
srunner_add_suite(sr, make_limit_suite());
srunner_add_suite(sr, make_fork_suite());
srunner_add_suite(sr, make_fixture_suite());
srunner_add_suite(sr, make_pack_suite());
setup();
printf ("Ran %d tests in subordinate suite\n", sub_nfailed);
srunner_run_all (sr, CK_NORMAL);
cleanup();
fork_teardown();
teardown_fixture();
n = srunner_ntests_failed(sr);
srunner_free(sr);
return (n == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
|
#include <stdlib.h>
#include <stdio.h>
#include <check.h>
#include "check_check.h"
int main (void)
{
int n;
SRunner *sr;
fork_setup();
setup_fixture();
sr = srunner_create (make_master_suite());
srunner_add_suite(sr, make_list_suite());
srunner_add_suite(sr, make_msg_suite());
srunner_add_suite(sr, make_log_suite());
srunner_add_suite(sr, make_limit_suite());
srunner_add_suite(sr, make_fork_suite());
srunner_add_suite(sr, make_fixture_suite());
srunner_add_suite(sr, make_pack_suite());
setup();
printf ("Ran %d tests in subordinate suite\n", sub_ntests);
srunner_run_all (sr, CK_NORMAL);
cleanup();
fork_teardown();
teardown_fixture();
n = srunner_ntests_failed(sr);
srunner_free(sr);
return (n == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
|
Use correct variable for number of tests
|
Use correct variable for number of tests
git-svn-id: d023f1085a36f7a677188d00334e37d38ffecf51@230 64e312b2-a51f-0410-8e61-82d0ca0eb02a
|
C
|
lgpl-2.1
|
libcheck/check,9fcc/check,krichter722/check,brarcher/check,brarcher/check,9fcc/check,krichter722/check,9fcc/check,libcheck/check,libcheck/check,krichter722/check,brarcher/check,brarcher/check,9fcc/check,libcheck/check,9fcc/check,libcheck/check,brarcher/check,krichter722/check,krichter722/check
|
0200f506b06b8fce7ae6872910915f1e40ccf1b7
|
framework/include/base/ComputeInitialConditionThread.h
|
framework/include/base/ComputeInitialConditionThread.h
|
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/
#ifndef COMPUTEREINITIALCONDITIONTHREAD_H
#define COMPUTEREINITIALCONDITIONTHREAD_H
#include "ParallelUniqueId.h"
// libmesh
#include "libmesh/elem_range.h"
class FEProblemBase;
class ComputeInitialConditionThread
{
public:
ComputeInitialConditionThread(FEProblemBase & fe_problem);
// Splitting Constructor
ComputeInitialConditionThread(ComputeInitialConditionThread & x, Threads::split split);
void operator() (const ConstElemRange & range);
void join(const ComputeInitialConditionThread & /*y*/);
protected:
FEProblemBase & _fe_problem;
THREAD_ID _tid;
};
#endif //COMPUTEINITIALCONDITIONTHREAD_H
|
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/
#ifndef COMPUTEREINITIALCONDITIONTHREAD_H
#define COMPUTEREINITIALCONDITIONTHREAD_H
#include "MooseTypes.h"
// libmesh
#include "libmesh/elem_range.h"
#include "libmesh/threads.h"
class FEProblemBase;
class ComputeInitialConditionThread
{
public:
ComputeInitialConditionThread(FEProblemBase & fe_problem);
// Splitting Constructor
ComputeInitialConditionThread(ComputeInitialConditionThread & x, Threads::split split);
void operator() (const ConstElemRange & range);
void join(const ComputeInitialConditionThread & /*y*/);
protected:
FEProblemBase & _fe_problem;
THREAD_ID _tid;
};
#endif //COMPUTEINITIALCONDITIONTHREAD_H
|
Include headers we need directly
|
Include headers we need directly
|
C
|
lgpl-2.1
|
backmari/moose,bwspenc/moose,permcody/moose,idaholab/moose,nuclear-wizard/moose,backmari/moose,idaholab/moose,liuwenf/moose,permcody/moose,jessecarterMOOSE/moose,liuwenf/moose,SudiptaBiswas/moose,sapitts/moose,laagesen/moose,andrsd/moose,dschwen/moose,bwspenc/moose,harterj/moose,sapitts/moose,andrsd/moose,liuwenf/moose,lindsayad/moose,idaholab/moose,idaholab/moose,andrsd/moose,harterj/moose,YaqiWang/moose,milljm/moose,sapitts/moose,nuclear-wizard/moose,lindsayad/moose,lindsayad/moose,idaholab/moose,SudiptaBiswas/moose,bwspenc/moose,sapitts/moose,milljm/moose,milljm/moose,jessecarterMOOSE/moose,Chuban/moose,backmari/moose,friedmud/moose,lindsayad/moose,laagesen/moose,laagesen/moose,andrsd/moose,nuclear-wizard/moose,dschwen/moose,permcody/moose,SudiptaBiswas/moose,lindsayad/moose,Chuban/moose,YaqiWang/moose,liuwenf/moose,harterj/moose,dschwen/moose,harterj/moose,friedmud/moose,sapitts/moose,jessecarterMOOSE/moose,milljm/moose,liuwenf/moose,laagesen/moose,yipenggao/moose,bwspenc/moose,YaqiWang/moose,Chuban/moose,permcody/moose,jessecarterMOOSE/moose,harterj/moose,yipenggao/moose,friedmud/moose,SudiptaBiswas/moose,milljm/moose,liuwenf/moose,laagesen/moose,dschwen/moose,nuclear-wizard/moose,andrsd/moose,jessecarterMOOSE/moose,yipenggao/moose,bwspenc/moose,SudiptaBiswas/moose,backmari/moose,Chuban/moose,friedmud/moose,dschwen/moose,yipenggao/moose,YaqiWang/moose
|
f53d9f6cd370743d00f9d9a882941ff84d4bfb54
|
LogDefer.h
|
LogDefer.h
|
#ifndef LOGDEFER_H
#define LOGDEFER_H
#include "picojson/picojson.h"
class LogDefer {
public:
LogDefer(std::function<void (const std::string&)> callback);
~LogDefer();
void add_log(int verbosity, std::string msg);
void error(std::string msg);
void warn(std::string msg);
void info(std::string msg);
void debug(std::string msg);
private:
std::function<void (const std::string &)> callback_;
struct timeval start_tv_;
picojson::object o_;
picojson::array logs_;
picojson::array timers_;
};
#endif
|
#pragma once
#include "picojson/picojson.h"
class LogDefer {
public:
LogDefer(std::function<void (const std::string&)> callback);
~LogDefer();
void add_log(int verbosity, std::string msg);
void error(std::string msg);
void warn(std::string msg);
void info(std::string msg);
void debug(std::string msg);
private:
std::function<void (const std::string &)> callback_;
struct timeval start_tv_;
picojson::object o_;
picojson::array logs_;
picojson::array timers_;
};
|
Use pragma once instead of define hack (thanks Natalia)
|
Use pragma once instead of define hack (thanks Natalia)
|
C
|
bsd-2-clause
|
hoytech/LogDefer-CXX
|
55130b9862bc2aab6a5498b3198fbdcf1c26acc2
|
include/vl6180_pi.h
|
include/vl6180_pi.h
|
#ifdef __cplusplus
extern "C"{
#endif
typedef int vl6180;
#define VL1680_DEFALUT_ADDR 0x29
int vl6180_initialise(int device, int i2cAddr);
int get_distance(vl6180 handle);
void set_scaling(vl6180 handle, int scaling);
///After calling that, you should discrad the handle to talk to the device and re-initialize it
void vl6180_change_addr(vl6180 handle, int newAddr);
//hack:add access to lower_level functions
int read_byte(vl6180 handle, int reg);
void write_byte(vl6180 handle, int reg, char data);
void write_two_bytes(vl6180 handle, int reg, int data);
#ifdef __cplusplus
}
#endif
|
#ifdef __cplusplus
extern "C"{
#endif
typedef int vl6180;
#define VL1680_DEFALUT_ADDR 0x29
///Initialize a vl6180 sensor on the i2c port
/// \param device The I2C bus to open. e.g. "1" for using /dev/i2c-1
/// \param i2c_addr addres of the device. If you don't know, pass VL1680_DEFALUT_ADDR to it
/// \return handle to the sensor. Keep this variable to talk to the sensor via the library
vl6180 vl6180_initialise(int device, int i2c_addr);
///Change the address of the device. Needed if you have an address conflict (for example: using two of theses sensors on the same design). The handle will also be updated
/// \param handle The handle to the sensor given by vl6180_initialise
/// \param new_addr The new address to use on the i2c bus for this device
void vl6180_change_addr(vl6180 handle, int new_addr);
//TODO some of theses functions doesn't have the vl6180 prefix. udpate them to avoid name clashing
///Return the current distance as readed by the sensor
/// \param handle The handle to the sensor given by vl6180_initialise
/// \return distance in milimeter as an integer
int get_distance(vl6180 handle);
///Set the scalinb mode (read datasheet to seee about the max range vs. precision deal on this sensor)
/// \param handle The handle to the sensor given by vl6180_initialise
/// \param scaling Index of the scaling mode to use
void set_scaling(vl6180 handle, int scaling);
//hack:add access to lower_level functions
int read_byte(vl6180 handle, int reg);
void write_byte(vl6180 handle, int reg, char data);
void write_two_bytes(vl6180 handle, int reg, int data);
#ifdef __cplusplus
}
#endif
|
Comment the file "doxygen style"
|
Comment the file "doxygen style"
|
C
|
mit
|
leachj/vl6180_pi
|
4a1ecb67f9ff1745422aecdd5cc70a9f630d7dc8
|
driver/battery/bq20z453.c
|
driver/battery/bq20z453.c
|
/* Copyright (c) 2012 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.
*
* Smart battery driver for BQ20Z453.
*/
#include "battery_smart.h"
#include "host_command.h"
#define PARAM_CUT_OFF 0x0010
int battery_command_cut_off(struct host_cmd_handler_args *args)
{
/*
* TODO: Since this is a host command, the i2c bus is claimed by host.
* Thus, we would send back the response in advanced so that
* the host can release the bus and then EC can send command to
* battery.
*
* Refactoring this via task is a way. However, it is wasteful.
* Need a light-weight solution.
*/
args->result = EC_RES_SUCCESS;
host_send_response(args);
/* This function would try to claim i2c and then send to battery. */
sb_write(SB_MANUFACTURER_ACCESS, PARAM_CUT_OFF);
return EC_RES_SUCCESS;
/*
* Not sure if there is a side-effect since this could send result
* back to host TWICE.
*/
}
DECLARE_HOST_COMMAND(EC_CMD_BATTERY_CUT_OFF, battery_command_cut_off,
EC_VER_MASK(0));
|
/* Copyright (c) 2012 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.
*
* Smart battery driver for BQ20Z453.
*/
#include "battery_smart.h"
#include "hooks.h"
#include "host_command.h"
#define PARAM_CUT_OFF 0x0010
static void cutoff(void)
{
/* Claim i2c and send cutoff command to battery. */
sb_write(SB_MANUFACTURER_ACCESS, PARAM_CUT_OFF);
}
DECLARE_DEFERRED(cutoff);
int battery_command_cut_off(struct host_cmd_handler_args *args)
{
/*
* Queue battery cutoff. This must be deferred so we can send the
* response to the host first. Some platforms (snow) share an I2C bus
* between the EC, AP, and battery, so we need the host to complete the
* transaction and release the I2C bus before we'll be abl eto send the
* cutoff command.
*/
hook_call_deferred(cutoff, 1000);
return EC_RES_SUCCESS;
}
DECLARE_HOST_COMMAND(EC_CMD_BATTERY_CUT_OFF, battery_command_cut_off,
EC_VER_MASK(0));
|
Fix battery cutoff command to use deferred function call
|
pit: Fix battery cutoff command to use deferred function call
Rather than hackily sending a host response before sending the battery
cutoff command, just put the cutoff command in a deferred function
call and respond normally to the host command.
BUG=chrome-os-partner:23568
BRANCH=none
TEST=On battery power, 'ectool batterycutoff' prints success, then the
system loses power due to battery cutoff.
Change-Id: Ic42d08ef94a10f89d093290cda63da01fca985a5
Signed-off-by: Randall Spangler <62698fdbb84d1779579ee80c3f39fac22017e5bc@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174573
Reviewed-by: Bill Richardson <129945214b1d548d8e49b6c29c43094f8c78057f@chromium.org>
|
C
|
bsd-3-clause
|
mtk09422/chromiumos-platform-ec,longsleep/ec,gelraen/cros-ec,akappy7/ChromeOS_EC_LED_Diagnostics,alterapraxisptyltd/chromium-ec,akappy7/ChromeOS_EC_LED_Diagnostics,mtk09422/chromiumos-platform-ec,coreboot/chrome-ec,coreboot/chrome-ec,fourier49/BIZ_EC,md5555/ec,md5555/ec,thehobn/ec,fourier49/BIZ_EC,thehobn/ec,fourier49/BIZ_EC,alterapraxisptyltd/chromium-ec,alterapraxisptyltd/chromium-ec,akappy7/ChromeOS_EC_LED_Diagnostics,fourier49/BZ_DEV_EC,md5555/ec,akappy7/ChromeOS_EC_LED_Diagnostics,gelraen/cros-ec,fourier49/BZ_DEV_EC,mtk09422/chromiumos-platform-ec,eatbyte/chromium-ec,akappy7/ChromeOS_EC_LED_Diagnostics,coreboot/chrome-ec,coreboot/chrome-ec,thehobn/ec,coreboot/chrome-ec,eatbyte/chromium-ec,eatbyte/chromium-ec,fourier49/BZ_DEV_EC,longsleep/ec,thehobn/ec,alterapraxisptyltd/chromium-ec,fourier49/BIZ_EC,fourier49/BZ_DEV_EC,md5555/ec,longsleep/ec,eatbyte/chromium-ec,coreboot/chrome-ec,mtk09422/chromiumos-platform-ec,longsleep/ec,gelraen/cros-ec,gelraen/cros-ec
|
05a2b367b649928bee66e8acbe2d8ef3440d36a9
|
libc/include/sys/io.h
|
libc/include/sys/io.h
|
#ifndef _SYS_IO_H
#define _SYS_IO_H
#include <stdint.h>
unsigned char inb(uint16_t port);
void outb(uint16_t port, uint8_t value);
#endif
|
#ifndef _SYS_IO_H
#define _SYS_IO_H
#include <stdint.h>
uint8_t inb(uint16_t port);
void outb(uint16_t port, uint8_t value);
uint16_t inw(uint16_t port);
void outw(uint16_t port, uint16_t value);
uint32_t inl(uint16_t port);
void outl(uint16_t port, uint32_t value);
#endif
|
Add everything to header file
|
Add everything to header file
|
C
|
mit
|
simon-andrews/norby,simon-andrews/norby,simon-andrews/norby
|
12941ad2f700f9a2ca22057a099b1152fc86be74
|
critmem.h
|
critmem.h
|
#ifndef CRITMEM_H
#define CRITMEM_H
#include <sys/types.h>
void *mycritmalloc(const char *f, long, size_t size, const char *message);
void *mycritcalloc(const char *f, long, size_t size, const char *message);
void *mycritrealloc(const char *f, long, void *a, size_t size,
const char *message);
char *mycritstrdup(const char *f, long, const char *, const char *message);
#define critmalloc(a,b) mycritmalloc(__FILE__,__LINE__,a,b)
#define critcalloc(a,b) mycritcalloc(__FILE__,__LINE__,a,b)
#define critrealloc(a,b,c) mycritrealloc(__FILE__,__LINE__,a,b,c)
#define critstrdup(a,b) mycritstrdup(__FILE__,__LINE__,a,b)
#endif
|
#ifndef CRITMEM_H
#define CRITMEM_H
#include <sys/types.h>
/*@only@*//*@out@ */ void *mycritmalloc(const char *f, long, size_t size,
const char *message);
/*@only@*/ void *mycritcalloc(const char *f, long, size_t size,
const char *message);
/*@only@*//*@out@ *//*@notnull@ */ void *mycritrealloc(const char *f, long,
/*@null@ *//*@only@ *//*@out@ *//*@returned@ */
void *a, size_t size,
const char *message);
/*@only@*/ char *mycritstrdup(const char *f, long, const char *,
const char *message);
#define critmalloc(a,b) mycritmalloc(__FILE__,(long)__LINE__,a,b)
#define critcalloc(a,b) mycritcalloc(__FILE__,(long)__LINE__,a,b)
#define critrealloc(a,b,c) mycritrealloc(__FILE__,(long)__LINE__,a,b,c)
#define critstrdup(a,b) mycritstrdup(__FILE__,(long)__LINE__,a,b)
#endif
|
Include Ralf Wildenhues' lclint annotations.
|
Include Ralf Wildenhues' lclint annotations.
|
C
|
lgpl-2.1
|
BackupTheBerlios/leafnode,BackupTheBerlios/leafnode,BackupTheBerlios/leafnode,BackupTheBerlios/leafnode
|
4d4fb33fce0803f9c923307bdf82b8fdd2ed140b
|
src/reverse_iterator.h
|
src/reverse_iterator.h
|
// Taken from https://gist.github.com/arvidsson/7231973
#ifndef BITCOIN_REVERSE_ITERATOR_HPP
#define BITCOIN_REVERSE_ITERATOR_HPP
/**
* Template used for reverse iteration in C++11 range-based for loops.
*
* std::vector<int> v = {1, 2, 3, 4, 5};
* for (auto x : reverse_iterate(v))
* std::cout << x << " ";
*/
template <typename T>
class reverse_range
{
T &x;
public:
reverse_range(T &x) : x(x) {}
auto begin() const -> decltype(this->x.rbegin())
{
return x.rbegin();
}
auto end() const -> decltype(this->x.rend())
{
return x.rend();
}
};
template <typename T>
reverse_range<T> reverse_iterate(T &x)
{
return reverse_range<T>(x);
}
#endif // BITCOIN_REVERSE_ITERATOR_HPP
|
// Taken from https://gist.github.com/arvidsson/7231973
#ifndef BITCOIN_REVERSE_ITERATOR_H
#define BITCOIN_REVERSE_ITERATOR_H
/**
* Template used for reverse iteration in C++11 range-based for loops.
*
* std::vector<int> v = {1, 2, 3, 4, 5};
* for (auto x : reverse_iterate(v))
* std::cout << x << " ";
*/
template <typename T>
class reverse_range
{
T &m_x;
public:
reverse_range(T &x) : m_x(x) {}
auto begin() const -> decltype(this->m_x.rbegin())
{
return m_x.rbegin();
}
auto end() const -> decltype(this->m_x.rend())
{
return m_x.rend();
}
};
template <typename T>
reverse_range<T> reverse_iterate(T &x)
{
return reverse_range<T>(x);
}
#endif // BITCOIN_REVERSE_ITERATOR_H
|
Rename member field according to the style guide.
|
Rename member field according to the style guide.
|
C
|
mit
|
guncoin/guncoin,ahmedbodi/vertcoin,anditto/bitcoin,deeponion/deeponion,shelvenzhou/BTCGPU,OmniLayer/omnicore,prusnak/bitcoin,jambolo/bitcoin,practicalswift/bitcoin,Kogser/bitcoin,jtimon/bitcoin,trippysalmon/bitcoin,myriadteam/myriadcoin,stamhe/bitcoin,namecoin/namecoin-core,Exgibichi/statusquo,AkioNak/bitcoin,BitzenyCoreDevelopers/bitzeny,ElementsProject/elements,starwels/starwels,lateminer/bitcoin,fanquake/bitcoin,maaku/bitcoin,TheBlueMatt/bitcoin,MeshCollider/bitcoin,domob1812/huntercore,rnicoll/bitcoin,ajtowns/bitcoin,r8921039/bitcoin,randy-waterhouse/bitcoin,jmcorgan/bitcoin,Kogser/bitcoin,domob1812/huntercore,CryptArc/bitcoin,particl/particl-core,mitchellcash/bitcoin,nikkitan/bitcoin,digibyte/digibyte,thrasher-/litecoin,laudaa/bitcoin,jamesob/bitcoin,StarbuckBG/BTCGPU,sebrandon1/bitcoin,Gazer022/bitcoin,lbryio/lbrycrd,donaloconnor/bitcoin,lateminer/bitcoin,GroestlCoin/bitcoin,h4x3rotab/BTCGPU,paveljanik/bitcoin,shelvenzhou/BTCGPU,myriadteam/myriadcoin,untrustbank/litecoin,rawodb/bitcoin,ericshawlinux/bitcoin,qtumproject/qtum,pstratem/bitcoin,laudaa/bitcoin,ericshawlinux/bitcoin,untrustbank/litecoin,StarbuckBG/BTCGPU,romanornr/viacoin,GroestlCoin/bitcoin,kallewoof/bitcoin,deeponion/deeponion,stamhe/bitcoin,myriadcoin/myriadcoin,instagibbs/bitcoin,Exgibichi/statusquo,destenson/bitcoin--bitcoin,brandonrobertz/namecoin-core,mb300sd/bitcoin,romanornr/viacoin,Jcing95/iop-hd,stamhe/bitcoin,vertcoin/vertcoin,practicalswift/bitcoin,tjps/bitcoin,randy-waterhouse/bitcoin,gmaxwell/bitcoin,particl/particl-core,vmp32k/litecoin,sipsorcery/bitcoin,kazcw/bitcoin,bitcoin/bitcoin,practicalswift/bitcoin,stamhe/bitcoin,jlopp/statoshi,1185/starwels,myriadteam/myriadcoin,h4x3rotab/BTCGPU,cryptoprojects/ultimateonlinecash,vertcoin/vertcoin,r8921039/bitcoin,domob1812/namecore,achow101/bitcoin,alecalve/bitcoin,fujicoin/fujicoin,Xekyo/bitcoin,jlopp/statoshi,namecoin/namecore,cdecker/bitcoin,x-kalux/bitcoin_WiG-B,MazaCoin/maza,jnewbery/bitcoin,brandonrobertz/namecoin-core,monacoinproject/monacoin,instagibbs/bitcoin,bitcoinknots/bitcoin,Chancoin-core/CHANCOIN,GroestlCoin/GroestlCoin,brandonrobertz/namecoin-core,wellenreiter01/Feathercoin,kallewoof/bitcoin,randy-waterhouse/bitcoin,n1bor/bitcoin,romanornr/viacoin,aspanta/bitcoin,lateminer/bitcoin,AkioNak/bitcoin,ElementsProject/elements,myriadteam/myriadcoin,JeremyRubin/bitcoin,ahmedbodi/vertcoin,pataquets/namecoin-core,myriadcoin/myriadcoin,TheBlueMatt/bitcoin,MarcoFalke/bitcoin,sebrandon1/bitcoin,Christewart/bitcoin,OmniLayer/omnicore,jonasschnelli/bitcoin,sipsorcery/bitcoin,wellenreiter01/Feathercoin,JeremyRubin/bitcoin,RHavar/bitcoin,MazaCoin/maza,Gazer022/bitcoin,namecoin/namecoin-core,instagibbs/bitcoin,jnewbery/bitcoin,Anfauglith/iop-hd,jtimon/bitcoin,Jcing95/iop-hd,Rav3nPL/bitcoin,Bushstar/UFO-Project,MazaCoin/maza,vertcoin/vertcoin,digibyte/digibyte,simonmulser/bitcoin,nbenoit/bitcoin,sarielsaz/sarielsaz,rnicoll/bitcoin,wangxinxi/litecoin,destenson/bitcoin--bitcoin,digibyte/digibyte,kallewoof/bitcoin,kallewoof/bitcoin,Anfauglith/iop-hd,Anfauglith/iop-hd,JeremyRubin/bitcoin,ryanofsky/bitcoin,jambolo/bitcoin,untrustbank/litecoin,pstratem/bitcoin,simonmulser/bitcoin,andreaskern/bitcoin,Chancoin-core/CHANCOIN,dscotese/bitcoin,h4x3rotab/BTCGPU,bitcoinknots/bitcoin,UFOCoins/ufo,afk11/bitcoin,jambolo/bitcoin,droark/bitcoin,MeshCollider/bitcoin,Kogser/bitcoin,apoelstra/bitcoin,ericshawlinux/bitcoin,donaloconnor/bitcoin,Theshadow4all/ShadowCoin,RHavar/bitcoin,lbryio/lbrycrd,Exgibichi/statusquo,donaloconnor/bitcoin,mm-s/bitcoin,DigitalPandacoin/pandacoin,TheBlueMatt/bitcoin,romanornr/viacoin,Rav3nPL/bitcoin,prusnak/bitcoin,Chancoin-core/CHANCOIN,stamhe/bitcoin,alecalve/bitcoin,ericshawlinux/bitcoin,gjhiggins/vcoincore,gjhiggins/vcoincore,EthanHeilman/bitcoin,AkioNak/bitcoin,Friedbaumer/litecoin,h4x3rotab/BTCGPU,mitchellcash/bitcoin,nbenoit/bitcoin,Kogser/bitcoin,cdecker/bitcoin,sarielsaz/sarielsaz,deeponion/deeponion,OmniLayer/omnicore,domob1812/bitcoin,wellenreiter01/Feathercoin,gjhiggins/vcoincore,dscotese/bitcoin,RHavar/bitcoin,1185/starwels,fujicoin/fujicoin,Theshadow4all/ShadowCoin,tecnovert/particl-core,EthanHeilman/bitcoin,myriadteam/myriadcoin,h4x3rotab/BTCGPU,litecoin-project/litecoin,Sjors/bitcoin,midnightmagic/bitcoin,RHavar/bitcoin,domob1812/huntercore,sarielsaz/sarielsaz,Jcing95/iop-hd,domob1812/huntercore,domob1812/bitcoin,tecnovert/particl-core,wangxinxi/litecoin,Friedbaumer/litecoin,deeponion/deeponion,21E14/bitcoin,lateminer/bitcoin,jtimon/bitcoin,romanornr/viacoin,domob1812/namecore,kevcooper/bitcoin,sebrandon1/bitcoin,qtumproject/qtum,n1bor/bitcoin,jtimon/bitcoin,mruddy/bitcoin,Theshadow4all/ShadowCoin,prusnak/bitcoin,Rav3nPL/bitcoin,spiritlinxl/BTCGPU,Sjors/bitcoin,bitcoin/bitcoin,lbryio/lbrycrd,tjps/bitcoin,rawodb/bitcoin,21E14/bitcoin,r8921039/bitcoin,Xekyo/bitcoin,qtumproject/qtum,jnewbery/bitcoin,vmp32k/litecoin,starwels/starwels,jmcorgan/bitcoin,afk11/bitcoin,fanquake/bitcoin,n1bor/bitcoin,monacoinproject/monacoin,brandonrobertz/namecoin-core,Chancoin-core/CHANCOIN,rnicoll/bitcoin,thrasher-/litecoin,Xekyo/bitcoin,maaku/bitcoin,prusnak/bitcoin,bespike/litecoin,1185/starwels,maaku/bitcoin,cryptoprojects/ultimateonlinecash,GlobalBoost/GlobalBoost,nikkitan/bitcoin,Bushstar/UFO-Project,fujicoin/fujicoin,mm-s/bitcoin,prusnak/bitcoin,BTCGPU/BTCGPU,OmniLayer/omnicore,lateminer/bitcoin,mm-s/bitcoin,ElementsProject/elements,destenson/bitcoin--bitcoin,bitcoinknots/bitcoin,sipsorcery/bitcoin,fujicoin/fujicoin,ppcoin/ppcoin,untrustbank/litecoin,sarielsaz/sarielsaz,jonasschnelli/bitcoin,AkioNak/bitcoin,ElementsProject/elements,FeatherCoin/Feathercoin,jonasschnelli/bitcoin,kazcw/bitcoin,globaltoken/globaltoken,randy-waterhouse/bitcoin,aspanta/bitcoin,gmaxwell/bitcoin,sarielsaz/sarielsaz,litecoin-project/litecoin,viacoin/viacoin,Kogser/bitcoin,practicalswift/bitcoin,joshrabinowitz/bitcoin,aspanta/bitcoin,mm-s/bitcoin,gmaxwell/bitcoin,joshrabinowitz/bitcoin,domob1812/namecore,wellenreiter01/Feathercoin,sstone/bitcoin,guncoin/guncoin,sstone/bitcoin,sebrandon1/bitcoin,guncoin/guncoin,kazcw/bitcoin,domob1812/huntercore,Jcing95/iop-hd,n1bor/bitcoin,FeatherCoin/Feathercoin,x-kalux/bitcoin_WiG-B,r8921039/bitcoin,GroestlCoin/GroestlCoin,alecalve/bitcoin,FeatherCoin/Feathercoin,peercoin/peercoin,AkioNak/bitcoin,Gazer022/bitcoin,bitcoinsSG/bitcoin,myriadcoin/myriadcoin,FeatherCoin/Feathercoin,yenliangl/bitcoin,GroestlCoin/GroestlCoin,midnightmagic/bitcoin,cryptoprojects/ultimateonlinecash,peercoin/peercoin,ppcoin/ppcoin,brandonrobertz/namecoin-core,qtumproject/qtum,Friedbaumer/litecoin,maaku/bitcoin,lbryio/lbrycrd,nikkitan/bitcoin,jlopp/statoshi,destenson/bitcoin--bitcoin,Rav3nPL/bitcoin,digibyte/digibyte,nikkitan/bitcoin,EthanHeilman/bitcoin,FeatherCoin/Feathercoin,deeponion/deeponion,Exgibichi/statusquo,GlobalBoost/GlobalBoost,jtimon/bitcoin,21E14/bitcoin,wellenreiter01/Feathercoin,viacoin/viacoin,gmaxwell/bitcoin,StarbuckBG/BTCGPU,EthanHeilman/bitcoin,vmp32k/litecoin,tjps/bitcoin,jamesob/bitcoin,kallewoof/bitcoin,donaloconnor/bitcoin,pataquets/namecoin-core,BTCGPU/BTCGPU,GlobalBoost/GlobalBoost,laudaa/bitcoin,apoelstra/bitcoin,GroestlCoin/GroestlCoin,jambolo/bitcoin,destenson/bitcoin--bitcoin,vmp32k/litecoin,namecoin/namecore,Gazer022/bitcoin,Flowdalic/bitcoin,bitcoinsSG/bitcoin,Anfauglith/iop-hd,domob1812/namecore,myriadcoin/myriadcoin,achow101/bitcoin,cdecker/bitcoin,gmaxwell/bitcoin,namecoin/namecoin-core,joshrabinowitz/bitcoin,mruddy/bitcoin,peercoin/peercoin,globaltoken/globaltoken,GroestlCoin/bitcoin,bitcoinsSG/bitcoin,rnicoll/dogecoin,ElementsProject/elements,spiritlinxl/BTCGPU,tjps/bitcoin,21E14/bitcoin,particl/particl-core,tecnovert/particl-core,jmcorgan/bitcoin,bitcoin/bitcoin,Rav3nPL/bitcoin,namecoin/namecore,rnicoll/bitcoin,ppcoin/ppcoin,rnicoll/bitcoin,deeponion/deeponion,myriadteam/myriadcoin,monacoinproject/monacoin,GroestlCoin/bitcoin,kevcooper/bitcoin,wangxinxi/litecoin,Chancoin-core/CHANCOIN,Kogser/bitcoin,mb300sd/bitcoin,Theshadow4all/ShadowCoin,apoelstra/bitcoin,qtumproject/qtum,mruddy/bitcoin,Xekyo/bitcoin,practicalswift/bitcoin,digibyte/digibyte,MeshCollider/bitcoin,MazaCoin/maza,laudaa/bitcoin,litecoin-project/litecoin,bespike/litecoin,andreaskern/bitcoin,gjhiggins/vcoincore,prusnak/bitcoin,MazaCoin/maza,bitcoinknots/bitcoin,myriadcoin/myriadcoin,Sjors/bitcoin,UFOCoins/ufo,apoelstra/bitcoin,simonmulser/bitcoin,romanornr/viacoin,CryptArc/bitcoin,bitbrazilcoin-project/bitbrazilcoin,1185/starwels,Friedbaumer/litecoin,droark/bitcoin,jonasschnelli/bitcoin,globaltoken/globaltoken,bitbrazilcoin-project/bitbrazilcoin,r8921039/bitcoin,andreaskern/bitcoin,MarcoFalke/bitcoin,thrasher-/litecoin,domob1812/huntercore,Christewart/bitcoin,Sjors/bitcoin,1185/starwels,kallewoof/bitcoin,achow101/bitcoin,nbenoit/bitcoin,TheBlueMatt/bitcoin,donaloconnor/bitcoin,achow101/bitcoin,sipsorcery/bitcoin,ericshawlinux/bitcoin,tecnovert/particl-core,x-kalux/bitcoin_WiG-B,fanquake/bitcoin,OmniLayer/omnicore,fanquake/bitcoin,rawodb/bitcoin,guncoin/guncoin,sebrandon1/bitcoin,starwels/starwels,bespike/litecoin,domob1812/namecore,Christewart/bitcoin,mruddy/bitcoin,bitcoinknots/bitcoin,ajtowns/bitcoin,anditto/bitcoin,myriadcoin/myriadcoin,dscotese/bitcoin,maaku/bitcoin,nbenoit/bitcoin,GlobalBoost/GlobalBoost,simonmulser/bitcoin,vertcoin/vertcoin,GroestlCoin/GroestlCoin,Theshadow4all/ShadowCoin,Anfauglith/iop-hd,namecoin/namecoin-core,sipsorcery/bitcoin,rnicoll/dogecoin,vertcoin/vertcoin,Chancoin-core/CHANCOIN,digibyte/digibyte,MazaCoin/maza,joshrabinowitz/bitcoin,UFOCoins/ufo,CryptArc/bitcoin,cryptoprojects/ultimateonlinecash,sstone/bitcoin,cdecker/bitcoin,Flowdalic/bitcoin,tecnovert/particl-core,sarielsaz/sarielsaz,Flowdalic/bitcoin,Friedbaumer/litecoin,Flowdalic/bitcoin,rnicoll/dogecoin,gjhiggins/vcoincore,wangxinxi/litecoin,jamesob/bitcoin,anditto/bitcoin,droark/bitcoin,viacoin/viacoin,AkioNak/bitcoin,midnightmagic/bitcoin,Flowdalic/bitcoin,shelvenzhou/BTCGPU,spiritlinxl/BTCGPU,RHavar/bitcoin,21E14/bitcoin,ajtowns/bitcoin,mruddy/bitcoin,domob1812/bitcoin,GlobalBoost/GlobalBoost,GroestlCoin/bitcoin,jmcorgan/bitcoin,yenliangl/bitcoin,andreaskern/bitcoin,afk11/bitcoin,kevcooper/bitcoin,nbenoit/bitcoin,randy-waterhouse/bitcoin,Sjors/bitcoin,MarcoFalke/bitcoin,paveljanik/bitcoin,spiritlinxl/BTCGPU,sstone/bitcoin,mb300sd/bitcoin,trippysalmon/bitcoin,lateminer/bitcoin,Flowdalic/bitcoin,tjps/bitcoin,n1bor/bitcoin,ahmedbodi/vertcoin,peercoin/peercoin,qtumproject/qtum,untrustbank/litecoin,DigitalPandacoin/pandacoin,apoelstra/bitcoin,rnicoll/dogecoin,gmaxwell/bitcoin,lbryio/lbrycrd,qtumproject/qtum,spiritlinxl/BTCGPU,FeatherCoin/Feathercoin,Friedbaumer/litecoin,mb300sd/bitcoin,guncoin/guncoin,particl/particl-core,dscotese/bitcoin,Xekyo/bitcoin,x-kalux/bitcoin_WiG-B,dscotese/bitcoin,litecoin-project/litecoin,mitchellcash/bitcoin,mb300sd/bitcoin,maaku/bitcoin,anditto/bitcoin,namecoin/namecore,MarcoFalke/bitcoin,yenliangl/bitcoin,afk11/bitcoin,Bushstar/UFO-Project,rnicoll/bitcoin,droark/bitcoin,TheBlueMatt/bitcoin,domob1812/bitcoin,litecoin-project/litecoin,aspanta/bitcoin,anditto/bitcoin,Exgibichi/statusquo,dscotese/bitcoin,StarbuckBG/BTCGPU,JeremyRubin/bitcoin,jlopp/statoshi,peercoin/peercoin,rawodb/bitcoin,BTCGPU/BTCGPU,jlopp/statoshi,CryptArc/bitcoin,DigitalPandacoin/pandacoin,pstratem/bitcoin,GroestlCoin/GroestlCoin,fujicoin/fujicoin,yenliangl/bitcoin,DigitalPandacoin/pandacoin,guncoin/guncoin,rawodb/bitcoin,instagibbs/bitcoin,nbenoit/bitcoin,wangxinxi/litecoin,simonmulser/bitcoin,lbryio/lbrycrd,trippysalmon/bitcoin,UFOCoins/ufo,CryptArc/bitcoin,gjhiggins/vcoincore,midnightmagic/bitcoin,BitzenyCoreDevelopers/bitzeny,domob1812/bitcoin,mitchellcash/bitcoin,MeshCollider/bitcoin,wellenreiter01/Feathercoin,cdecker/bitcoin,jambolo/bitcoin,midnightmagic/bitcoin,JeremyRubin/bitcoin,andreaskern/bitcoin,tecnovert/particl-core,21E14/bitcoin,donaloconnor/bitcoin,mm-s/bitcoin,nikkitan/bitcoin,BitzenyCoreDevelopers/bitzeny,namecoin/namecore,jmcorgan/bitcoin,ryanofsky/bitcoin,Jcing95/iop-hd,paveljanik/bitcoin,bitcoinsSG/bitcoin,droark/bitcoin,apoelstra/bitcoin,destenson/bitcoin--bitcoin,MeshCollider/bitcoin,globaltoken/globaltoken,paveljanik/bitcoin,bitbrazilcoin-project/bitbrazilcoin,jtimon/bitcoin,paveljanik/bitcoin,jnewbery/bitcoin,kazcw/bitcoin,Kogser/bitcoin,EthanHeilman/bitcoin,monacoinproject/monacoin,afk11/bitcoin,ahmedbodi/vertcoin,DigitalPandacoin/pandacoin,sipsorcery/bitcoin,alecalve/bitcoin,BTCGPU/BTCGPU,vertcoin/vertcoin,monacoinproject/monacoin,bitbrazilcoin-project/bitbrazilcoin,particl/particl-core,Jcing95/iop-hd,DigitalPandacoin/pandacoin,shelvenzhou/BTCGPU,Christewart/bitcoin,yenliangl/bitcoin,joshrabinowitz/bitcoin,cryptoprojects/ultimateonlinecash,CryptArc/bitcoin,fanquake/bitcoin,GlobalBoost/GlobalBoost,achow101/bitcoin,jamesob/bitcoin,droark/bitcoin,Bushstar/UFO-Project,jnewbery/bitcoin,viacoin/viacoin,pstratem/bitcoin,starwels/starwels,Kogser/bitcoin,bitcoinsSG/bitcoin,Christewart/bitcoin,Exgibichi/statusquo,BitzenyCoreDevelopers/bitzeny,h4x3rotab/BTCGPU,mb300sd/bitcoin,alecalve/bitcoin,1185/starwels,Kogser/bitcoin,simonmulser/bitcoin,sstone/bitcoin,thrasher-/litecoin,Bushstar/UFO-Project,Gazer022/bitcoin,ppcoin/ppcoin,namecoin/namecore,jmcorgan/bitcoin,bespike/litecoin,BitzenyCoreDevelopers/bitzeny,lbryio/lbrycrd,ryanofsky/bitcoin,x-kalux/bitcoin_WiG-B,sstone/bitcoin,aspanta/bitcoin,afk11/bitcoin,bitbrazilcoin-project/bitbrazilcoin,x-kalux/bitcoin_WiG-B,MeshCollider/bitcoin,thrasher-/litecoin,Christewart/bitcoin,Kogser/bitcoin,bitcoin/bitcoin,trippysalmon/bitcoin,domob1812/bitcoin,ahmedbodi/vertcoin,StarbuckBG/BTCGPU,Anfauglith/iop-hd,thrasher-/litecoin,brandonrobertz/namecoin-core,ajtowns/bitcoin,BTCGPU/BTCGPU,laudaa/bitcoin,particl/particl-core,starwels/starwels,shelvenzhou/BTCGPU,ajtowns/bitcoin,andreaskern/bitcoin,joshrabinowitz/bitcoin,viacoin/viacoin,globaltoken/globaltoken,namecoin/namecoin-core,RHavar/bitcoin,jlopp/statoshi,rawodb/bitcoin,Bushstar/UFO-Project,Theshadow4all/ShadowCoin,litecoin-project/litecoin,laudaa/bitcoin,kevcooper/bitcoin,nikkitan/bitcoin,ericshawlinux/bitcoin,starwels/starwels,yenliangl/bitcoin,pataquets/namecoin-core,stamhe/bitcoin,mitchellcash/bitcoin,kevcooper/bitcoin,trippysalmon/bitcoin,pataquets/namecoin-core,instagibbs/bitcoin,n1bor/bitcoin,ryanofsky/bitcoin,EthanHeilman/bitcoin,achow101/bitcoin,JeremyRubin/bitcoin,tjps/bitcoin,ElementsProject/elements,ajtowns/bitcoin,GroestlCoin/bitcoin,Kogser/bitcoin,trippysalmon/bitcoin,ahmedbodi/vertcoin,OmniLayer/omnicore,shelvenzhou/BTCGPU,bitbrazilcoin-project/bitbrazilcoin,rnicoll/dogecoin,Kogser/bitcoin,cryptoprojects/ultimateonlinecash,BTCGPU/BTCGPU,monacoinproject/monacoin,jambolo/bitcoin,kazcw/bitcoin,practicalswift/bitcoin,anditto/bitcoin,mm-s/bitcoin,MarcoFalke/bitcoin,Rav3nPL/bitcoin,Gazer022/bitcoin,bitcoin/bitcoin,UFOCoins/ufo,pstratem/bitcoin,mitchellcash/bitcoin,GlobalBoost/GlobalBoost,pataquets/namecoin-core,TheBlueMatt/bitcoin,ryanofsky/bitcoin,namecoin/namecoin-core,MarcoFalke/bitcoin,alecalve/bitcoin,aspanta/bitcoin,Xekyo/bitcoin,ryanofsky/bitcoin,kevcooper/bitcoin,bespike/litecoin,pstratem/bitcoin,wangxinxi/litecoin,fanquake/bitcoin,r8921039/bitcoin,domob1812/namecore,kazcw/bitcoin,midnightmagic/bitcoin,StarbuckBG/BTCGPU,spiritlinxl/BTCGPU,randy-waterhouse/bitcoin,UFOCoins/ufo,fujicoin/fujicoin,paveljanik/bitcoin,cdecker/bitcoin,jamesob/bitcoin,bitcoin/bitcoin,jonasschnelli/bitcoin,bespike/litecoin,untrustbank/litecoin,sebrandon1/bitcoin,jamesob/bitcoin,vmp32k/litecoin,bitcoinsSG/bitcoin,mruddy/bitcoin,globaltoken/globaltoken,viacoin/viacoin,pataquets/namecoin-core,instagibbs/bitcoin,BitzenyCoreDevelopers/bitzeny,peercoin/peercoin,vmp32k/litecoin
|
c970d8d8c6101a7e00fe91aef9a751d41c433569
|
mudlib/mud/home/Kotaka/sys/testd.c
|
mudlib/mud/home/Kotaka/sys/testd.c
|
#include <kotaka/paths.h>
#include <kotaka/log.h>
static void create()
{
}
void test()
{
}
|
#include <kotaka/paths.h>
#include <kotaka/log.h>
#include <kotaka/assert.h>
static void create()
{
}
private void test_qsort()
{
int *arr, i;
arr = allocate(1000);
for (i = 0; i < 1000; i++) {
arr[i] = random(1000000);
}
SUBD->qsort(arr, 0, 1000);
for (i = 0; i < 999; i++) {
ASSERT(arr[i] <= arr[i + 1]);
}
}
void test()
{
LOGD->post_message("test", LOG_DEBUG, "Testing qsort...");
test_qsort();
}
|
Add regression test for qsort
|
Add regression test for qsort
|
C
|
agpl-3.0
|
shentino/kotaka,shentino/kotaka,shentino/kotaka
|
2321a73ac4bc7ae3fc543c36e690d9831040160a
|
Sub-Terra/include/Oscillator.h
|
Sub-Terra/include/Oscillator.h
|
#pragma once
#include <math.h>
#include "WaveShape.h"
class Oscillator {
public:
WaveShape waveShape;
double frequency = 1.0;
double amplitude = 1.0;
double speed = 1.0;
uint32_t phaseAccumulator = 0;
Oscillator() = default;
Oscillator(const WaveShape &waveShape) : waveShape(waveShape), frequency(waveShape.preferredFrequency) {}
static constexpr uint32_t LowerMask(unsigned int n) {
return (n == 0)
? 0
: ((LowerMask(n - 1) << 1) | 1);
}
static constexpr uint32_t UpperMask(unsigned int n) {
return LowerMask(n) << (32 - n);
}
inline uint16_t Tick(const double sampleRate) {
double frequencyOut = frequency * speed;
uint32_t frequencyControlWord = frequencyOut * static_cast<double>(1ull << 32) / sampleRate;
phaseAccumulator += frequencyControlWord;
return amplitude * waveShape.table[(phaseAccumulator & UpperMask(WaveShape::granularity)) >> 22];
}
};
|
#pragma once
#include "WaveShape.h"
class Oscillator {
public:
WaveShape waveShape;
double frequency = 1.0;
double amplitude = 1.0;
double speed = 1.0;
uint32_t phaseAccumulator = 0;
Oscillator() = default;
Oscillator(const WaveShape &waveShape) : waveShape(waveShape), frequency(waveShape.preferredFrequency) {}
static constexpr uint32_t LowerMask(unsigned int n) {
return (n == 0)
? 0
: ((LowerMask(n - 1) << 1) | 1);
}
static constexpr uint32_t UpperMask(unsigned int n) {
return LowerMask(n) << (32 - n);
}
inline uint16_t Tick(const double sampleRate) {
double frequencyOut = frequency * speed;
uint32_t frequencyControlWord = static_cast<uint32_t>(frequencyOut * static_cast<double>(1ull << 32) / sampleRate);
phaseAccumulator += frequencyControlWord;
return static_cast<uint32_t>(amplitude * waveShape.table[(phaseAccumulator & UpperMask(WaveShape::granularity)) >> 22]);
}
};
|
Fix warnings and remove unused header
|
Fix warnings and remove unused header
|
C
|
mpl-2.0
|
polar-engine/polar,polar-engine/polar,shockkolate/polar4,shockkolate/polar4,shockkolate/polar4,shockkolate/polar4
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.