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
|
|---|---|---|---|---|---|---|---|---|---|
1d7b0f54bee766d685ab74f0c206547431f4f636
|
Alc/alconfig.h
|
Alc/alconfig.h
|
#ifndef ALCONFIG_H
#define ALCONFIG_H
void ReadALConfig(void);
void FreeALConfig(void);
int ConfigValueExists(const char *devName, const char *blockName, const char *keyName);
const char *GetConfigValue(const char *devName, const char *blockName, const char *keyName, const char *def);
int GetConfigValueBool(const char *devName, const char *blockName, const char *keyName, int def);
int ConfigValueStr(const char *devName, const char *blockName, const char *keyName, const char **ret);
int ConfigValueInt(const char *devName, const char *blockName, const char *keyName, int *ret);
int ConfigValueUInt(const char *devName, const char *blockName, const char *keyName, unsigned int *ret);
int ConfigValueFloat(const char *devName, const char *blockName, const char *keyName, float *ret);
int ConfigValueBool(const char *devName, const char *blockName, const char *keyName, int *ret);
#endif /* ALCONFIG_H */
|
#ifndef ALCONFIG_H
#define ALCONFIG_H
#ifdef __cplusplus
extern "C" {
#endif
void ReadALConfig(void);
void FreeALConfig(void);
int ConfigValueExists(const char *devName, const char *blockName, const char *keyName);
const char *GetConfigValue(const char *devName, const char *blockName, const char *keyName, const char *def);
int GetConfigValueBool(const char *devName, const char *blockName, const char *keyName, int def);
int ConfigValueStr(const char *devName, const char *blockName, const char *keyName, const char **ret);
int ConfigValueInt(const char *devName, const char *blockName, const char *keyName, int *ret);
int ConfigValueUInt(const char *devName, const char *blockName, const char *keyName, unsigned int *ret);
int ConfigValueFloat(const char *devName, const char *blockName, const char *keyName, float *ret);
int ConfigValueBool(const char *devName, const char *blockName, const char *keyName, int *ret);
#ifdef __cplusplus
} // extern "C"
#endif
#endif /* ALCONFIG_H */
|
Add another missing extern "C"
|
Add another missing extern "C"
|
C
|
lgpl-2.1
|
aaronmjacobs/openal-soft,aaronmjacobs/openal-soft
|
2e0bb77ac7a50735d50ee8a92be9bf7eadfd100c
|
test/global_fakes.h
|
test/global_fakes.h
|
#ifndef GLOBAL_FAKES_H_
#define GLOBAL_FAKES_H_
#include "../fff3.h"
void global_void_func(void);
DECLARE_FAKE_VOID_FUNC0(global_void_func);
#endif /* GLOBAL_FAKES_H_ */
|
#ifndef GLOBAL_FAKES_H_
#define GLOBAL_FAKES_H_
#include "../fff3.h"
//// Imaginary production code header file ///
void voidfunc1(int);
void voidfunc2(char, char);
long longfunc0();
enum MYBOOL { FALSE = 899, TRUE };
struct MyStruct {
int x;
int y;
};
enum MYBOOL enumfunc();
struct MyStruct structfunc();
//// End Imaginary production code header file ///
DECLARE_FAKE_VOID_FUNC1(voidfunc1, int);
DECLARE_FAKE_VOID_FUNC2(voidfunc2, char, char);
DECLARE_FAKE_VALUE_FUNC0(long, longfunc0);
DECLARE_FAKE_VALUE_FUNC0(enum MYBOOL, enumfunc0);
DECLARE_FAKE_VALUE_FUNC0(struct MyStruct, structfunc0);
#endif /* GLOBAL_FAKES_H_ */
|
Add fakes for common test cases
|
Add fakes for common test cases
|
C
|
mit
|
usr42/fff,usr42/fff,usr42/fff,usr42/fff
|
07f4eda3a524bdc245a088dc90a71583234273b9
|
test/FrontendC/vla-1.c
|
test/FrontendC/vla-1.c
|
// RUN: not %llvmgcc -std=gnu99 %s -S |& grep "error: alignment for"
int foo(int a)
{
int var[a] __attribute__((__aligned__(32)));
return 4;
}
|
// RUN: %llvmgcc_only -std=gnu99 %s -S |& grep "warning: alignment for"
int foo(int a)
{
int var[a] __attribute__((__aligned__(32)));
return 4;
}
|
Fix this up per llvm-gcc r109819.
|
Fix this up per llvm-gcc r109819.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@109820 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap
|
a6345abe1b077f3bb2c6765245761f8a9f50965c
|
capi/include/mp4parse-rust.h
|
capi/include/mp4parse-rust.h
|
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
#ifndef _MP4PARSE_RUST_H
#define _MP4PARSE_RUST_H
#ifdef __cplusplus
extern "C" {
#endif
struct mp4parse_state;
struct mp4parse_state* mp4parse_state_new(void);
void mp4parse_state_free(struct mp4parse_state* state);
int32_t mp4parse_state_feed(struct mp4parse_state* state, uint8_t *buffer, size_t size);
#ifdef __cplusplus
}
#endif
#endif
|
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
#ifndef _MP4PARSE_RUST_H
#define _MP4PARSE_RUST_H
#ifdef __cplusplus
extern "C" {
#endif
struct mp4parse_state;
struct mp4parse_state* mp4parse_new(void);
void mp4parse_free(struct mp4parse_state* state);
int32_t mp4parse_read(struct mp4parse_state* state, uint8_t *buffer, size_t size);
#ifdef __cplusplus
}
#endif
#endif
|
Update C header to match capi.rs function names.
|
Update C header to match capi.rs function names.
|
C
|
mpl-2.0
|
kinetiknz/mp4parse-rust,kinetiknz/mp4parse-rust,mozilla/mp4parse-rust
|
6c93a693f3e0e4a2979fa8677278d181c5e3edb2
|
include/rwte/coords.h
|
include/rwte/coords.h
|
#ifndef RWTE_COORDS_H
#define RWTE_COORDS_H
struct Cell
{
int row, col;
inline bool operator==(const Cell& other) const
{
return row == other.row && col == other.col;
}
inline bool operator!=(const Cell& other) const
{
return row != other.row || col != other.col;
}
inline bool operator< (const Cell& other) const
{
return row < other.row || col < other.col;
}
inline bool operator> (const Cell& other) const
{
return row > other.row || col > other.col;
}
inline bool operator<=(const Cell& other) const
{
return row < other.row || col < other.col ||
(row == other.row && col == other.col);
}
inline bool operator>=(const Cell& other) const
{
return row > other.row || col > other.col ||
(row == other.row && col == other.col);
}
};
#endif // RWTE_COORDS_H
|
#ifndef RWTE_COORDS_H
#define RWTE_COORDS_H
struct Cell
{
int row = 0;
int col = 0;
inline bool operator==(const Cell& other) const
{
return row == other.row && col == other.col;
}
inline bool operator!=(const Cell& other) const
{
return row != other.row || col != other.col;
}
inline bool operator< (const Cell& other) const
{
return row < other.row || col < other.col;
}
inline bool operator> (const Cell& other) const
{
return row > other.row || col > other.col;
}
inline bool operator<=(const Cell& other) const
{
return row < other.row || col < other.col ||
(row == other.row && col == other.col);
}
inline bool operator>=(const Cell& other) const
{
return row > other.row || col > other.col ||
(row == other.row && col == other.col);
}
};
#endif // RWTE_COORDS_H
|
Set default values for Cell members.
|
Set default values for Cell members.
|
C
|
mit
|
drcforbin/rwte,drcforbin/rwte,drcforbin/rwte,drcforbin/rwte
|
0eabb5f05a435bb32ba85b192875c47d213453b6
|
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(Debug)
SLTM(Error)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionReuse)
SLTM(SessionClose)
SLTM(BackendOpen)
SLTM(BackendXID)
SLTM(BackendReuse)
SLTM(BackendClose)
SLTM(HttpError)
SLTM(ClientAddr)
SLTM(Backend)
SLTM(Request)
SLTM(Response)
SLTM(Length)
SLTM(Status)
SLTM(URL)
SLTM(Protocol)
SLTM(Header)
SLTM(BldHdr)
SLTM(LostHeader)
SLTM(VCL_call)
SLTM(VCL_trace)
SLTM(VCL_return)
SLTM(XID)
SLTM(Hit)
SLTM(ExpBan)
SLTM(ExpPick)
SLTM(ExpKill)
SLTM(WorkThread)
|
/*
* $Id$
*
* Define the tags in the shared memory in a reusable format.
* Whoever includes this get to define what the SLTM macro does.
*
* REMEMBER to update the documentation (especially the varnishlog(1) man
* page) whenever this list changes.
*/
SLTM(Debug)
SLTM(Error)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionReuse)
SLTM(SessionClose)
SLTM(BackendOpen)
SLTM(BackendXID)
SLTM(BackendReuse)
SLTM(BackendClose)
SLTM(HttpError)
SLTM(ClientAddr)
SLTM(Backend)
SLTM(Request)
SLTM(Response)
SLTM(Length)
SLTM(Status)
SLTM(URL)
SLTM(Protocol)
SLTM(Header)
SLTM(BldHdr)
SLTM(LostHeader)
SLTM(VCL_call)
SLTM(VCL_trace)
SLTM(VCL_return)
SLTM(XID)
SLTM(Hit)
SLTM(ExpBan)
SLTM(ExpPick)
SLTM(ExpKill)
SLTM(WorkThread)
|
Add a note to update varnishlog(1) whenever this list changes.
|
Add a note to update varnishlog(1) whenever this list changes.
git-svn-id: 2c9807fa3ff65b17195bd55dc8a6c4261e10127b@418 d4fa192b-c00b-0410-8231-f00ffab90ce4
|
C
|
bsd-2-clause
|
drwilco/varnish-cache-old,ajasty-cavium/Varnish-Cache,1HLtd/Varnish-Cache,varnish/Varnish-Cache,varnish/Varnish-Cache,gquintard/Varnish-Cache,drwilco/varnish-cache-drwilco,alarky/varnish-cache-doc-ja,feld/Varnish-Cache,wikimedia/operations-debs-varnish,zhoualbeart/Varnish-Cache,drwilco/varnish-cache-old,gauthier-delacroix/Varnish-Cache,gauthier-delacroix/Varnish-Cache,ssm/pkg-varnish,alarky/varnish-cache-doc-ja,franciscovg/Varnish-Cache,wikimedia/operations-debs-varnish,ssm/pkg-varnish,chrismoulton/Varnish-Cache,franciscovg/Varnish-Cache,zhoualbeart/Varnish-Cache,mrhmouse/Varnish-Cache,ssm/pkg-varnish,franciscovg/Varnish-Cache,ambernetas/varnish-cache,feld/Varnish-Cache,mrhmouse/Varnish-Cache,alarky/varnish-cache-doc-ja,mrhmouse/Varnish-Cache,franciscovg/Varnish-Cache,chrismoulton/Varnish-Cache,alarky/varnish-cache-doc-ja,feld/Varnish-Cache,ambernetas/varnish-cache,varnish/Varnish-Cache,ssm/pkg-varnish,varnish/Varnish-Cache,1HLtd/Varnish-Cache,1HLtd/Varnish-Cache,feld/Varnish-Cache,gquintard/Varnish-Cache,zhoualbeart/Varnish-Cache,gauthier-delacroix/Varnish-Cache,gauthier-delacroix/Varnish-Cache,chrismoulton/Varnish-Cache,gquintard/Varnish-Cache,mrhmouse/Varnish-Cache,zhoualbeart/Varnish-Cache,mrhmouse/Varnish-Cache,alarky/varnish-cache-doc-ja,ajasty-cavium/Varnish-Cache,wikimedia/operations-debs-varnish,wikimedia/operations-debs-varnish,feld/Varnish-Cache,wikimedia/operations-debs-varnish,ajasty-cavium/Varnish-Cache,ajasty-cavium/Varnish-Cache,chrismoulton/Varnish-Cache,chrismoulton/Varnish-Cache,gquintard/Varnish-Cache,drwilco/varnish-cache-old,1HLtd/Varnish-Cache,franciscovg/Varnish-Cache,drwilco/varnish-cache-drwilco,drwilco/varnish-cache-drwilco,ajasty-cavium/Varnish-Cache,zhoualbeart/Varnish-Cache,ssm/pkg-varnish,ambernetas/varnish-cache,gauthier-delacroix/Varnish-Cache,varnish/Varnish-Cache
|
51c8a6dc7636942958b07ed49e925c97b9d58646
|
config.h
|
config.h
|
const char *field_sep = " \u2022 ";
const char *time_fmt = "%x %I:%M %p";
const int update_period = 90;
char *
loadavg(void)
{
double avgs[3];
if (getloadavg(avgs, 3) < 0) {
perror("getloadavg");
exit(1);
}
return smprintf("%.2f %.2f %.2f", avgs[0], avgs[1], avgs[2]);
}
char *
prettytime(void)
{
return mktimes(time_fmt, NULL);
}
static char *(*forder[])(void) = {
loadavg,
prettytime,
NULL
};
|
const char *field_sep = " \u2022 ";
const char *time_fmt = "%x %I:%M %p";
const int update_period = 15;
char *
loadavg(void)
{
double avgs[3];
if (getloadavg(avgs, 3) < 0) {
perror("getloadavg");
exit(1);
}
return smprintf("%.2f %.2f %.2f", avgs[0], avgs[1], avgs[2]);
}
char *
prettytime(void)
{
return mktimes(time_fmt, NULL);
}
static char *(*forder[])(void) = {
loadavg,
prettytime,
NULL
};
|
Change update_period to 15 seconds
|
Change update_period to 15 seconds
On a laptop, 90 seconds between battery status updates can lead to
unnecessary worrying about whether or not the AC adapter is broken.
|
C
|
mit
|
grantisu/dwmstatus
|
06d414e87708afb29b87d33919abbf5973c9bed2
|
adapters/Vungle/VungleAdapter/GADMAdapterVungleConstants.h
|
adapters/Vungle/VungleAdapter/GADMAdapterVungleConstants.h
|
//
// Copyright © 2019 Google. All rights reserved.
//
static NSString *const kGADMAdapterVungleVersion = @"6.4.2.1";
static NSString *const kGADMAdapterVungleApplicationID = @"application_id";
static NSString *const kGADMAdapterVunglePlacementID = @"placementID";
static NSString *const kGADMAdapterVungleErrorDomain =
@"com.google.mediation.vungle";
|
//
// Copyright © 2019 Google. All rights reserved.
//
static NSString *const kGADMAdapterVungleVersion = @"6.4.3.0";
static NSString *const kGADMAdapterVungleApplicationID = @"application_id";
static NSString *const kGADMAdapterVunglePlacementID = @"placementID";
static NSString *const kGADMAdapterVungleErrorDomain =
@"com.google.mediation.vungle";
|
Update adapter version number to 6.4.3.0
|
Update adapter version number to 6.4.3.0
|
C
|
apache-2.0
|
googleads/googleads-mobile-ios-mediation,googleads/googleads-mobile-ios-mediation,googleads/googleads-mobile-ios-mediation,googleads/googleads-mobile-ios-mediation
|
962247710c891af9f847c3c26670c3ab8928219c
|
src/common/angleutils.h
|
src/common/angleutils.h
|
//
// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// angleutils.h: Common ANGLE utilities.
#ifndef COMMON_ANGLEUTILS_H_
#define COMMON_ANGLEUTILS_H_
// A macro to disallow the copy constructor and operator= functions
// This must be used in the private: declarations for a class
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
void operator=(const TypeName&)
template <typename T, unsigned int N>
inline unsigned int ArraySize(T(&)[N])
{
return N;
}
#if defined(_MSC_VER)
#define snprintf _snprintf
#endif
#define VENDOR_ID_AMD 0x1002
#define VENDOR_ID_INTEL 0x8086
#define VENDOR_ID_NVIDIA 0x10DE
#define GL_BGRA4_ANGLEX 0x6ABC
#define GL_BGR5_A1_ANGLEX 0x6ABD
#endif // COMMON_ANGLEUTILS_H_
|
//
// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// angleutils.h: Common ANGLE utilities.
#ifndef COMMON_ANGLEUTILS_H_
#define COMMON_ANGLEUTILS_H_
// A macro to disallow the copy constructor and operator= functions
// This must be used in the private: declarations for a class
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
void operator=(const TypeName&)
template <typename T, unsigned int N>
inline unsigned int ArraySize(T(&)[N])
{
return N;
}
template <typename T, unsigned int N>
void SafeRelease(T (&resourceBlock)[N])
{
for (unsigned int i = 0; i < N; i++)
{
SafeRelease(resourceBlock[i]);
}
}
template <typename T>
void SafeRelease(T& resource)
{
if (resource)
{
resource->Release();
resource = NULL;
}
}
#if defined(_MSC_VER)
#define snprintf _snprintf
#endif
#define VENDOR_ID_AMD 0x1002
#define VENDOR_ID_INTEL 0x8086
#define VENDOR_ID_NVIDIA 0x10DE
#define GL_BGRA4_ANGLEX 0x6ABC
#define GL_BGR5_A1_ANGLEX 0x6ABD
#endif // COMMON_ANGLEUTILS_H_
|
Add helper functions to safely release Windows COM resources, and arrays of COM resources.
|
Add helper functions to safely release Windows COM resources, and arrays of COM resources.
TRAC #22656
Signed-off-by: Nicolas Capens
Signed-off-by: Shannon Woods
Author: Jamie Madill
git-svn-id: 7288974629ec06eaf04ee103a0a5f761b9efd9a5@2076 736b8ea6-26fd-11df-bfd4-992fa37f6226
|
C
|
bsd-3-clause
|
mikolalysenko/angle,ecoal95/angle,xin3liang/platform_external_chromium_org_third_party_angle,larsbergstrom/angle,bsergean/angle,ghostoy/angle,jgcaaprom/android_external_chromium_org_third_party_angle,bsergean/angle,mrobinson/rust-angle,ghostoy/angle,MIPS/external-chromium_org-third_party-angle,mrobinson/rust-angle,vvuk/angle,nandhanurrevanth/angle,crezefire/angle,geekboxzone/lollipop_external_chromium_org_third_party_angle,mybios/angle,csa7mdm/angle,crezefire/angle,csa7mdm/angle,mrobinson/rust-angle,larsbergstrom/angle,MIPS/external-chromium_org-third_party-angle,xin3liang/platform_external_chromium_org_third_party_angle,vvuk/angle,mrobinson/rust-angle,mikolalysenko/angle,ghostoy/angle,MSOpenTech/angle,nandhanurrevanth/angle,domokit/waterfall,mybios/angle,mrobinson/rust-angle,crezefire/angle,xin3liang/platform_external_chromium_org_third_party_angle,mlfarrell/angle,MIPS/external-chromium_org-third_party-angle,mlfarrell/angle,nandhanurrevanth/angle,ecoal95/angle,ecoal95/angle,csa7mdm/angle,geekboxzone/lollipop_external_chromium_org_third_party_angle,larsbergstrom/angle,ppy/angle,larsbergstrom/angle,mybios/angle,MIPS/external-chromium_org-third_party-angle,crezefire/angle,ghostoy/angle,mlfarrell/angle,geekboxzone/lollipop_external_chromium_org_third_party_angle,MSOpenTech/angle,vvuk/angle,ecoal95/angle,mikolalysenko/angle,android-ia/platform_external_chromium_org_third_party_angle,xin3liang/platform_external_chromium_org_third_party_angle,geekboxzone/lollipop_external_chromium_org_third_party_angle,android-ia/platform_external_chromium_org_third_party_angle,nandhanurrevanth/angle,android-ia/platform_external_chromium_org_third_party_angle,bsergean/angle,domokit/waterfall,ecoal95/angle,jgcaaprom/android_external_chromium_org_third_party_angle,ppy/angle,jgcaaprom/android_external_chromium_org_third_party_angle,jgcaaprom/android_external_chromium_org_third_party_angle,MSOpenTech/angle,ppy/angle,android-ia/platform_external_chromium_org_third_party_angle,csa7mdm/angle,mikolalysenko/angle,mlfarrell/angle,MSOpenTech/angle,bsergean/angle,vvuk/angle,mybios/angle,ppy/angle
|
82b771a4edc2414a6b88ea75afa73c2d82f6b569
|
config.h
|
config.h
|
#ifndef _CONFIG_H_
#define _CONFIG_H_
#define DEBUG 0
#define BADGE_MINIMUM_ID 3000 /* Inclusive */
#define BADGE_MAXIMUM_ID 8000 /* Inclusive */
#define HISTORY_WINDOW_SIZE 128
/** Optionally workaround a bug whereby sequence IDs are
* not held constant within a burst of identical packets
*
* Set to 0 to disable workaround, or 2 to ignore the bottom
* two bits of all sequence IDs, since badges send 4 packets
* at a time.
*/
#define CONFIG_SEQUENCE_ID_SHIFT 2
#endif
|
#ifndef _CONFIG_H_
#define _CONFIG_H_
#define DEBUG 0
#define BADGE_MINIMUM_ID 3000 /* Inclusive */
#define BADGE_MAXIMUM_ID 8000 /* Inclusive */
#define HISTORY_WINDOW_SIZE 32
/** Optionally workaround a bug whereby sequence IDs are
* not held constant within a burst of identical packets
*
* Set to 0 to disable workaround, or 2 to ignore the bottom
* two bits of all sequence IDs, since badges send 4 packets
* at a time.
*/
#define CONFIG_SEQUENCE_ID_SHIFT 2
#endif
|
Reduce history size to 32 buckets
|
Reduce history size to 32 buckets
|
C
|
agpl-3.0
|
nwf/nwf-openamd-localizer,nwf/nwf-openamd-localizer
|
c9b258415efd0659e53c756ccd979b33afb4e8d4
|
test/chtest/setgroups.c
|
test/chtest/setgroups.c
|
/* Try to drop the last supplemental group, and print a message to stdout
describing what happened. */
#include <errno.h>
#include <grp.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#define NGROUPS_MAX 32
int main()
{
int group_ct;
gid_t groups[NGROUPS_MAX];
group_ct = getgroups(NGROUPS_MAX, groups);
if (group_ct == -1) {
printf("ERROR\tgetgroups(2) failed with errno=%d\n", errno);
return 1;
}
fprintf(stderr, "found %d groups; trying to drop last group %d\n",
group_ct, groups[group_ct - 1]);
if (setgroups(group_ct - 1, groups)) {
if (errno == EPERM) {
printf("SAFE\tsetgroups(2) failed with EPERM\n");
return 0;
} else {
printf("ERROR\tsetgroups(2) failed with errno=%d\n", errno);
return 1;
}
} else {
printf("RISK\tsetgroups(2) succeeded\n");
return 1;
}
}
|
/* Try to drop the last supplemental group, and print a message to stdout
describing what happened. */
#include <errno.h>
#include <grp.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#define NGROUPS_MAX 128
int main()
{
int group_ct;
gid_t groups[NGROUPS_MAX];
group_ct = getgroups(NGROUPS_MAX, groups);
if (group_ct == -1) {
printf("ERROR\tgetgroups(2) failed with errno=%d\n", errno);
return 1;
}
fprintf(stderr, "found %d groups; trying to drop last group %d\n",
group_ct, groups[group_ct - 1]);
if (setgroups(group_ct - 1, groups)) {
if (errno == EPERM) {
printf("SAFE\tsetgroups(2) failed with EPERM\n");
return 0;
} else {
printf("ERROR\tsetgroups(2) failed with errno=%d\n", errno);
return 1;
}
} else {
printf("RISK\tsetgroups(2) succeeded\n");
return 1;
}
}
|
Raise maximum groups in chtest to the same number used in ch-run.
|
Raise maximum groups in chtest to the same number used in ch-run.
Signed-off-by: Oliver Freyermuth <297815a44ac0d229e08a814adf0f210787d04d87@googlemail.com>
|
C
|
apache-2.0
|
hpc/charliecloud,hpc/charliecloud,hpc/charliecloud
|
a61f732d9aefc8731e05ee7003c8de4e6cc72e29
|
ExLauncher/global.h
|
ExLauncher/global.h
|
/*
Copyright 2016 Andreas Bjerkeholt
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 _GLOBAL_H
#define _GLOBAL_H
#if defined(WIN32) || defined(_WIN32)
#define WINDOWS
#endif
#if defined(__unix) || defined(__unix__)
#define UNIX
#endif
#define FPS 60
extern bool debugViewBounds;
extern bool isLauncher;
#endif
|
/*
Copyright 2016 Andreas Bjerkeholt
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 _GLOBAL_H
#define _GLOBAL_H
#if defined(WIN32) || defined(_WIN32)
#define WINDOWS
#endif
#if defined(__unix) || defined(__unix__) || defined(__APPLE__)
#define UNIX
#endif
#define FPS 60
extern bool debugViewBounds;
extern bool isLauncher;
#endif
|
Add OSX-specific macro to the list of platforms detected as UNIX
|
Add OSX-specific macro to the list of platforms detected as UNIX
|
C
|
apache-2.0
|
Harteex/ExLauncher,Harteex/ExLauncher,Harteex/ExLauncher
|
a17736abf56bf8c26f0ef947d5ed00afa7250c6d
|
tests/regression/02-base/44-malloc_array.c
|
tests/regression/02-base/44-malloc_array.c
|
// PARAM: --set ana.int.interval true --enable exp.partition-arrays.enabled
#include<stdlib.h>
#include<assert.h>
int main(void) {
int *r = malloc(5 * sizeof(int));
r[3] = 2;
assert(r[4] == 2);
}
|
// PARAM: --set ana.int.interval true --enable exp.partition-arrays.enabled
#include<stdlib.h>
#include<assert.h>
int main(void) {
int *r = malloc(5 * sizeof(int));
r[3] = 2;
assert(r[4] == 2);
(* Here we only test our implementation. Concretely, accessing the uninitialised r[4] is undefined behavior.
In our implementation we keep the whole memory allocated by malloc as one Blob and the whole Blob contains 2 after it was assigned to r[3].
This is more useful than keeping the Blob unknown. *)
}
|
Add explanation to the regression test 02 44
|
Add explanation to the regression test 02 44
|
C
|
mit
|
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
|
44172f701c0842fc1a31bfa93b617b361a6d3618
|
OpenAL32/Include/alError.h
|
OpenAL32/Include/alError.h
|
#ifndef _AL_ERROR_H_
#define _AL_ERROR_H_
#include "alMain.h"
#ifdef __cplusplus
extern "C" {
#endif
extern ALboolean TrapALError;
ALvoid alSetError(ALCcontext *Context, ALenum errorCode);
#define SET_ERROR_AND_RETURN(ctx, err) do { \
alSetError((ctx), (err)); \
return; \
} while(0)
#define SET_AND_RETURN_ERROR(ctx, err) do { \
alSetError((ctx), (err)); \
return (err); \
} while(0)
#ifdef __cplusplus
}
#endif
#endif
|
#ifndef _AL_ERROR_H_
#define _AL_ERROR_H_
#include "alMain.h"
#ifdef __cplusplus
extern "C" {
#endif
extern ALboolean TrapALError;
ALvoid alSetError(ALCcontext *Context, ALenum errorCode);
#ifdef __cplusplus
}
#endif
#endif
|
Remove a duplicate and unused macro
|
Remove a duplicate and unused macro
|
C
|
lgpl-2.1
|
alexxvk/openal-soft,irungentoo/openal-soft-tox,arkana-fts/openal-soft,arkana-fts/openal-soft,franklixuefei/openal-soft,franklixuefei/openal-soft,aaronmjacobs/openal-soft,BeamNG/openal-soft,aaronmjacobs/openal-soft,alexxvk/openal-soft,mmozeiko/OpenAL-Soft,Wemersive/openal-soft,mmozeiko/OpenAL-Soft,BeamNG/openal-soft,irungentoo/openal-soft-tox,Wemersive/openal-soft
|
cfd41cfd0bd199672449db88d0502d37131a5c1f
|
test/Sema/struct-decl.c
|
test/Sema/struct-decl.c
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
// PR3459
struct bar {
char n[1];
};
struct foo {
char name[(int)&((struct bar *)0)->n];
char name2[(int)&((struct bar *)0)->n - 1]; //expected-error{{array size is negative}}
};
// PR3430
struct s {
struct st {
int v;
} *ts;
};
struct st;
int foo() {
struct st *f;
return f->v + f[0].v;
}
// PR3642, PR3671
struct pppoe_tag {
short tag_type;
char tag_data[];
};
struct datatag {
struct pppoe_tag hdr; //expected-warning{{field 'hdr' with variable sized type 'struct pppoe_tag' not at the end of a struct or class is a GNU extension}}
char data;
};
// PR4092
struct s0 {
char a; // expected-note {{previous declaration is here}}
char a; // expected-error {{duplicate member 'a'}}
};
struct s0 f0(void) {}
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
// PR3459
struct bar {
char n[1];
};
struct foo {
char name[(int)&((struct bar *)0)->n];
char name2[(int)&((struct bar *)0)->n - 1]; //expected-error{{array size is negative}}
};
// PR3430
struct s {
struct st {
int v;
} *ts;
};
struct st;
int foo() {
struct st *f;
return f->v + f[0].v;
}
// PR3642, PR3671
struct pppoe_tag {
short tag_type;
char tag_data[];
};
struct datatag {
struct pppoe_tag hdr; //expected-warning{{field 'hdr' with variable sized type 'struct pppoe_tag' not at the end of a struct or class is a GNU extension}}
char data;
};
// PR4092
struct s0 {
char a; // expected-note {{previous declaration is here}}
char a; // expected-error {{duplicate member 'a'}}
};
struct s0 f0(void) {}
// <rdar://problem/8177927> - This previously triggered an assertion failure.
struct x0 {
unsigned int x1;
};
|
Add test case for <rdar://problem/8177927> (which triggered an assertion failure in SemaChecking).
|
Add test case for <rdar://problem/8177927> (which triggered an assertion failure in SemaChecking).
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@108159 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/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,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
|
b13d509f6f8e627656f8af1bd5f262a63f31121f
|
lib/libncurses/termcap.h
|
lib/libncurses/termcap.h
|
#ifndef _TERMCAP_H
#define _TERMCAP_H 1
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#include <sys/cdefs.h>
extern char PC;
extern char *UP;
extern char *BC;
extern short ospeed;
extern int tgetent __P((char *, const char *));
extern int tgetflag __P((const char *));
extern int tgetnum __P((const char *));
extern char *tgetstr __P((const char *, char **));
extern int tputs __P((const char *, int, int (*)(int)));
extern char *tgoto __P((const char *, int, int));
extern char *tparam __P((const char *, char *, int, ...));
#ifdef __cplusplus
}
#endif
#endif /* _TERMCAP_H */
|
#ifndef _TERMCAP_H
#define _TERMCAP_H 1
#include <sys/cdefs.h>
__BEGIN_DECLS
extern char PC;
extern char *UP;
extern char *BC;
extern short ospeed;
extern int tgetent __P((char *, const char *));
extern int tgetflag __P((const char *));
extern int tgetnum __P((const char *));
extern char *tgetstr __P((const char *, char **));
extern int tputs __P((const char *, int, int (*)(int)));
extern char *tgoto __P((const char *, int, int));
extern char *tparam __P((const char *, char *, int, ...));
__END_DECLS
#endif /* _TERMCAP_H */
|
Make this file more BSD-like
|
Make this file more BSD-like
|
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
|
65aa2240dbcd526a339a88749d3fe43b0396384f
|
INPopoverController/INPopoverControllerDefines.h
|
INPopoverController/INPopoverControllerDefines.h
|
//
// INPopoverControllerDefines.h
// Copyright 2011-2014 Indragie Karunaratne. All rights reserved.
//
typedef NS_ENUM(NSUInteger, INPopoverArrowDirection) {
INPopoverArrowDirectionUndefined = 0,
INPopoverArrowDirectionLeft = NSMaxXEdge,
INPopoverArrowDirectionRight = NSMinXEdge,
INPopoverArrowDirectionUp = NSMaxYEdge,
INPopoverArrowDirectionDown = NSMinYEdge
};
typedef NS_ENUM(NSInteger, INPopoverAnimationType) {
INPopoverAnimationTypePop = 0, // Pop animation similar to NSPopover
INPopoverAnimationTypeFadeIn, // Fade in only, no fade out
INPopoverAnimationTypeFadeOut, // Fade out only, no fade in
INPopoverAnimationTypeFadeInOut // Fade in and out
};
|
//
// INPopoverControllerDefines.h
// Copyright 2011-2014 Indragie Karunaratne. All rights reserved.
//
typedef NS_ENUM(NSUInteger, INPopoverArrowDirection) {
INPopoverArrowDirectionUndefined = 0,
INPopoverArrowDirectionLeft,
INPopoverArrowDirectionRight,
INPopoverArrowDirectionUp,
INPopoverArrowDirectionDown
};
typedef NS_ENUM(NSInteger, INPopoverAnimationType) {
INPopoverAnimationTypePop = 0, // Pop animation similar to NSPopover
INPopoverAnimationTypeFadeIn, // Fade in only, no fade out
INPopoverAnimationTypeFadeOut, // Fade out only, no fade in
INPopoverAnimationTypeFadeInOut // Fade in and out
};
|
Remove references to NS...Edge in enum
|
Remove references to NS...Edge in enum
|
C
|
bsd-2-clause
|
indragiek/INPopoverController
|
19faea809ec3ea8a9722b0e87bb028fd23c721a1
|
modlib.c
|
modlib.c
|
#include "modlib.h"
uint16_t MODBUSSwapEndian( uint16_t Data )
{
//Change big-endian to little-endian and vice versa
unsigned char Swap;
//Create 2 bytes long union
union Conversion
{
uint16_t Data;
unsigned char 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( uint16_t *Data, uint16_t Length )
{
//Calculate CRC16 checksum using given data and length
uint16_t CRC = 0xFFFF;
uint16_t i;
unsigned char 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 // Else LSB is not set
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( uint16_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 // Else LSB is not set
CRC >>= 1;
}
}
return CRC;
}
|
Change 'unsigned character' type variables to 'uint8_t'
|
Change 'unsigned character' type variables to 'uint8_t'
|
C
|
mit
|
Jacajack/modlib
|
1cf5ce1609ef6830483199706fcd10028ad07d2d
|
apps/examples/nxp_example/nxp_demo_sample_main.c
|
apps/examples/nxp_example/nxp_demo_sample_main.c
|
/* ****************************************************************
*
* Copyright 2019 NXP Semiconductors All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************/
#include <tinyara/config.h>
#include <stdio.h>
extern void imxrt_log_print_kernelbuffer();
#ifdef CONFIG_BUILD_KERNEL
int main(int argc, FAR char *argv[])
#else
int nxp_demo_sample_main(int argc, char *argv[])
#endif
{
printf("[New] nxp_demo_sample!!\n");
imxrt_log_print_kernelbuffer();
return 0;
}
|
/* ****************************************************************
*
* Copyright 2019 NXP Semiconductors All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************/
#include <tinyara/config.h>
#include <stdio.h>
extern void imxrt_log_print_kernelbuffer();
#ifdef CONFIG_BUILD_KERNEL
int main(int argc, FAR char *argv[])
#else
int nxp_demo_sample_main(int argc, char *argv[])
#endif
{
printf("[New] nxp_demo_sample!!\n");
#ifndef CONFIG_BUILD_PROTECTED
imxrt_log_print_kernelbuffer();
#endif
return 0;
}
|
Fix NXP example app for Protected build
|
apps/examples/nxp_example: Fix NXP example app for Protected build
Remove direct call to kernel API from NXP example app in case of
protected build.
Signed-off-by: Kishore S N <33058dcca7ce956a91a61ef5ae8fb790ece75b5f@samsung.com>
|
C
|
apache-2.0
|
Samsung/TizenRT,jeongchanKim/TizenRT,sunghan-chang/TizenRT,chanijjani/TizenRT,jsdosa/TizenRT,an4967/TizenRT,an4967/TizenRT,jsdosa/TizenRT,an4967/TizenRT,jeongarmy/TizenRT,Samsung/TizenRT,junmin-kim/TizenRT,sunghan-chang/TizenRT,sunghan-chang/TizenRT,chanijjani/TizenRT,davidfather/TizenRT,junmin-kim/TizenRT,junmin-kim/TizenRT,junmin-kim/TizenRT,Samsung/TizenRT,jsdosa/TizenRT,an4967/TizenRT,jeongchanKim/TizenRT,pillip8282/TizenRT,davidfather/TizenRT,jeongarmy/TizenRT,Samsung/TizenRT,pillip8282/TizenRT,jeongchanKim/TizenRT,pillip8282/TizenRT,jeongarmy/TizenRT,jeongarmy/TizenRT,jeongchanKim/TizenRT,chanijjani/TizenRT,jeongarmy/TizenRT,Samsung/TizenRT,davidfather/TizenRT,chanijjani/TizenRT,davidfather/TizenRT,pillip8282/TizenRT,jsdosa/TizenRT,jsdosa/TizenRT,davidfather/TizenRT,jsdosa/TizenRT,chanijjani/TizenRT,davidfather/TizenRT,jsdosa/TizenRT,an4967/TizenRT,pillip8282/TizenRT,sunghan-chang/TizenRT,pillip8282/TizenRT,pillip8282/TizenRT,junmin-kim/TizenRT,jeongchanKim/TizenRT,sunghan-chang/TizenRT,davidfather/TizenRT,jeongchanKim/TizenRT,Samsung/TizenRT,sunghan-chang/TizenRT,junmin-kim/TizenRT,Samsung/TizenRT,an4967/TizenRT,junmin-kim/TizenRT,jeongchanKim/TizenRT,chanijjani/TizenRT,jeongarmy/TizenRT,sunghan-chang/TizenRT,chanijjani/TizenRT,jeongarmy/TizenRT,an4967/TizenRT
|
5d482ef3550d124297fb641597774d9c1a994621
|
src/ippusbd.c
|
src/ippusbd.c
|
#include <stdio.h>
#include <stdlib.h>
#include "http/http.h"
int main(int argc, char *argv[])
{
http_sock *sock = open_http();
if (sock == NULL)
goto cleanup;
// TODO: print port then fork
uint32_t port = get_port_number(sock);
printf("%u\n", port);
while (1) {
http_conn *conn = accept_conn(sock);
if (conn == NULL) {
ERR("Opening connection failed");
goto conn_error;
}
message *msg = get_message(conn);
if (msg == NULL) {
ERR("Generating message failed");
goto conn_error;
}
packet *pkt = get_packet(msg);
if (pkt == NULL) {
ERR("Receiving packet failed");
goto conn_error;
}
printf("%.*s", (int)pkt->size, pkt->buffer);
conn_error:
if (conn != NULL)
free(conn);
if (msg != NULL)
free(msg);
}
cleanup:
if (sock != NULL)
close_http(sock);
return 1;
}
|
#include <stdio.h>
#include <stdlib.h>
#include "http/http.h"
int main(int argc, char *argv[])
{
http_sock *sock = open_http();
if (sock == NULL)
goto cleanup;
// TODO: print port then fork
uint32_t port = get_port_number(sock);
printf("%u\n", port);
while (1) {
http_conn *conn = accept_conn(sock);
if (conn == NULL) {
ERR("Opening connection failed");
goto conn_error;
}
message *msg = get_message(conn);
if (msg == NULL) {
ERR("Generating message failed");
goto conn_error;
}
packet *pkt = get_packet(msg);
if (pkt == NULL) {
ERR("Receiving packet failed");
goto conn_error;
}
printf("%.*s", (int)pkt->size, pkt->buffer);
conn_error:
if (conn != NULL)
free(conn);
if (msg != NULL)
free(msg);
}
cleanup:
if (sock != NULL)
close_http(sock);
return 0;
}
|
Fix main exiting with error code on error-less run
|
Fix main exiting with error code on error-less run
Comandline programs expect 0 as errror-less return
value. This is in contrast to C where we treat 0
or NULL as an error token.
|
C
|
apache-2.0
|
daniel-dressler/ippusbxd,tillkamppeter/ippusbxd
|
bf67ee6399ea6fa8cb3723d29f44c5c6a4d5f118
|
attiny-blink/main.c
|
attiny-blink/main.c
|
/* Name: main.c
* Author: <insert your name here>
* Copyright: <insert your copyright message here>
* License: <insert your license reference here>
*/
// A simple blinky program for ATtiny85
// Connect red LED at pin 2 (PB3)
//
#include <avr/io.h>
#include <util/delay.h>
int main (void)
{
// set PB3 to be output
DDRB = 0b00001000;
while (1) {
// flash# 1:
// set PB3 high
PORTB = 0b00001000;
_delay_ms(200);
// set PB3 low
PORTB = 0b00000000;
_delay_ms(200);
// flash# 2:
// set PB3 high
PORTB = 0b00001000;
_delay_ms(1000);
// set PB3 low
PORTB = 0b00000000;
_delay_ms(1000);
// flash# 3:
// set PB3 high
PORTB = 0b00001000;
_delay_ms(3000);
// set PB3 low
PORTB = 0b00000000;
_delay_ms(3000);
}
return 1;
}
|
/* Name: main.c
* Author: <insert your name here>
* Copyright: <insert your copyright message here>
* License: <insert your license reference here>
*/
// A simple blinky program for ATtiny85
// Connect red LED at pin 3 (PB4)
//
#include <avr/io.h>
#include <util/delay.h>
int main (void)
{
// set PB4 to be output
DDRB = 0b00001000;
while (1) {
// flash# 1:
// set PB4 high
PORTB = 0b00010000;
_delay_ms(200);
// set PB4 low
PORTB = 0b00000000;
_delay_ms(200);
// flash# 2:
// set PB4 high
PORTB = 0b00010000;
_delay_ms(1000);
// set PB4 low
PORTB = 0b00000000;
_delay_ms(1000);
// flash# 3:
// set PB4 high
PORTB = 0b00010000;
_delay_ms(3000);
// set PB4 low
PORTB = 0b00000000;
_delay_ms(3000);
}
return 1;
}
|
Change blink program to use pb4 since that's the pin the test LED is wired to on my programming board
|
Change blink program to use pb4 since that's the pin the test LED
is wired to on my programming board
|
C
|
mit
|
thecav/avr-projects
|
b22391787ec21c5d40e545a59ad5780ea8f03868
|
chrome/gpu/gpu_config.h
|
chrome/gpu/gpu_config.h
|
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_GPU_GPU_CONFIG_H_
#define CHROME_GPU_GPU_CONFIG_H_
// This file declares common preprocessor configuration for the GPU process.
#include "build/build_config.h"
#if defined(OS_LINUX) && !defined(ARCH_CPU_X86)
// Only define GLX support for Intel CPUs for now until we can get the
// proper dependencies and build setup for ARM.
#define GPU_USE_GLX
#endif
#endif // CHROME_GPU_GPU_CONFIG_H_
|
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_GPU_GPU_CONFIG_H_
#define CHROME_GPU_GPU_CONFIG_H_
// This file declares common preprocessor configuration for the GPU process.
#include "build/build_config.h"
#if defined(OS_LINUX) && defined(ARCH_CPU_X86)
// Only define GLX support for Intel CPUs for now until we can get the
// proper dependencies and build setup for ARM.
#define GPU_USE_GLX
#endif
#endif // CHROME_GPU_GPU_CONFIG_H_
|
Fix stupid error for Linux build.
|
Fix stupid error for Linux build.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/555096
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@37093 0039d316-1c4b-4281-b951-d872f2087c98
|
C
|
bsd-3-clause
|
ropik/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,gavinp/chromium,ropik/chromium,ropik/chromium,yitian134/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,adobe/chromium,yitian134/chromium,ropik/chromium,ropik/chromium,yitian134/chromium,gavinp/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,gavinp/chromium,adobe/chromium
|
947c20e1a982439cc3682234b34c8d3611d9251c
|
src/lassert.h
|
src/lassert.h
|
/*
* Copyright (C) 2007
* Jacob Berkman
* Copyright (C) 2008
* Ludovic Rousseau <ludovic.rousseau@free.fr>
*/
#ifndef LASSERT_H
#define LASSERT_H
#include <stdio.h>
#include <stdlib.h>
#if 0
#define FAIL exit (1)
#else
#define FAIL return 1
#endif
#define LASSERT(cond) \
({ \
if (cond) \
; \
else { \
fprintf (stderr, "%s:%d: assertion FAILED: " #cond "\n", \
__FILE__, __LINE__); \
FAIL; \
} \
})
#define LASSERTF(cond, fmt, a...) \
({ \
if (cond) \
; \
else { \
fprintf (stderr, "%s:%d: assertion FAILED: " #cond ": " fmt, \
__FILE__, __LINE__, ## a); \
FAIL; \
} \
})
#endif /* LASSERT_H */
|
/*
* Copyright (C) 2007
* Jacob Berkman
* Copyright (C) 2008
* Ludovic Rousseau <ludovic.rousseau@free.fr>
*/
#ifndef LASSERT_H
#define LASSERT_H
#include <stdio.h>
#include <stdlib.h>
#if 0
#define FAIL exit (1)
#else
#define FAIL return 1
#endif
#define LASSERT(cond) \
({ \
if (! (cond)) \
{ \
fprintf (stderr, "%s:%d: assertion FAILED: " #cond "\n", \
__FILE__, __LINE__); \
FAIL; \
} \
})
#define LASSERTF(cond, fmt, a...) \
({ \
if (! (cond)) \
{ \
fprintf (stderr, "%s:%d: assertion FAILED: " #cond ": " fmt, \
__FILE__, __LINE__, ## a); \
FAIL; \
} \
})
#endif /* LASSERT_H */
|
Fix splint error src/pcsc-wirecheck-dist.c:19:164: Body of if clause of if statement is empty
|
Fix splint error
src/pcsc-wirecheck-dist.c:19:164: Body of if clause of if statement is empty
git-svn-id: f2d781e409b7e36a714fc884bb9b2fc5091ddd28@4755 0ce88b0d-b2fd-0310-8134-9614164e65ea
|
C
|
bsd-3-clause
|
vicamo/pcsc-lite-android,vicamo/pcsc-lite-android,vicamo/pcsc-lite-android,vicamo/pcsc-lite-android,vicamo/pcsc-lite-android
|
3fb9e3a841f15e5c84a860f5a3836fce628adfea
|
genlib/delput.c
|
genlib/delput.c
|
void
delput(float x, float *a, int *l)
{
/* put value in delay line. See delset. x is float */
*(a + (*l)++) = x;
if(*(l) >= *(l+1)) *l -= *(l+1);
}
|
/* put value in delay line. See delset. x is float */
void
delput(float x, float *a, int *l)
{
int index = l[0];
a[index] = x;
l[0]++;
if (l[0] >= l[2])
l[0] -= l[2];
}
|
Update to new bookkeeping array format.
|
Update to new bookkeeping array format.
|
C
|
apache-2.0
|
RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix
|
21bdc56b1b94dcfc9badf80b544ac7b28155aa18
|
include/error.h
|
include/error.h
|
#ifndef CPR_ERROR_H
#define CPR_ERROR_H
#include <string>
#include "cprtypes.h"
#include "defines.h"
namespace cpr {
enum class ErrorCode {
OK = 0,
CONNECTION_FAILURE,
EMPTY_RESPONSE,
HOST_RESOLUTION_FAILURE,
INTERNAL_ERROR,
INVALID_URL_FORMAT,
NETWORK_RECEIVE_ERROR,
NETWORK_SEND_FAILURE,
OPERATION_TIMEDOUT,
PROXY_RESOLUTION_FAILURE,
SSL_CONNECT_ERROR,
SSL_LOCAL_CERTIFICATE_ERROR,
SSL_REMOTE_CERTIFICATE_ERROR,
SSL_CACERT_ERROR,
GENERIC_SSL_ERROR,
UNSUPPORTED_PROTOCOL,
UNKNOWN_ERROR = 1000,
};
class Error {
public:
Error() : code{ErrorCode::OK} {}
template <typename TextType>
Error(const ErrorCode& p_error_code, TextType&& p_error_message)
: code{p_error_code}, message{CPR_FWD(p_error_message)} {}
explicit operator bool() const {
return code != ErrorCode::OK;
}
ErrorCode code;
std::string message;
private:
static ErrorCode getErrorCodeForCurlError(int curl_code);
};
} // namespace cpr
#endif
|
#ifndef CPR_ERROR_H
#define CPR_ERROR_H
#include <string>
#include "cprtypes.h"
#include "defines.h"
namespace cpr {
enum class ErrorCode {
OK = 0,
CONNECTION_FAILURE,
EMPTY_RESPONSE,
HOST_RESOLUTION_FAILURE,
INTERNAL_ERROR,
INVALID_URL_FORMAT,
NETWORK_RECEIVE_ERROR,
NETWORK_SEND_FAILURE,
OPERATION_TIMEDOUT,
PROXY_RESOLUTION_FAILURE,
SSL_CONNECT_ERROR,
SSL_LOCAL_CERTIFICATE_ERROR,
SSL_REMOTE_CERTIFICATE_ERROR,
SSL_CACERT_ERROR,
GENERIC_SSL_ERROR,
UNSUPPORTED_PROTOCOL,
UNKNOWN_ERROR = 1000,
};
class Error {
public:
Error() : code{ErrorCode::OK} {}
template <typename TextType>
Error(const int& curl_code, TextType&& p_error_message)
: code{getErrorCodeForCurlError(curl_code)}, message{CPR_FWD(p_error_message)} {}
explicit operator bool() const {
return code != ErrorCode::OK;
}
ErrorCode code;
std::string message;
private:
static ErrorCode getErrorCodeForCurlError(int curl_code);
};
} // namespace cpr
#endif
|
Make constructor for taking in curl code as the first argument
|
Make constructor for taking in curl code as the first argument
|
C
|
mit
|
SuperV1234/cpr,whoshuu/cpr,whoshuu/cpr,SuperV1234/cpr,msuvajac/cpr,whoshuu/cpr,msuvajac/cpr,msuvajac/cpr,SuperV1234/cpr
|
596412310fc7bdf9af2eacfeb4c281d544c2195e
|
include/polar/support/audio/waveshape.h
|
include/polar/support/audio/waveshape.h
|
#pragma once
#include <array>
class WaveShape {
public:
static const unsigned int granularity = 12;
static const int16_t size = 1 << granularity;
std::array<int16_t, size> table = {{0}};
};
inline WaveShape MkSineWaveShape() {
WaveShape waveShape;
for(unsigned int i = 0; i < WaveShape::size; ++i) {
double sample = sin(i * 2.0 * 3.14159265358979 / WaveShape::size);
waveShape.table[i] =
static_cast<int16_t>((sample + 1) * 32767.0 - 32768.0);
}
return waveShape;
}
inline WaveShape MkSquareWaveShape() {
WaveShape waveShape;
for(unsigned int i = 0; i < WaveShape::size; ++i) {
double sample = i * 2 < WaveShape::size ? 1.0 : -1.0;
waveShape.table[i] =
static_cast<int16_t>((sample + 1) * 32767.0 - 32768.0);
}
return waveShape;
}
|
#pragma once
#include <array>
#include <polar/math/constants.h>
class WaveShape {
public:
static const unsigned int granularity = 12;
static const int16_t size = 1 << granularity;
std::array<int16_t, size> table = {{0}};
};
inline WaveShape MkSineWaveShape() {
WaveShape waveShape;
for(unsigned int i = 0; i < WaveShape::size; ++i) {
double sample = sin(i * polar::math::TWO_PI / WaveShape::size);
waveShape.table[i] =
static_cast<int16_t>((sample + 1) * 32767.0 - 32768.0);
}
return waveShape;
}
inline WaveShape MkSquareWaveShape() {
WaveShape waveShape;
for(unsigned int i = 0; i < WaveShape::size; ++i) {
double sample = i * 2 < WaveShape::size ? 1.0 : -1.0;
waveShape.table[i] =
static_cast<int16_t>((sample + 1) * 32767.0 - 32768.0);
}
return waveShape;
}
|
Use TWO_PI constant instead of literal
|
Use TWO_PI constant instead of literal
|
C
|
mpl-2.0
|
shockkolate/polar4,polar-engine/polar,polar-engine/polar,shockkolate/polar4,shockkolate/polar4,shockkolate/polar4
|
faec0b3de34380c9d15033ef8e2d4b62dc2a3691
|
cbits/hdbc-odbc-helper.c
|
cbits/hdbc-odbc-helper.c
|
#include "hdbc-odbc-helper.h"
#include <sqlext.h>
#include <stdio.h>
#include <stdlib.h>
SQLLEN nullDataHDBC = SQL_NULL_DATA;
int sqlSucceeded(SQLRETURN ret) {
return SQL_SUCCEEDED(ret);
}
void *getSqlOvOdbc3(void) {
return (void *)SQL_OV_ODBC3;
}
SQLRETURN simpleSqlTables(SQLHSTMT stmt) {
return SQLTables(stmt, NULL, 0, NULL, 0, "%", 1, "TABLE", 5);
}
SQLRETURN simpleSqlColumns(SQLHSTMT stmt, SQLCHAR *tablename,
SQLSMALLINT tnlen) {
return SQLColumns(stmt, NULL, 0, NULL, 0, tablename, tnlen, "%", 1);
}
|
#include "hdbc-odbc-helper.h"
#include <sqlext.h>
#include <stdio.h>
#include <stdlib.h>
SQLLEN nullDataHDBC = SQL_NULL_DATA;
int sqlSucceeded(SQLRETURN ret) {
return SQL_SUCCEEDED(ret);
}
void *getSqlOvOdbc3(void) {
return (void *)SQL_OV_ODBC3;
}
SQLRETURN simpleSqlTables(SQLHSTMT stmt) {
return SQLTables(stmt, NULL, 0, NULL, 0, (SQLCHAR *)"%", 1, (SQLCHAR *)"TABLE", 5);
}
SQLRETURN simpleSqlColumns(SQLHSTMT stmt, SQLCHAR *tablename,
SQLSMALLINT tnlen) {
return SQLColumns(stmt, NULL, 0, NULL, 0, tablename, tnlen, (SQLCHAR *)"%", 1);
}
|
Add explicit cast from (const char []) to (SQLCHAR *)
|
Add explicit cast from (const char []) to (SQLCHAR *)
|
C
|
bsd-3-clause
|
hdbc/hdbc-odbc
|
4263a8238353aeef9721f826c5b6c55d81ddca1f
|
src/shacpuid.c
|
src/shacpuid.c
|
/**
* cpuid.c
*
* Checks if CPU has support of SHA instructions
*
* @author kryukov@frtk.ru
* @version 4.0
*
* For Putty AES NI project
* http://putty-aes-ni.googlecode.com/
*/
#ifndef SILENT
#include <stdio.h>
#endif
#if defined(__clang__) || defined(__GNUC__)
#include <cpuid.h>
static int CheckCPUsupportSHA()
{
unsigned int CPUInfo[4];
__cpuid_count(7, 0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
return CPUInfo[1] & (1 << 29); /* Check SHA */
}
#else /* defined(__clang__) || defined(__GNUC__) */
static int CheckCPUsupportSHA()
{
unsigned int CPUInfo[4];
__cpuidex(CPUInfo, 7, 0);
return CPUInfo[1] & (1 << 29); /* Check SHA */
}
#endif /* defined(__clang__) || defined(__GNUC__) */
int main(int argc, char ** argv)
{
const int res = !CheckCPUsupportSHA();
#ifndef SILENT
printf("This CPU %s SHA-NI\n", res ? "does not support" : "supports");
#endif
return res;
}
|
/**
* cpuid.c
*
* Checks if CPU has support of SHA instructions
*
* @author kryukov@frtk.ru
* @version 4.0
*
* For Putty AES NI project
* http://putty-aes-ni.googlecode.com/
*/
#ifndef SILENT
#include <stdio.h>
#endif
#if defined(__clang__) || defined(__GNUC__)
#include <cpuid.h>
static int CheckCPUsupportSHA()
{
unsigned int CPUInfo[4];
__cpuid(0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
if (CPUInfo[0] < 7)
return 0;
__cpuid_count(7, 0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
return CPUInfo[1] & (1 << 29); /* Check SHA */
}
#else /* defined(__clang__) || defined(__GNUC__) */
static int CheckCPUsupportSHA()
{
unsigned int CPUInfo[4];
__cpuid(CPUInfo, 0);
if (CPUInfo[0] < 7)
return 0;
__cpuidex(CPUInfo, 7, 0);
return CPUInfo[1] & (1 << 29); /* Check SHA */
}
#endif /* defined(__clang__) || defined(__GNUC__) */
int main(int argc, char ** argv)
{
const int res = !CheckCPUsupportSHA();
#ifndef SILENT
printf("This CPU %s SHA-NI\n", res ? "does not support" : "supports");
#endif
return res;
}
|
Add leaf checks to SHA CPUID checks
|
Add leaf checks to SHA CPUID checks
|
C
|
mit
|
pavelkryukov/putty-aes-ni,pavelkryukov/putty-aes-ni
|
9be7ffc5fc9e54253f2b82ff6ff4c68ea816dd88
|
include/picrin/gc.h
|
include/picrin/gc.h
|
/**
* See Copyright Notice in picrin.h
*/
#ifndef GC_H__
#define GC_H__
#if defined(__cplusplus)
extern "C" {
#endif
enum pic_gc_mark {
PIC_GC_UNMARK = 0,
PIC_GC_MARK
};
union header {
struct {
union header *ptr;
size_t size;
enum pic_gc_mark mark : 1;
} s;
long alignment[2];
};
struct heap_page {
union header *basep, *endp;
struct heap_page *next;
};
struct pic_heap {
union header base, *freep;
struct heap_page *pages;
};
void init_heap(struct pic_heap *);
void finalize_heap(struct pic_heap *);
#if defined(__cplusplus)
}
#endif
#endif
|
/**
* See Copyright Notice in picrin.h
*/
#ifndef GC_H__
#define GC_H__
#if defined(__cplusplus)
extern "C" {
#endif
#define PIC_GC_UNMARK 0
#define PIC_GC_MARK 1
union header {
struct {
union header *ptr;
size_t size;
unsigned int mark : 1;
} s;
long alignment[2];
};
struct heap_page {
union header *basep, *endp;
struct heap_page *next;
};
struct pic_heap {
union header base, *freep;
struct heap_page *pages;
};
void init_heap(struct pic_heap *);
void finalize_heap(struct pic_heap *);
#if defined(__cplusplus)
}
#endif
#endif
|
Define the type of marking flags as unsigned int.
|
Define the type of marking flags as unsigned int.
We could define it as _Bool since we are going to use C99, but unsigned
int is more portable (even in C89!) and extensible (when we decide to
use tri-color marking GC.)
Signed-off-by: OGINO Masanori <c49462fef669560e618607913e6c283f7627123c@gmail.com>
|
C
|
mit
|
dcurrie/picrin,leavesbnw/picrin,omasanori/picrin,picrin-scheme/picrin,koba-e964/picrin,ktakashi/picrin,omasanori/picrin,picrin-scheme/picrin,koba-e964/picrin,dcurrie/picrin,koba-e964/picrin,leavesbnw/picrin,leavesbnw/picrin,ktakashi/picrin,ktakashi/picrin
|
298143ebdfd55f83c7493760bf3d844a4ac8325a
|
include/core/SkMilestone.h
|
include/core/SkMilestone.h
|
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 63
#endif
|
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 64
#endif
|
Update Skia milestone to 64
|
Update Skia milestone to 64
Bug: skia:
Change-Id: I381323606f92a5388b3fd76c232e35c492a23dc4
Reviewed-on: https://skia-review.googlesource.com/58840
Reviewed-by: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>
Commit-Queue: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>
|
C
|
bsd-3-clause
|
google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,rubenvb/skia,google/skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,rubenvb/skia,rubenvb/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,google/skia,rubenvb/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,rubenvb/skia,rubenvb/skia,rubenvb/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,Hikari-no-Tenshi/android_external_skia,google/skia,rubenvb/skia,google/skia,HalCanary/skia-hc,rubenvb/skia,google/skia
|
deac801de98be4974cfe806eb4bc072f34f81cc5
|
include/git2/checkout.h
|
include/git2/checkout.h
|
/*
* Copyright (C) 2012 the libgit2 contributors
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_git_checkout_h__
#define INCLUDE_git_checkout_h__
#include "common.h"
#include "types.h"
#include "indexer.h"
/**
* @file git2/checkout.h
* @brief Git checkout routines
* @defgroup git_checkout Git checkout routines
* @ingroup Git
* @{
*/
GIT_BEGIN_DECL
/**
* Updates files in the working tree to match the version in the index
* or HEAD.
*
* @param repo repository to check out (must be non-bare)
* @param origin_url repository to clone from
* @param workdir_path local directory to clone to
* @param stats pointer to structure that receives progress information (may be NULL)
* @return 0 on success, GIT_ERROR otherwise (use git_error_last for information about the error)
*/
GIT_EXTERN(int) git_checkout_force(git_repository *repo, git_indexer_stats *stats);
/** @} */
GIT_END_DECL
#endif
|
/*
* Copyright (C) 2012 the libgit2 contributors
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_git_checkout_h__
#define INCLUDE_git_checkout_h__
#include "common.h"
#include "types.h"
#include "indexer.h"
/**
* @file git2/checkout.h
* @brief Git checkout routines
* @defgroup git_checkout Git checkout routines
* @ingroup Git
* @{
*/
GIT_BEGIN_DECL
/**
* Updates files in the working tree to match the version in the index.
*
* @param repo repository to check out (must be non-bare)
* @param stats pointer to structure that receives progress information (may be NULL)
* @return 0 on success, GIT_ERROR otherwise (use git_error_last for information about the error)
*/
GIT_EXTERN(int) git_checkout_force(git_repository *repo, git_indexer_stats *stats);
/** @} */
GIT_END_DECL
#endif
|
Fix documentation comment to match actual params.
|
Fix documentation comment to match actual params.
|
C
|
lgpl-2.1
|
jeffhostetler/public_libgit2,kenprice/libgit2,raybrad/libit2,mrksrm/Mingijura,Snazz2001/libgit2,Tousiph/Demo1,magnus98/TEST,claudelee/libgit2,Aorjoa/libgit2_maked_lib,nokiddin/libgit2,claudelee/libgit2,chiayolin/libgit2,rcorre/libgit2,yosefhackmon/libgit2,linquize/libgit2,sygool/libgit2,ardumont/libgit2,jflesch/libgit2-mariadb,yosefhackmon/libgit2,Tousiph/Demo1,claudelee/libgit2,kenprice/libgit2,skabel/manguse,KTXSoftware/libgit2,yosefhackmon/libgit2,mingyaaaa/libgit2,dleehr/libgit2,claudelee/libgit2,maxiaoqian/libgit2,spraints/libgit2,stewid/libgit2,maxiaoqian/libgit2,iankronquist/libgit2,oaastest/libgit2,kissthink/libgit2,yongthecoder/libgit2,sygool/libgit2,mcanthony/libgit2,jeffhostetler/public_libgit2,sygool/libgit2,linquize/libgit2,ardumont/libgit2,swisspol/DEMO-libgit2,KTXSoftware/libgit2,swisspol/DEMO-libgit2,saurabhsuniljain/libgit2,stewid/libgit2,KTXSoftware/libgit2,mrksrm/Mingijura,leoyanggit/libgit2,jflesch/libgit2-mariadb,mcanthony/libgit2,jeffhostetler/public_libgit2,since2014/libgit2,magnus98/TEST,skabel/manguse,mcanthony/libgit2,iankronquist/libgit2,sygool/libgit2,whoisj/libgit2,linquize/libgit2,JIghtuse/libgit2,oaastest/libgit2,jamieleecool/ptest,magnus98/TEST,Snazz2001/libgit2,nacho/libgit2,dleehr/libgit2,whoisj/libgit2,jflesch/libgit2-mariadb,iankronquist/libgit2,amyvmiwei/libgit2,Snazz2001/libgit2,sim0629/libgit2,iankronquist/libgit2,saurabhsuniljain/libgit2,Snazz2001/libgit2,magnus98/TEST,falqas/libgit2,skabel/manguse,oaastest/libgit2,MrHacky/libgit2,amyvmiwei/libgit2,evhan/libgit2,jamieleecool/ptest,kissthink/libgit2,zodiac/libgit2.js,maxiaoqian/libgit2,maxiaoqian/libgit2,linquize/libgit2,yongthecoder/libgit2,joshtriplett/libgit2,saurabhsuniljain/libgit2,amyvmiwei/libgit2,maxiaoqian/libgit2,maxiaoqian/libgit2,swisspol/DEMO-libgit2,Aorjoa/libgit2_maked_lib,leoyanggit/libgit2,iankronquist/libgit2,since2014/libgit2,t0xicCode/libgit2,t0xicCode/libgit2,evhan/libgit2,KTXSoftware/libgit2,jeffhostetler/public_libgit2,whoisj/libgit2,chiayolin/libgit2,Tousiph/Demo1,mhp/libgit2,saurabhsuniljain/libgit2,zodiac/libgit2.js,raybrad/libit2,JIghtuse/libgit2,Aorjoa/libgit2_maked_lib,sim0629/libgit2,Aorjoa/libgit2_maked_lib,since2014/libgit2,spraints/libgit2,Corillian/libgit2,mhp/libgit2,nokiddin/libgit2,zodiac/libgit2.js,saurabhsuniljain/libgit2,Snazz2001/libgit2,swisspol/DEMO-libgit2,leoyanggit/libgit2,mrksrm/Mingijura,rcorre/libgit2,leoyanggit/libgit2,sygool/libgit2,zodiac/libgit2.js,skabel/manguse,whoisj/libgit2,ardumont/libgit2,ardumont/libgit2,leoyanggit/libgit2,t0xicCode/libgit2,MrHacky/libgit2,dleehr/libgit2,spraints/libgit2,nokiddin/libgit2,yosefhackmon/libgit2,mhp/libgit2,nacho/libgit2,evhan/libgit2,linquize/libgit2,chiayolin/libgit2,JIghtuse/libgit2,claudelee/libgit2,t0xicCode/libgit2,MrHacky/libgit2,Corillian/libgit2,mcanthony/libgit2,nokiddin/libgit2,kissthink/libgit2,whoisj/libgit2,spraints/libgit2,jamieleecool/ptest,falqas/libgit2,kissthink/libgit2,chiayolin/libgit2,stewid/libgit2,rcorre/libgit2,oaastest/libgit2,t0xicCode/libgit2,mrksrm/Mingijura,falqas/libgit2,joshtriplett/libgit2,falqas/libgit2,Tousiph/Demo1,skabel/manguse,nacho/libgit2,mcanthony/libgit2,stewid/libgit2,chiayolin/libgit2,jflesch/libgit2-mariadb,mingyaaaa/libgit2,rcorre/libgit2,claudelee/libgit2,kenprice/libgit2,Snazz2001/libgit2,Tousiph/Demo1,nokiddin/libgit2,sim0629/libgit2,chiayolin/libgit2,kenprice/libgit2,dleehr/libgit2,yongthecoder/libgit2,raybrad/libit2,mingyaaaa/libgit2,MrHacky/libgit2,dleehr/libgit2,joshtriplett/libgit2,sim0629/libgit2,Corillian/libgit2,Aorjoa/libgit2_maked_lib,mingyaaaa/libgit2,iankronquist/libgit2,nacho/libgit2,joshtriplett/libgit2,sygool/libgit2,spraints/libgit2,mingyaaaa/libgit2,sim0629/libgit2,swisspol/DEMO-libgit2,rcorre/libgit2,KTXSoftware/libgit2,skabel/manguse,MrHacky/libgit2,jeffhostetler/public_libgit2,evhan/libgit2,stewid/libgit2,raybrad/libit2,kenprice/libgit2,since2014/libgit2,kissthink/libgit2,mcanthony/libgit2,Corillian/libgit2,mingyaaaa/libgit2,JIghtuse/libgit2,yongthecoder/libgit2,raybrad/libit2,ardumont/libgit2,zodiac/libgit2.js,joshtriplett/libgit2,jflesch/libgit2-mariadb,oaastest/libgit2,JIghtuse/libgit2,joshtriplett/libgit2,yosefhackmon/libgit2,saurabhsuniljain/libgit2,KTXSoftware/libgit2,swisspol/DEMO-libgit2,mrksrm/Mingijura,rcorre/libgit2,amyvmiwei/libgit2,t0xicCode/libgit2,falqas/libgit2,since2014/libgit2,jflesch/libgit2-mariadb,mrksrm/Mingijura,yosefhackmon/libgit2,Corillian/libgit2,linquize/libgit2,mhp/libgit2,JIghtuse/libgit2,magnus98/TEST,mhp/libgit2,yongthecoder/libgit2,Corillian/libgit2,ardumont/libgit2,amyvmiwei/libgit2,Tousiph/Demo1,stewid/libgit2,magnus98/TEST,mhp/libgit2,MrHacky/libgit2,leoyanggit/libgit2,jamieleecool/ptest,spraints/libgit2,since2014/libgit2,kissthink/libgit2,nokiddin/libgit2,jeffhostetler/public_libgit2,dleehr/libgit2,amyvmiwei/libgit2,oaastest/libgit2,whoisj/libgit2,kenprice/libgit2,yongthecoder/libgit2,sim0629/libgit2,falqas/libgit2
|
3ad1e0624ea2b38329fb3e2ff0ddaaeec89d13a7
|
SocketIOJSONSerialization.h
|
SocketIOJSONSerialization.h
|
//
// SocketIOJSONSerialization.h
// v0.22 ARC
//
// based on
// socketio-cocoa https://github.com/fpotter/socketio-cocoa
// by Fred Potter <fpotter@pieceable.com>
//
// using
// https://github.com/square/SocketRocket
// https://github.com/stig/json-framework/
//
// reusing some parts of
// /socket.io/socket.io.js
//
// Created by Philipp Kyeck http://beta-interactive.de
//
// Updated by
// samlown https://github.com/samlown
// kayleg https://github.com/kayleg
//
#import <Foundation/Foundation.h>
@interface SocketIOJSONSerialization
+ (id) objectFromJSONData:(NSData *)data error:(NSError **)error;
+ (NSString *) JSONStringFromObject:(id)object error:(NSError **)error;
@end
|
//
// SocketIOJSONSerialization.h
// v0.22 ARC
//
// based on
// socketio-cocoa https://github.com/fpotter/socketio-cocoa
// by Fred Potter <fpotter@pieceable.com>
//
// using
// https://github.com/square/SocketRocket
// https://github.com/stig/json-framework/
//
// reusing some parts of
// /socket.io/socket.io.js
//
// Created by Philipp Kyeck http://beta-interactive.de
//
// Updated by
// samlown https://github.com/samlown
// kayleg https://github.com/kayleg
//
#import <Foundation/Foundation.h>
@interface SocketIOJSONSerialization : NSObject
+ (id) objectFromJSONData:(NSData *)data error:(NSError **)error;
+ (NSString *) JSONStringFromObject:(id)object error:(NSError **)error;
@end
|
Fix for totally bogus interface declaration
|
Fix for totally bogus interface declaration
In my rush to refactor JSON serialization, I made a new class that doesn't inherit from NSObject. Why this
is a) allowed, b) doesn't result in epic failure on OS X is beyond me.
|
C
|
mit
|
diy/socket.IO-objc,wait10000y/socket.IO-objc,francoisp/socket.IO-objc,vgmoose/ProxiChat
|
ba649056cf506b2b6e80f58f0b71d32468f85d34
|
src/host/os_rmdir.c
|
src/host/os_rmdir.c
|
/**
* \file os_rmdir.c
* \brief Remove a subdirectory.
* \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
*/
#include <stdlib.h>
#include "premake.h"
int os_rmdir(lua_State* L)
{
int z;
const char* path = luaL_checkstring(L, 1);
#if PLATFORM_WINDOWS
z = RemoveDirectory(path);
#else
z = rmdir(path);
#endif
if (!z)
{
lua_pushnil(L);
lua_pushfstring(L, "unable to remove directory '%s'", path);
return 2;
}
else
{
lua_pushboolean(L, 1);
return 1;
}
}
|
/**
* \file os_rmdir.c
* \brief Remove a subdirectory.
* \author Copyright (c) 2002-2013 Jason Perkins and the Premake project
*/
#include <stdlib.h>
#include "premake.h"
int os_rmdir(lua_State* L)
{
int z;
const char* path = luaL_checkstring(L, 1);
#if PLATFORM_WINDOWS
z = RemoveDirectory(path);
#else
z = (0 == rmdir(path));
#endif
if (!z)
{
lua_pushnil(L);
lua_pushfstring(L, "unable to remove directory '%s'", path);
return 2;
}
else
{
lua_pushboolean(L, 1);
return 1;
}
}
|
Fix error result handling in os.rmdir()
|
Fix error result handling in os.rmdir()
|
C
|
bsd-3-clause
|
dimitarcl/premake-dev,dimitarcl/premake-dev,dimitarcl/premake-dev
|
54d49c21102d0a37d72b795be125640b8ab3d4b4
|
includes/linux/InotifyService.h
|
includes/linux/InotifyService.h
|
#ifndef INOTIFY_EVENT_HANDLER_H
#define INOTIFY_EVENT_HANDLER_H
#include "InotifyEventLoop.h"
#include "InotifyTree.h"
#include <queue>
#include <map>
#include <iostream>
class InotifyEventLoop;
class InotifyTree;
class InotifyService {
public:
InotifyService(std::string path);
~InotifyService();
void create(int wd, std::string name);
void createDirectory(int wd, std::string name);
void modify(int wd, std::string name);
void remove(int wd, std::string name);
void removeDirectory(int wd);
void rename(int wd, std::string oldName, std::string newName);
void renameDirectory(int wd, std::string oldName, std::string newName);
private:
void createDirectoryTree(std::string directoryTreePath);
InotifyEventLoop *mEventLoop;
InotifyTree *mTree;
int mInotifyInstance;
int mAttributes;
};
#endif
|
#ifndef INOTIFY_EVENT_HANDLER_H
#define INOTIFY_EVENT_HANDLER_H
#include "InotifyEventLoop.h"
#include "InotifyTree.h"
#include <queue>
#include <map>
#include <iostream>
class InotifyEventLoop;
class InotifyTree;
class InotifyService {
public:
InotifyService(std::string path);
~InotifyService();
private:
void create(int wd, std::string name);
void createDirectory(int wd, std::string name);
void createDirectoryTree(std::string directoryTreePath);
void modify(int wd, std::string name);
void remove(int wd, std::string name);
void removeDirectory(int wd);
void rename(int wd, std::string oldName, std::string newName);
void renameDirectory(int wd, std::string oldName, std::string newName);
InotifyEventLoop *mEventLoop;
InotifyTree *mTree;
int mInotifyInstance;
int mAttributes;
friend class InotifyEventLoop;
};
#endif
|
Hide internal methods using friend class specifier
|
Hide internal methods using friend class specifier
|
C
|
mit
|
Axosoft/node-sentinel-file-watcher,Axosoft/nsfw,Axosoft/nsfw,Axosoft/nsfw,Axosoft/node-sentinel-file-watcher,Axosoft/node-sentinel-file-watcher,Axosoft/node-sentinel-file-watcher
|
c5f51ac16b113923162c442e1234223ab528c7d4
|
src/include/gnugol_engines.h
|
src/include/gnugol_engines.h
|
#ifndef _gnugol_engines
#define _gnugol_engines 1
#ifdef DEBUG_SHAREDLIBS
# define GNUGOL_SHAREDLIBDIR "../engines"
#else
# define GNUGOL_SHAREDLIBDIR "/var/lib/gnugol"
#endif
typedef struct ggengine
{
Node node;
void *lib;
const char *name;
int (*setup) (QueryOptions_t *);
int (*search)(QueryOptions_t *);
} *GnuGolEngine;
GnuGoldEngine gnugol_engine_load (const char *);
int gnugol_engine_query (GnuGolEngine,QueryOptions_t *);
void gnugol_engine_unload (GnuGolEngine);
int gnugol_read_key (char *const,size_t *const,const char *const);
#endif
|
#ifndef _gnugol_engines
#define _gnugol_engines 1
#include "nodelist.h"
#ifdef DEBUG_SHAREDLIBS
# define GNUGOL_SHAREDLIBDIR "../engines"
#else
# define GNUGOL_SHAREDLIBDIR "/var/lib/gnugol"
#endif
typedef struct ggengine
{
Node node;
void *lib;
const char *name;
int (*setup) (QueryOptions_t *);
int (*search)(QueryOptions_t *);
} *GnuGolEngine;
GnuGolEngine gnugol_engine_load (const char *);
int gnugol_engine_query (GnuGolEngine,QueryOptions_t *);
void gnugol_engine_unload (GnuGolEngine);
int gnugol_read_key (char *const,size_t *const,const char *const);
#endif
|
Include nodelist here, and fix a typo.
|
Include nodelist here, and fix a typo.
|
C
|
agpl-3.0
|
dtaht/Gnugol,dtaht/Gnugol,dtaht/Gnugol,dtaht/Gnugol
|
5eee834e48af66e851b8d5c96cf07e7b1ab214da
|
src/lib-dict/dict-register.c
|
src/lib-dict/dict-register.c
|
/* Copyright (c) 2013-2015 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "dict-private.h"
void dict_drivers_register_builtin(void)
{
dict_driver_register(&dict_driver_client);
dict_driver_register(&dict_driver_file);
dict_driver_register(&dict_driver_fs);
dict_driver_register(&dict_driver_memcached);
dict_driver_register(&dict_driver_memcached_ascii);
dict_driver_register(&dict_driver_redis);
}
void dict_drivers_unregister_builtin(void)
{
dict_driver_unregister(&dict_driver_client);
dict_driver_unregister(&dict_driver_file);
dict_driver_unregister(&dict_driver_fs);
dict_driver_unregister(&dict_driver_memcached);
dict_driver_unregister(&dict_driver_memcached_ascii);
dict_driver_unregister(&dict_driver_redis);
}
|
/* Copyright (c) 2013-2015 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "dict-private.h"
static int refcount = 0;
void dict_drivers_register_builtin(void)
{
if (refcount++ > 0)
return;
dict_driver_register(&dict_driver_client);
dict_driver_register(&dict_driver_file);
dict_driver_register(&dict_driver_fs);
dict_driver_register(&dict_driver_memcached);
dict_driver_register(&dict_driver_memcached_ascii);
dict_driver_register(&dict_driver_redis);
}
void dict_drivers_unregister_builtin(void)
{
if (--refcount > 0)
return;
dict_driver_unregister(&dict_driver_client);
dict_driver_unregister(&dict_driver_file);
dict_driver_unregister(&dict_driver_fs);
dict_driver_unregister(&dict_driver_memcached);
dict_driver_unregister(&dict_driver_memcached_ascii);
dict_driver_unregister(&dict_driver_redis);
}
|
Allow registering builtin dict drivers multiple times.
|
lib-dict: Allow registering builtin dict drivers multiple times.
|
C
|
mit
|
LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot
|
2e6b091c2b103ef23a52e9592714a70126cde6df
|
libevmjit/Utils.h
|
libevmjit/Utils.h
|
#pragma once
#include <iostream>
// The same as assert, but expression is always evaluated and result returned
#define CHECK(expr) (assert(expr), expr)
#if !defined(NDEBUG) // Debug
namespace dev
{
namespace evmjit
{
std::ostream& getLogStream(char const* _channel);
}
}
#define DLOG(CHANNEL) ::dev::evmjit::getLogStream(#CHANNEL)
#else // Release
#define DLOG(CHANNEL) true ? std::cerr : std::cerr
#endif
|
#pragma once
#include <iostream>
// The same as assert, but expression is always evaluated and result returned
#define CHECK(expr) (assert(expr), expr)
#if !defined(NDEBUG) // Debug
namespace dev
{
namespace evmjit
{
std::ostream& getLogStream(char const* _channel);
}
}
#define DLOG(CHANNEL) ::dev::evmjit::getLogStream(#CHANNEL)
#else // Release
namespace dev
{
namespace evmjit
{
struct Voider
{
void operator=(std::ostream const&) {}
};
}
}
#define DLOG(CHANNEL) true ? (void)0 : ::dev::evmjit::Voider{} = std::cerr
#endif
|
Reimplement no-op version of DLOG to avoid C++ compiler warning
|
Reimplement no-op version of DLOG to avoid C++ compiler warning
|
C
|
mit
|
ethereum/evmjit,ethereum/evmjit,ethereum/evmjit
|
3771abc38413dca7aee39a9005f3d808b440538c
|
JPetUnpacker/Unpacker2/TDCChannel.h
|
JPetUnpacker/Unpacker2/TDCChannel.h
|
#ifndef TDCChannel_h
#define TDCChannel_h
#include <fstream>
#include <TObject.h>
#include <TClonesArray.h>
#include <iostream>
#define MAX_FULL_HITS 100
class TDCChannel : public TObject {
protected:
Int_t channel;
double leadTime1;
double trailTime1;
double tot1;
double referenceDiff1;
double leadTimes[MAX_FULL_HITS];
double trailTimes[MAX_FULL_HITS];
double tots[MAX_FULL_HITS];
double referenceDiffs[MAX_FULL_HITS];
int hitsNum;
public:
TDCChannel();
~TDCChannel();
void SetChannel(Int_t channel) { this->channel = channel; }
int GetChannel() { return channel; }
int GetHitsNum() { return hitsNum; }
void AddHit(double lead, double trail, double ref);
void AddHit(double lead, double trail);
double GetLeadTime1() { return leadTime1; }
double GetLeadTime(int mult) { return leadTimes[mult]; }
double GetTrailTime1() { return trailTime1; }
double GetTrailTime(int mult) { return trailTimes[mult]; }
double GetTOT1() { return tot1; }
int GetMult() { return hitsNum; }
double GetTOT(int mult) { return tots[mult]; }
ClassDef(TDCChannel,1);
};
#endif
|
#ifndef TDCChannel_h
#define TDCChannel_h
#include <fstream>
#include <TObject.h>
#include <TClonesArray.h>
#include <iostream>
#define MAX_FULL_HITS 50
class TDCChannel : public TObject {
protected:
Int_t channel;
double leadTime1;
double trailTime1;
double tot1;
double referenceDiff1;
double leadTimes[MAX_FULL_HITS];
double trailTimes[MAX_FULL_HITS];
double tots[MAX_FULL_HITS];
double referenceDiffs[MAX_FULL_HITS];
int hitsNum;
public:
TDCChannel();
~TDCChannel();
void SetChannel(Int_t channel) { this->channel = channel; }
int GetChannel() { return channel; }
int GetHitsNum() { return hitsNum; }
void AddHit(double lead, double trail, double ref);
void AddHit(double lead, double trail);
double GetLeadTime1() { return leadTime1; }
double GetLeadTime(int mult) { return leadTimes[mult]; }
double GetTrailTime1() { return trailTime1; }
double GetTrailTime(int mult) { return trailTimes[mult]; }
double GetTOT1() { return tot1; }
int GetMult() { return hitsNum; }
double GetTOT(int mult) { return tots[mult]; }
ClassDef(TDCChannel,1);
};
#endif
|
Change TDCHits array size from 100 to 50
|
Change TDCHits array size from 100 to 50
For consistency with the standalone version
of the Unpacker.
|
C
|
apache-2.0
|
alexkernphysiker/j-pet-framework,alexkernphysiker/j-pet-framework,JPETTomography/j-pet-framework,wkrzemien/j-pet-framework,JPETTomography/j-pet-framework,alexkernphysiker/j-pet-framework,alexkernphysiker/j-pet-framework,alexkernphysiker/j-pet-framework,wkrzemien/j-pet-framework,JPETTomography/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework
|
f82cb032e33f6a079c0d18b95fdc3bc41cc66a53
|
PSET2/caesar.c
|
PSET2/caesar.c
|
#include <stdio.h>
#include <cs50.h>
#include <string.h>
#include <ctype.h>
// constant
#define ALPHA_NUM 26
int main(int argc, char *argv[]) {
// check argument number and argument key to be greater than -1
if (argc != 2 || atoi(argv[1]) < 0) {
printf("Usage (k >= 0):\n./caesar k \n");
return 1;
}
int key = atoi(argv[1]) % ALPHA_NUM;
// get plaintext from user
printf("plaintext: ");
string plaintext = get_string();
printf("\n");
// encode plaintext
size_t text_len = strlen(plaintext);
char ciphertext[text_len + 1]; // + 1 for '\0'
for (int i = 0; i < text_len; i++) {
if (isalpha(plaintext[i])) {
if (isupper(plaintext[i])) {
// Uppercase shift
ciphertext[i] = (char) (((plaintext[i] + key - 'A') % ALPHA_NUM) + 'A');
} else {
// Lowercase shift
ciphertext[i] = (char) (((plaintext[i] + key - 'a') % ALPHA_NUM) + 'a');
}
} else {
// Skip non alpha
ciphertext[i] = plaintext[i];
}
}
printf("ciphertext: %s\n", ciphertext);
return 0;
}
|
#include <stdio.h>
#include <cs50.h>
#include <string.h>
#include <ctype.h>
// constant
#define ALPHA_NUM 26
int main(int argc, char *argv[]) {
// check argument number and argument key to be greater than -1
if (argc != 2 || atoi(argv[1]) < 0) {
printf("Usage (k >= 0):\n./caesar k \n");
return 1;
}
int key = atoi(argv[1]) % ALPHA_NUM;
// get plaintext from user
printf("plaintext: ");
string plaintext = get_string();
// encode plaintext
size_t text_len = strlen(plaintext);
char ciphertext[text_len + 1]; // + 1 for '\0'
for (int i = 0; i < text_len; i++) {
if (isalpha(plaintext[i])) {
if (isupper(plaintext[i])) {
// Uppercase shift
ciphertext[i] = (char) (((plaintext[i] + key - 'A') % ALPHA_NUM) + 'A');
} else {
// Lowercase shift
ciphertext[i] = (char) (((plaintext[i] + key - 'a') % ALPHA_NUM) + 'a');
}
} else {
// Skip non alpha
ciphertext[i] = plaintext[i];
}
}
printf("ciphertext: %s\n", ciphertext);
return 0;
}
|
Remove printf for testing with check50
|
Remove printf for testing with check50
|
C
|
unlicense
|
Implaier/CS50,Implaier/CS50,Implaier/CS50,Implaier/CS50
|
474864639946f06abb90a5398c4a881714ac0c15
|
include/zephyr/CExport.h
|
include/zephyr/CExport.h
|
#ifndef ZEPHYR_CEXPORT_H
#define ZEPHYR_CEXPORT_H
#ifdef __cplusplus
#define Z_NS_START(n) namespace n {
#define Z_NS_END }
#else
#define Z_NS_START(n)
#define Z_NS_END
#endif
#ifdef __cplusplus
#define Z_ENUM_CLASS(ns, n) enum class n
#else
#define Z_ENUM_CLASS(ns, n) enum ns ## _ ## n
#endif
#ifdef __cplusplus
#define Z_ENUM(ns, n) enum n
#else
#define Z_ENUM(ns, n) enum ns ## _ ## n
#endif
#ifdef __cplusplus
#define Z_STRUCT(ns, n) struct n
#else
#define Z_STRUCT(ns, n) struct ns ## _ ## n
#endif
#endif
|
#ifndef ZEPHYR_CEXPORT_H
#define ZEPHYR_CEXPORT_H
#ifdef __cplusplus
#define Z_VAR(ns, n) n
#else
#define Z_VAR(ns, n) ns ## _ ## n
#endif
#ifdef __cplusplus
#define Z_NS_START(n) namespace n {
#define Z_NS_END }
#else
#define Z_NS_START(n)
#define Z_NS_END
#endif
#ifdef __cplusplus
#define Z_ENUM_CLASS(ns, n) enum class n
#else
#define Z_ENUM_CLASS(ns, n) enum Z_VAR(ns, n)
#endif
#ifdef __cplusplus
#define Z_ENUM(ns, n) enum n
#else
#define Z_ENUM(ns, n) enum Z_VAR(ns, n)
#endif
#ifdef __cplusplus
#define Z_STRUCT(ns, n) struct n
#else
#define Z_STRUCT(ns, n) struct Z_VAR(ns, n)
#endif
#endif
|
Add variable name to namespace binding
|
Add variable name to namespace binding
|
C
|
mit
|
DeonPoncini/zephyr
|
f2826431a1cc428fccc352d7af91d4b0b8955a9b
|
Note.h
|
Note.h
|
#ifndef _CHAIR_AFFAIR_NOTE
#define _CHAIR_AFFAIR_NOTE
#include <inttypes.h>
#include <config.h>
#include <FastLED.h>
typedef struct note_range_t {
uint16_t start;
uint16_t end;
} note_range_t;
class Note {
public:
Note(CRGB aColor, uint16_t order, uint16_t ledCount);
void setColor(CRGB aColor);
private:
CRGB _color;
note_range_t _range;
};
#endif
|
#ifndef _CHAIR_AFFAIR_NOTE
#define _CHAIR_AFFAIR_NOTE
#include <inttypes.h>
#include <config.h>
#include <Arduino.h>
typedef struct note_range_t {
uint16_t start;
uint16_t end;
} note_range_t;
class Note {
public:
Note(uint8_t aHue, uint16_t order, uint16_t ledCount);
void setHue(uint8_t aHue);
uint8_t hue();
void setPlaying(boolean flag);
boolean isPlaying();
private:
boolean _playing;
uint8_t _hue;
note_range_t _range;
};
#endif
|
Use hue instead of color.
|
Use hue instead of color.
Also added a property for activation of the Note
|
C
|
mit
|
NSBum/lachaise2
|
9fd0e4bb87faf5f6eec84c330a3c61b5c2d8b455
|
src/mem_alloc.c
|
src/mem_alloc.c
|
#include "common/time.h"
#include <stdio.h>
#include <stdlib.h>
static const double BENCHMARK_TIME = 5.0;
static const int NUM_ALLOCS = 1000000;
int main(int argc, const char** argv) {
printf("Benchmark: Allocate/free %d memory chunks (4-128 bytes)...\n", NUM_ALLOCS);
fflush(stdout);
double best_time = 1e9;
const double start_t = get_time();
while (get_time() - start_t < BENCHMARK_TIME) {
const double t0 = get_time();
void* addresses[NUM_ALLOCS];
for (int i = 0; i < NUM_ALLOCS; ++i) {
const int memory_size = ((i % 32) + 1) * 4;
addresses[i] = malloc(memory_size);
((char*)addresses[i])[0] = 1;
}
for (int i = 0; i < NUM_ALLOCS; ++i) {
free(addresses[i]);
}
double dt = get_time() - t0;
if (dt < best_time) {
best_time = dt;
}
}
printf("%f ns / alloc\n", (best_time / (double)NUM_ALLOCS) * 1000000000.0);
fflush(stdout);
return 0;
}
|
#include "common/time.h"
#include <stdio.h>
#include <stdlib.h>
static const double BENCHMARK_TIME = 5.0;
#define NUM_ALLOCS 1000000
static void* s_addresses[NUM_ALLOCS];
int main(int argc, const char** argv) {
printf("Benchmark: Allocate/free %d memory chunks (4-128 bytes)...\n", NUM_ALLOCS);
fflush(stdout);
double best_time = 1e9;
const double start_t = get_time();
while (get_time() - start_t < BENCHMARK_TIME) {
const double t0 = get_time();
for (int i = 0; i < NUM_ALLOCS; ++i) {
const int memory_size = ((i % 32) + 1) * 4;
s_addresses[i] = malloc(memory_size);
((char*)s_addresses[i])[0] = 1;
}
for (int i = 0; i < NUM_ALLOCS; ++i) {
free(s_addresses[i]);
}
double dt = get_time() - t0;
if (dt < best_time) {
best_time = dt;
}
}
printf("%f ns / alloc\n", (best_time / (double)NUM_ALLOCS) * 1000000000.0);
fflush(stdout);
return 0;
}
|
Use static memory for mem pointers
|
Use static memory for mem pointers
|
C
|
unlicense
|
mbitsnbites/osbench
|
81990abd79a163651fb7a5ef846c69e0e11c8326
|
kilo.c
|
kilo.c
|
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
struct termios orig_termios;
void disable_raw_mode() {
tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios);
}
void enable_raw_mode() {
tcgetattr(STDIN_FILENO, &orig_termios);
atexit(disable_raw_mode);
struct termios raw = orig_termios;
raw.c_iflag &= ~(IXON);
raw.c_lflag &= ~(ECHO | ICANON | ISIG);
tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw);
}
int main() {
enable_raw_mode();
char c;
while (read(STDIN_FILENO, &c, 1) == 1 && c != 'q') {
if (iscntrl(c)) {
printf("%d\n", c);
} else {
printf("%d ('%c')\n", c, c);
}
}
return 0;
}
|
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
struct termios orig_termios;
void disable_raw_mode() {
tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios);
}
void enable_raw_mode() {
tcgetattr(STDIN_FILENO, &orig_termios);
atexit(disable_raw_mode);
struct termios raw = orig_termios;
raw.c_iflag &= ~(IXON);
raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw);
}
int main() {
enable_raw_mode();
char c;
while (read(STDIN_FILENO, &c, 1) == 1 && c != 'q') {
if (iscntrl(c)) {
printf("%d\n", c);
} else {
printf("%d ('%c')\n", c, c);
}
}
return 0;
}
|
Disable Ctrl-V (and Ctrl-O on macOS)
|
Disable Ctrl-V (and Ctrl-O on macOS)
|
C
|
bsd-2-clause
|
oldsharp/kilo,oldsharp/kilo
|
1b90d7cf2b0ace1d1623562d4ad084e2ea9fdf10
|
list.h
|
list.h
|
#include <stdlib.h>
#ifndef __LIST_H__
#define __LIST_H__
struct ListNode;
struct List;
typedef struct ListNode ListNode;
typedef struct List List;
List* List_Create(void);
void List_Destroy(List* l);
ListNode* ListNode_Create(void *);
void ListNode_Destroy(ListNode* n);
#endif
|
#include <stdlib.h>
#ifndef __LIST_H__
#define __LIST_H__
struct ListNode;
struct List;
typedef struct ListNode ListNode;
typedef struct List List;
List* List_Create(void);
void List_Destroy(List* l);
ListNode* ListNode_Create(void *);
void ListNode_Destroy(ListNode* n);
ListNode* List_Search(List* l, void* k, int f(void*, void*));
#endif
|
Add List Search function declaration
|
Add List Search function declaration
|
C
|
mit
|
MaxLikelihood/CADT
|
9ba4f34f11902e16fb17ec08f66a1c9f27817359
|
main.c
|
main.c
|
#include <stdio.h>
#include "forsyth.h"
int main(int argc, char* argv[])
{
FILE * stream;
int FEN_status;
if (argc < 2)
FEN_status = load_FEN(
"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
);
else
FEN_status = load_FEN(argv[1]);
#if defined(TEST_MATE_IN_ONE)
memcpy(&square(a8), "nk....bq", 8);
memcpy(&square(a7), "ppp.r...", 8);
memcpy(&square(a6), "........", 8);
memcpy(&square(a5), "........", 8);
memcpy(&square(a4), "........", 8);
memcpy(&square(a3), "........", 8);
memcpy(&square(a2), "...R.PPP", 8);
memcpy(&square(a1), "QB....KN", 8);
#endif
if (FEN_status != FEN_OK)
{
fprintf(stderr, "(%i): FEN record is corrupt!\n\n", FEN_status);
return (FEN_status);
}
stream = (argc < 3) ? stdout : fopen(argv[2], "w");
load_Forsyth(stream);
fclose(stream);
return 0;
}
|
#include <stdio.h>
#include "forsyth.h"
#include "check.h"
int main(int argc, char* argv[])
{
FILE * stream;
int FEN_status;
if (argc < 2)
FEN_status = load_FEN(
"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
);
else
FEN_status = load_FEN(argv[1]);
#if defined(TEST_MATE_IN_ONE)
memcpy(&square(a8), "nk....bq", 8);
memcpy(&square(a7), "ppp.r...", 8);
memcpy(&square(a6), "........", 8);
memcpy(&square(a5), "........", 8);
memcpy(&square(a4), "........", 8);
memcpy(&square(a3), "........", 8);
memcpy(&square(a2), "...R.PPP", 8);
memcpy(&square(a1), "QB....KN", 8);
#endif
if (FEN_status != FEN_OK)
{
fprintf(stderr, "(%i): FEN record is corrupt!\n\n", FEN_status);
return (FEN_status);
}
stream = (argc < 3) ? stdout : fopen(argv[2], "w");
load_Forsyth(stream);
fclose(stream);
if (in_check(WHITE))
puts("White is in check.");
if (in_check(BLACK))
puts("Black is in check.");
return 0;
}
|
Debug check analysis for both sides.
|
Debug check analysis for both sides.
|
C
|
cc0-1.0
|
cxd4/chess,cxd4/chess,cxd4/chess
|
48a69a892114ebe5665563938dd9344f0362d1d5
|
src/plugin/synchronized_queue.h
|
src/plugin/synchronized_queue.h
|
// This is a queue that can be accessed from multiple threads safely.
//
// It's not well optimized, and requires obtaining a lock every time you check for a new value.
#pragma once
#include <mutex>
#include <optional>
#include <queue>
template <class T>
class SynchronizedQueue {
std::condition_variable cv_;
std::mutex lock_;
std::queue<T> q_;
public:
void push(T && t) {
std::unique_lock l(lock_);
q_.push(std::move(t));
cv_.notify_one();
}
std::optional<T> get() {
std::unique_lock l(lock_);
if(q_.empty()) {
return std::nullopt;
}
T t = std::move(q_.front());
q_.pop();
return t;
}
T get_blocking() {
std::unique_lock l(lock_);
while(q_.empty()) {
cv_.wait(l);
}
T t = std::move(q_.front());
q_.pop();
return std::move(t);
}
};
|
// This is a queue that can be accessed from multiple threads safely.
//
// It's not well optimized, and requires obtaining a lock every time you check for a new value.
#pragma once
#include <condition_variable>
#include <mutex>
#include <optional>
#include <queue>
template <class T>
class SynchronizedQueue {
std::condition_variable cv_;
std::mutex lock_;
std::queue<T> q_;
public:
void push(T && t) {
std::unique_lock l(lock_);
q_.push(std::move(t));
cv_.notify_one();
}
std::optional<T> get() {
std::unique_lock l(lock_);
if(q_.empty()) {
return std::nullopt;
}
T t = std::move(q_.front());
q_.pop();
return t;
}
T get_blocking() {
std::unique_lock l(lock_);
while(q_.empty()) {
cv_.wait(l);
}
T t = std::move(q_.front());
q_.pop();
return std::move(t);
}
};
|
Fix compilation on Linux / Windows
|
Fix compilation on Linux / Windows
|
C
|
mit
|
leecbaker/datareftool,leecbaker/datareftool,leecbaker/datareftool
|
500aedded80bd387484abfe9a6d7b8b4b591015d
|
c/c_gcc_test.c
|
c/c_gcc_test.c
|
#include <stdio.h>
int c;
__thread int d;
register int R1 __asm__ ("%" "i5");
int main(void)
{
c = 3;
R1 = 5;
d = 4;
printf("C: %d\n", c);
printf("D: %d\n", d);
printf("R1: %d\n", R1);
R1 *= 2;
printf("R1: %d\n", R1);
return 0;
}
|
#include <stdio.h>
int c;
__thread int d;
register int R1 __asm__ ("%" "r15");
int main(void)
{
c = 3;
R1 = 5;
d = 4;
printf("C: %d\n", c);
printf("D: %d\n", d);
printf("R1: %d\n", R1);
R1 *= 2;
printf("R1: %d\n", R1);
return 0;
}
|
Fix gcc global reg extension test to work.
|
Fix gcc global reg extension test to work.
Had wrong register before.
|
C
|
bsd-3-clause
|
dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps
|
fca6774a3398cde170512b263b0d673df28bd641
|
client/display.h
|
client/display.h
|
/*
*
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2012 Intel Corporation. All rights reserved.
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#define COLOR_OFF "\x1B[0m"
#define COLOR_BLUE "\x1B[0;34m"
static inline void begin_message(void)
{
rl_message("");
printf("\r%*c\r", rl_end, ' ');
}
static inline void end_message(void)
{
rl_clear_message();
}
void rl_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
|
/*
*
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2012 Intel Corporation. All rights reserved.
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#define COLOR_OFF "\x1B[0m"
#define COLOR_BLUE "\x1B[0;34m"
void rl_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
|
Remove broken helper for message blocks
|
client: Remove broken helper for message blocks
|
C
|
lgpl-2.1
|
mapfau/bluez,pstglia/external-bluetooth-bluez,ComputeCycles/bluez,pkarasev3/bluez,pstglia/external-bluetooth-bluez,pkarasev3/bluez,pkarasev3/bluez,pkarasev3/bluez,pstglia/external-bluetooth-bluez,mapfau/bluez,ComputeCycles/bluez,silent-snowman/bluez,mapfau/bluez,mapfau/bluez,pstglia/external-bluetooth-bluez,silent-snowman/bluez,silent-snowman/bluez,silent-snowman/bluez,ComputeCycles/bluez,ComputeCycles/bluez
|
3c3fe25d9ae586a2ef64361801bd6af08c6a0584
|
Modules/CEST/autoload/IO/mitkCESTDICOMReaderService.h
|
Modules/CEST/autoload/IO/mitkCESTDICOMReaderService.h
|
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef MITKCESTDICOMReaderService_H
#define MITKCESTDICOMReaderService_H
#include <mitkBaseDICOMReaderService.h>
namespace mitk {
/**
Service wrapper that auto selects (using the mitk::DICOMFileReaderSelector) the best DICOMFileReader from
the DICOMReader module and loads additional meta data for CEST data.
*/
class CESTDICOMReaderService : public BaseDICOMReaderService
{
public:
CESTDICOMReaderService();
CESTDICOMReaderService(const std::string& description);
/** Uses the BaseDICOMReaderService Read function and add extra steps for CEST meta data */
virtual std::vector<itk::SmartPointer<BaseData> > Read() override;
protected:
/** Returns the reader instance that should be used. The decision may be based
* one the passed relevant file list.*/
virtual mitk::DICOMFileReader::Pointer GetReader(const mitk::StringList& relevantFiles) const override;
private:
virtual CESTDICOMReaderService* Clone() const override;
};
}
#endif // MITKDICOMSERIESREADERSERVICE_H
|
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef MITKCESTDICOMReaderService_H
#define MITKCESTDICOMReaderService_H
#include <mitkBaseDICOMReaderService.h>
namespace mitk {
/**
Service wrapper that auto selects (using the mitk::DICOMFileReaderSelector) the best DICOMFileReader from
the DICOMReader module and loads additional meta data for CEST data.
*/
class CESTDICOMReaderService : public BaseDICOMReaderService
{
public:
CESTDICOMReaderService();
CESTDICOMReaderService(const std::string& description);
/** Uses the BaseDICOMReaderService Read function and add extra steps for CEST meta data */
using AbstractFileReader::Read;
virtual std::vector<itk::SmartPointer<BaseData> > Read() override;
protected:
/** Returns the reader instance that should be used. The decision may be based
* one the passed relevant file list.*/
virtual mitk::DICOMFileReader::Pointer GetReader(const mitk::StringList& relevantFiles) const override;
private:
virtual CESTDICOMReaderService* Clone() const override;
};
}
#endif // MITKDICOMSERIESREADERSERVICE_H
|
Fix warnings in CEST module
|
Fix warnings in CEST module
|
C
|
bsd-3-clause
|
MITK/MITK,fmilano/mitk,fmilano/mitk,fmilano/mitk,fmilano/mitk,fmilano/mitk,fmilano/mitk,MITK/MITK,MITK/MITK,MITK/MITK,fmilano/mitk,MITK/MITK,MITK/MITK
|
ed6127234f1e0404be90431a49fdb3cdad350851
|
Headers/BSPropertySet.h
|
Headers/BSPropertySet.h
|
#import <Foundation/Foundation.h>
#import <Foundation/NSEnumerator.h>
#import "BSNullabilityCompat.h"
NS_ASSUME_NONNULL_BEGIN
/**
* A BSPropertySet represents the set of a Class' properties that will be injected into class instances after
* the instances are created.
*
* If a
*/
@interface BSPropertySet : NSObject<NSFastEnumeration>
/**
* Returns a BSPropertySet for the given class, representing the properties named in the argument list. This
* method is for use by classes within their implementation of bsProperties.
*
* For example, suppose there is a class that has a property called "eventLogger" of type EventLogger *.
*
* Suppose we want to inject two of the properties - address and color. We could implement bsProperties
* like this:
*
* \code
*
* + (BSPropertySet *)bsProperties {
* BSPropertySet *propertySet = [BSPropertySet propertySetWithClass:self propertyNames:@"address" @"color", nil];
* [propertySet bind:@"address" toKey:@"my home address"
*
* }
*
* \endcode
*/
+ (BSPropertySet *)propertySetWithClass:(Class)owningClass propertyNames:(NSString *)property1, ... NS_REQUIRES_NIL_TERMINATION;
- (void)bindProperty:(NSString *)propertyName toKey:(id)key;
@end
NS_ASSUME_NONNULL_END
|
#import <Foundation/Foundation.h>
#import <Foundation/NSEnumerator.h>
#import "BSNullabilityCompat.h"
NS_ASSUME_NONNULL_BEGIN
/**
* A BSPropertySet represents the set of a Class' properties that will be injected into class instances after
* the instances are created.
*
* If a
*/
@interface BSPropertySet : NSObject<NSFastEnumeration>
/**
* Returns a BSPropertySet for the given class, representing the properties named in the argument list. This
* method is for use by classes within their implementation of bsProperties.
*
* For example, suppose there is a class that has a property called "eventLogger" of type EventLogger *.
*
* Suppose we want to inject two of the properties - address and color. We could implement bsProperties
* like this:
*
* \code
*
* + (BSPropertySet *)bsProperties {
* BSPropertySet *propertySet = [BSPropertySet propertySetWithClass:self propertyNames:@"address" @"color", nil];
* [propertySet bind:@"address" toKey:@"my home address"];
* return propertySet;
* }
*
* \endcode
*/
+ (BSPropertySet *)propertySetWithClass:(Class)owningClass propertyNames:(NSString *)property1, ... NS_REQUIRES_NIL_TERMINATION;
- (void)bindProperty:(NSString *)propertyName toKey:(id)key;
@end
NS_ASSUME_NONNULL_END
|
Fix code in header documentation
|
Fix code in header documentation
|
C
|
mit
|
lumoslabs/blindside,jbsf/blindside,lumoslabs/blindside,jbsf/blindside,jbsf/blindside,lumoslabs/blindside
|
e7c74f1f1dc05f5befbd66709a3908490d320a66
|
include/kompositum/printer.h
|
include/kompositum/printer.h
|
// Copyright(c) 2016 artopantone.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once
#include <kompositum/visitor.h>
namespace Kompositum {
class Printer : public Visitor {
public:
void visit(Leaf* leaf) override {
doIndentation();
printf("- Leaf (%lu)\n", leaf->getID());
}
void visit(Composite* composite) override {
doIndentation();
indent++;
if (!composite->hasChildren()) {
printf("- Composite (%lu): empty\n", composite->getID());
} else {
printf("+ Composite (%lu):\n", composite->getID());
composite->visitChildren(*this);
}
indent--;
}
private:
void doIndentation() const {
for (auto i = 0u; i < indent; ++i)
printf("+--");
}
unsigned int indent = 0;
};
} // namespace Kompositum
|
// Copyright(c) 2016 artopantone.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once
#include <kompositum/visitor.h>
#include <cstdio>
namespace Kompositum {
class Printer : public Visitor {
public:
void visit(Leaf* leaf) override {
doIndentation();
printf("- Leaf (%lu)\n", leaf->getID());
}
void visit(Composite* composite) override {
doIndentation();
indent++;
if (!composite->hasChildren()) {
printf("- Composite (%lu): empty\n", composite->getID());
} else {
printf("+ Composite (%lu):\n", composite->getID());
composite->visitChildren(*this);
}
indent--;
}
private:
void doIndentation() const {
for (auto i = 0u; i < indent; ++i)
printf("+--");
}
unsigned int indent = 0;
};
} // namespace Kompositum
|
Add missing header for printf
|
Add missing header for printf
|
C
|
mit
|
Geraet/Kompositum
|
e8a1e8a524d4860fcd9d176ee1fef250139b7e57
|
src/pomodoro_config.h
|
src/pomodoro_config.h
|
// ----------------------------------------------------------------------------
// pomodoro_config - Defines the parameters for various pomodoro technique bits
// Copyright (c) 2013 Jonathan Speicher (jon.speicher@gmail.com)
// Licensed under the MIT license: http://opensource.org/licenses/MIT
// ----------------------------------------------------------------------------
#pragma once
// Defines the duration of a pomodoro.
#define POMODORO_MINUTES 0
#define POMODORO_SECONDS 10
// Defines the duration of a break.
#define BREAK_MINUTES 0
#define BREAK_SECONDS 5
|
// ----------------------------------------------------------------------------
// pomodoro_config - Defines the parameters for various pomodoro technique bits
// Copyright (c) 2013 Jonathan Speicher (jon.speicher@gmail.com)
// Licensed under the MIT license: http://opensource.org/licenses/MIT
// ----------------------------------------------------------------------------
#pragma once
// Defines the duration of a pomodoro.
#define POMODORO_MINUTES 25
#define POMODORO_SECONDS 0
// Defines the duration of a break.
#define BREAK_MINUTES 5
#define BREAK_SECONDS 0
|
Change back to real-length pomodoros and breaks
|
Change back to real-length pomodoros and breaks
|
C
|
mit
|
jonspeicher/Pomade,elliots/simple-demo-pebble,jonspeicher/Pomade
|
1af86fac6692ea2b5f9a92446ba6099f83b8dedb
|
src/platform/win32/num_cpus.c
|
src/platform/win32/num_cpus.c
|
/*
* Copyright (C) 2012, Parrot Foundation.
*/
/*
=head1 NAME
src/platform/win32/num_cpus.c
=head1 DESCRIPTION
Returns the number of CPUs for win32 systems
=head2 Functions
=cut
*/
#include "parrot/parrot.h"
#ifdef _WIN32
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#endif
/* HEADERIZER HFILE: none */
/*
=over 4
=item C<INTVAL Parrot_get_num_cpus(Parrot_Interp)>
Returns the number of CPUs
=back
=cut
*/
INTVAL
Parrot_get_num_cpus(Parrot_Interp interp)
{
INTVAL nprocs = -1;
SYSTEM_INFO info;
GetSystemInfo(&info);
nprocs = (INTVAL)info.dwNumberOfProcessors;
return nprocs;
}
/*
* Local variables:
* c-file-style: "parrot"
* End:
* vim: expandtab shiftwidth=4 cinoptions='\:2=2' :
*/
|
/*
* Copyright (C) 2012, Parrot Foundation.
*/
/*
=head1 NAME
src/platform/win32/num_cpus.c
=head1 DESCRIPTION
Returns the number of CPUs for win32 systems
=head2 Functions
=cut
*/
#include "parrot/parrot.h"
#ifdef _WIN32
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#endif
/* HEADERIZER HFILE: none */
/*
=over 4
=item C<INTVAL Parrot_get_num_cpus(Parrot_Interp interp)>
Returns the number of CPUs
=back
=cut
*/
INTVAL
Parrot_get_num_cpus(Parrot_Interp interp)
{
INTVAL nprocs = -1;
SYSTEM_INFO info;
GetSystemInfo(&info);
nprocs = (INTVAL)info.dwNumberOfProcessors;
return nprocs;
}
/*
* Local variables:
* c-file-style: "parrot"
* End:
* vim: expandtab shiftwidth=4 cinoptions='\:2=2' :
*/
|
Correct documentation of C function.
|
[codingstd] Correct documentation of C function.
|
C
|
artistic-2.0
|
youprofit/parrot,youprofit/parrot,tkob/parrot,parrot/parrot,parrot/parrot,tkob/parrot,parrot/parrot,tkob/parrot,FROGGS/parrot,tkob/parrot,tkob/parrot,youprofit/parrot,youprofit/parrot,FROGGS/parrot,youprofit/parrot,tkob/parrot,youprofit/parrot,FROGGS/parrot,parrot/parrot,parrot/parrot,FROGGS/parrot,tkob/parrot,tkob/parrot,youprofit/parrot,FROGGS/parrot,youprofit/parrot,FROGGS/parrot,FROGGS/parrot,FROGGS/parrot
|
7e02a89c92248e1107d7adf1e5d2f65feedcc433
|
roofit/roofitcore/inc/RooFitCore_LinkDef.h
|
roofit/roofitcore/inc/RooFitCore_LinkDef.h
|
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ function Roo* ;
#pragma link C++ class RooLinkedList- ;
#pragma link C++ class RooRealVar- ;
#pragma link C++ class RooAbsBinning- ;
#pragma link off class RooErrorHandler ;
#pragma link C++ class RooRandomizeParamMCSModule::UniParam ;
#pragma link C++ class RooRandomizeParamMCSModule::GausParam ;
#endif
|
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ function Roo* ;
#pragma link C++ class RooLinkedList- ;
#pragma link C++ class RooRealVar- ;
#pragma link C++ class RooAbsBinning- ;
#pragma link off class RooErrorHandler ;
#endif
|
Disable attempt to generate dictionary for private classes
|
Disable attempt to generate dictionary for private classes
The following warning was generated by rootcling:
Warning: Class or struct RooRandomizeParamMCSModule::UniParam was
selected but its dictionary cannot be generated: this is a private or
protected class and this is not supported. No direct I/O operation of
RooRandomizeParamMCSModule::UniParam instances will be possible.
Reference:
http://cdash.cern.ch/viewBuildError.php?type=1&buildid=393839
|
C
|
lgpl-2.1
|
zzxuanyuan/root,olifre/root,root-mirror/root,zzxuanyuan/root,olifre/root,root-mirror/root,root-mirror/root,karies/root,root-mirror/root,karies/root,root-mirror/root,olifre/root,karies/root,karies/root,zzxuanyuan/root,zzxuanyuan/root,root-mirror/root,root-mirror/root,zzxuanyuan/root,karies/root,karies/root,zzxuanyuan/root,root-mirror/root,olifre/root,karies/root,olifre/root,karies/root,olifre/root,olifre/root,zzxuanyuan/root,zzxuanyuan/root,karies/root,root-mirror/root,zzxuanyuan/root,karies/root,root-mirror/root,zzxuanyuan/root,olifre/root,karies/root,zzxuanyuan/root,olifre/root,olifre/root,root-mirror/root,olifre/root,zzxuanyuan/root
|
8cf1942611f7d3e517412e2062da2a69f514cd9f
|
ui/textdialog.h
|
ui/textdialog.h
|
#pragma once
#include <QtWidgets/QDialog>
#include "binaryninjaapi.h"
#include "uitypes.h"
class BINARYNINJAUIAPI TextDialog: public QDialog
{
Q_OBJECT
QWidget* m_parent;
QString m_title;
QString m_msg;
QStringList m_options;
Qt::WindowFlags m_flags;
QString m_qSettingsListName;
int m_historySize;
QString m_historyEntry;
QString m_initialText;
public:
TextDialog(QWidget* parent, const QString& title, const QString& msg, const QString& qSettingsListName,
const std::string& initialText = "");
TextDialog(QWidget* parent, const QString& title, const QString& msg, const QString& qSettingsListName,
const QString& initialText);
QString getItem(bool& ok);
void setInitialText(const std::string& initialText) { m_initialText = QString::fromStdString(initialText); }
void commitHistory();
};
|
#pragma once
#include <QtWidgets/QDialog>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QLabel>
#include "binaryninjaapi.h"
#include "uitypes.h"
#include "binaryninjaapi.h"
class BINARYNINJAUIAPI TextDialog: public QDialog
{
Q_OBJECT
QString m_qSettingsListName;
int m_historySize;
QString m_historyEntry;
QString m_initialText;
QStringList m_historyEntries;
QLabel* m_messageText;
QComboBox* m_combo;
public:
TextDialog(QWidget* parent, const QString& title, const QString& msg, const QString& qSettingsListName,
const std::string& initialText = "");
TextDialog(QWidget* parent, const QString& title, const QString& msg, const QString& qSettingsListName,
const QString& initialText);
QString getItem();
void setInitialText(const std::string& initialText) { m_initialText = QString::fromStdString(initialText); }
void commitHistory();
};
|
Fix case sensitivity issue with the rename dialog
|
Fix case sensitivity issue with the rename dialog
|
C
|
mit
|
joshwatson/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api
|
b5220189bc6a5ec22efa7c6b8ae39bc166303c62
|
src/h/startup.h
|
src/h/startup.h
|
typedef struct {
int cluster; /* Condor Cluster # */
int proc; /* Condor Proc # */
int job_class; /* STANDARD, VANILLA, PVM, PIPE, ... */
uid_t uid; /* Execute job under this UID */
gid_t gid; /* Execute job under this pid */
pid_t virt_pid; /* PVM virt pid of this process */
int soft_kill_sig; /* Use this signal for a soft kill */
char *a_out_name; /* Where to get executable file */
char *cmd; /* Command name given by the user */
char *args; /* Command arguments given by the user */
char *env; /* Environment variables */
char *iwd; /* Initial working directory */
BOOLEAN ckpt_wanted; /* Whether user wants checkpointing */
BOOLEAN is_restart; /* Whether this run is a restart */
BOOLEAN coredump_limit_exists; /* Whether user wants to limit core size */
int coredump_limit; /* Limit in bytes */
} STARTUP_INFO;
/*
Should eliminate starter knowing the a.out name. Should go to
shadow for instructions on how to fetch the executable - e.g. local file
with name <name> or get it from TCP port <x> on machine <y>.
*/
|
typedef struct {
int version_num; /* version of this structure */
int cluster; /* Condor Cluster # */
int proc; /* Condor Proc # */
int job_class; /* STANDARD, VANILLA, PVM, PIPE, ... */
uid_t uid; /* Execute job under this UID */
gid_t gid; /* Execute job under this gid */
pid_t virt_pid; /* PVM virt pid of this process */
int soft_kill_sig; /* Use this signal for a soft kill */
char *cmd; /* Command name given by the user */
char *args; /* Command arguments given by the user */
char *env; /* Environment variables */
char *iwd; /* Initial working directory */
BOOLEAN ckpt_wanted; /* Whether user wants checkpointing */
BOOLEAN is_restart; /* Whether this run is a restart */
BOOLEAN coredump_limit_exists; /* Whether user wants to limit core size */
int coredump_limit; /* Limit in bytes */
} STARTUP_INFO;
#define STARTUP_VERSION 1
/*
Should eliminate starter knowing the a.out name. Should go to
shadow for instructions on how to fetch the executable - e.g. local file
with name <name> or get it from TCP port <x> on machine <y>.
*/
|
Add version number and get rid if a.out name.
|
Add version number and get rid if a.out name.
|
C
|
apache-2.0
|
djw8605/htcondor,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,zhangzhehust/htcondor,djw8605/htcondor,clalancette/condor-dcloud,djw8605/condor,neurodebian/htcondor,htcondor/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,htcondor/htcondor,djw8605/condor,clalancette/condor-dcloud,zhangzhehust/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,zhangzhehust/htcondor,htcondor/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,djw8605/htcondor,djw8605/condor,djw8605/condor,zhangzhehust/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,djw8605/condor,neurodebian/htcondor,neurodebian/htcondor,djw8605/condor,neurodebian/htcondor,htcondor/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,bbockelm/condor-network-accounting,zhangzhehust/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,htcondor/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,djw8605/condor,djw8605/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,djw8605/htcondor,djw8605/condor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,htcondor/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,clalancette/condor-dcloud,htcondor/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,zhangzhehust/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud
|
851b00b16235d9026d80ddfd783a5af9d0a2d5b6
|
msvcdbg.h
|
msvcdbg.h
|
#if defined(_MSC_VER) && !defined(NDEBUG) && defined(_CRTDBG_MAP_ALLOC) && !defined(MSVCDBG_H)
#define MSVCDBG_H
/*!
* @file msvcdbg.h
* @brief Memory debugger for msvc
* @author koturn
*/
#include <crtdbg.h>
static void
__msvc_init_memory_check__(void);
#pragma section(".CRT$XCU", read)
__declspec(allocate(".CRT$XCU"))
void (* __msvc_init_memory_check___)(void) = __msvc_init_memory_check__;
/*!
* @brief Enable heap management
*/
static void
__msvc_init_memory_check__(void)
{
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_DELAY_FREE_MEM_DF);
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT);
}
#endif
|
#if defined(_MSC_VER) && !defined(NDEBUG) && defined(_CRTDBG_MAP_ALLOC) && !defined(MSVCDBG_H)
#define MSVCDBG_H
/*!
* @file msvcdbg.h
* @brief Memory debugger for msvc
* @author koturn
*/
#include <crtdbg.h>
#define MSVCDBG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#ifdef MSVCDBG_REPLACE_NEW
# define new MSVCDBG_NEW
#endif
static void
__msvc_init_memory_check__(void);
#pragma section(".CRT$XCU", read)
__declspec(allocate(".CRT$XCU"))
void (* __msvc_init_memory_check___)(void) = __msvc_init_memory_check__;
/*!
* @brief Enable heap management
*/
static void
__msvc_init_memory_check__(void)
{
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_DELAY_FREE_MEM_DF);
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT);
}
#endif
|
Enable to replace "new" operator
|
Enable to replace "new" operator
|
C
|
mit
|
koturn/msvcdbg
|
a536e7ccae49fb5141e9a959cff10500599993d4
|
ui/clickablelabel.h
|
ui/clickablelabel.h
|
#pragma once
#include <QtWidgets/QLabel>
class BINARYNINJAUIAPI ClickableLabel: public QLabel
{
Q_OBJECT
public:
ClickableLabel(QWidget* parent = nullptr, const QString& name = ""): QLabel(parent) { setText(name); }
signals:
void clicked();
protected:
void mouseReleaseEvent(QMouseEvent* event) override { if (event->button() == Qt::LeftButton) emit clicked(); }
};
|
#pragma once
#include <QtWidgets/QLabel>
class BINARYNINJAUIAPI ClickableLabel: public QLabel
{
Q_OBJECT
public:
ClickableLabel(QWidget* parent = nullptr, const QString& name = ""): QLabel(parent) { setText(name); }
Q_SIGNALS:
void clicked();
protected:
void mouseReleaseEvent(QMouseEvent* event) override { if (event->button() == Qt::LeftButton) Q_EMIT clicked(); }
};
|
Use Q_SIGNALS / Q_EMIT macros instead of signals / emit
|
Use Q_SIGNALS / Q_EMIT macros instead of signals / emit
|
C
|
mit
|
joshwatson/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,joshwatson/binaryninja-api,joshwatson/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api
|
af485fc505247b10dc247ebdf96ba2aa70448ea5
|
tests/embedded/do_test.c
|
tests/embedded/do_test.c
|
#include <hwloc.h>
#include <stdio.h>
/* The body of the test is in a separate .c file and a separate
library, just to ensure that hwloc didn't force compilation with
visibility flags enabled. */
int do_test(void)
{
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();
if (NULL == cpu_set) return 1;
printf("*** Test 2: topology init\n");
if (0 != mytest_hwloc_topology_init(&topology)) return 1;
printf("*** Test 3: topology load\n");
if (0 != mytest_hwloc_topology_load(topology)) return 1;
printf("*** Test 4: topology get depth\n");
depth = mytest_hwloc_topology_get_depth(topology);
if (depth < 0) return 1;
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;
}
|
#include <hwloc.h>
#include <stdio.h>
/* The body of the test is in a separate .c file and a separate
library, just to ensure that hwloc didn't force compilation with
visibility flags enabled. */
int do_test(void)
{
mytest_hwloc_topology_t topology;
unsigned depth;
hwloc_bitmap_t cpu_set;
/* Just call a bunch of functions to see if we can link and run */
printf("*** Test 1: bitmap alloc\n");
cpu_set = mytest_hwloc_bitmap_alloc();
if (NULL == cpu_set) return 1;
printf("*** Test 2: topology init\n");
if (0 != mytest_hwloc_topology_init(&topology)) return 1;
printf("*** Test 3: topology load\n");
if (0 != mytest_hwloc_topology_load(topology)) return 1;
printf("*** Test 4: topology get depth\n");
depth = mytest_hwloc_topology_get_depth(topology);
if (depth < 0) return 1;
printf(" Max depth: %u\n", depth);
printf("*** Test 5: topology destroy\n");
mytest_hwloc_topology_destroy(topology);
printf("*** Test 6: bitmap free\n");
mytest_hwloc_bitmap_free(cpu_set);
return 0;
}
|
Convert the embedded test to the bitmap API
|
Convert the embedded test to the bitmap API
This commit was SVN r2512.
|
C
|
bsd-3-clause
|
shekkbuilder/hwloc,ggouaillardet/hwloc,shekkbuilder/hwloc,ggouaillardet/hwloc,shekkbuilder/hwloc,ggouaillardet/hwloc,ggouaillardet/hwloc,shekkbuilder/hwloc
|
a7c27a794bf5e25046a75767f709f6619b61bcb1
|
grantlee_core_library/parser.h
|
grantlee_core_library/parser.h
|
/*
Copyright (c) 2009 Stephen Kelly <steveire@gmail.com>
*/
#ifndef PARSER_H
#define PARSER_H
#include <QStringList>
#include "token.h"
#include "node.h"
namespace Grantlee
{
class AbstractNodeFactory;
class TagLibraryInterface;
class Filter;
}
class ParserPrivate;
namespace Grantlee
{
class GRANTLEE_EXPORT Parser : public QObject
{
Q_OBJECT
public:
Parser( QList<Token> tokenList, QStringList pluginDirs, QObject *parent );
~Parser();
NodeList parse(QStringList stopAt, QObject *parent);
NodeList parse(QObject *parent);
Filter *getFilter(const QString &name);
void skipPast(const QString &tag);
Token nextToken();
bool hasNextToken();
void loadLib(const QString &name);
void emitError(int errorNumber, const QString &message);
protected:
void addTag(QObject *);
void getBuiltInLibrary();
void getDefaultLibrary();
void prependToken(Token token);
signals:
void error(int type, const QString &message);
private:
Q_DECLARE_PRIVATE(Parser);
ParserPrivate *d_ptr;
};
}
#endif
|
/*
Copyright (c) 2009 Stephen Kelly <steveire@gmail.com>
*/
#ifndef PARSER_H
#define PARSER_H
#include <QStringList>
#include "token.h"
#include "node.h"
namespace Grantlee
{
class Filter;
}
class ParserPrivate;
namespace Grantlee
{
class GRANTLEE_EXPORT Parser : public QObject
{
Q_OBJECT
public:
Parser( QList<Token> tokenList, QStringList pluginDirs, QObject *parent );
~Parser();
NodeList parse(QStringList stopAt, QObject *parent);
NodeList parse(QObject *parent);
Filter *getFilter(const QString &name);
void skipPast(const QString &tag);
Token nextToken();
bool hasNextToken();
void loadLib(const QString &name);
void emitError(int errorNumber, const QString &message);
protected:
void prependToken(Token token);
signals:
void error(int type, const QString &message);
private:
Q_DECLARE_PRIVATE(Parser);
ParserPrivate *d_ptr;
};
}
#endif
|
Remove some unused classes and methods.
|
Remove some unused classes and methods.
|
C
|
lgpl-2.1
|
cutelyst/grantlee,simonwagner/grantlee,simonwagner/grantlee,cutelyst/grantlee,cutelyst/grantlee,simonwagner/grantlee,simonwagner/grantlee,simonwagner/grantlee,cutelyst/grantlee,simonwagner/grantlee,cutelyst/grantlee
|
ffc7c9c71d092251c05e4193958ee357ee64ef3f
|
formats/format.h
|
formats/format.h
|
#ifndef FORMAT_H
#define FORMAT_H
#include <cstddef>
#include <cstring> // memmove
class Format
{
public:
Format(void *p, size_t s = 0) : fp((char *)p), size(s) {};
virtual size_t Leanify(size_t size_leanified = 0)
{
if (size_leanified)
{
memmove(fp - size_leanified, fp, size);
fp -= size_leanified;
}
return size;
}
protected:
// pointer to the file content
char *fp;
// size of the file
size_t size;
};
#endif
|
#ifndef FORMAT_H
#define FORMAT_H
#include <cstddef>
#include <cstring> // memmove
class Format
{
public:
Format(void *p, size_t s = 0) : fp((char *)p), size(s) {};
virtual ~Format() {};
virtual size_t Leanify(size_t size_leanified = 0)
{
if (size_leanified)
{
memmove(fp - size_leanified, fp, size);
fp -= size_leanified;
}
return size;
}
protected:
// pointer to the file content
char *fp;
// size of the file
size_t size;
};
#endif
|
Fix warning of non-virtual destructor
|
Fix warning of non-virtual destructor
|
C
|
mit
|
JayXon/Leanify,yyjdelete/Leanify,JayXon/Leanify,yyjdelete/Leanify
|
176354ff491286ce45f32cd41efc641fed506b4f
|
lib/toplevel.h
|
lib/toplevel.h
|
/********************************************************************
* *
* THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function:
last mod: $Id: toplevel.h,v 1.1 2003/06/04 01:31:46 mauricio Exp $
********************************************************************/
/*from dbm huffman pack patch*/
extern void write_Qtables(oggpack_buffer* opb);
extern void write_HuffmanSet(oggpack_buffer* opb, HUFF_ENTRY **hroot);
extern void read_Qtables(oggpack_buffer* opb);
extern void read_HuffmanSet(oggpack_buffer* opb);
extern void InitHuffmanSetPlay( PB_INSTANCE *pbi );
|
/********************************************************************
* *
* THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function:
last mod: $Id: toplevel.h,v 1.2 2003/06/07 23:34:56 giles Exp $
********************************************************************/
/*from dbm huffman pack patch*/
extern void write_Qtables(oggpack_buffer* opb);
extern void write_HuffmanSet(oggpack_buffer* opb, HUFF_ENTRY **hroot);
extern void read_Qtables(oggpack_buffer* opb);
extern void read_HuffmanSet(oggpack_buffer* opb);
extern void InitHuffmanSetPlay( PB_INSTANCE *pbi );
|
Add newline at the end of the file.
|
Add newline at the end of the file.
git-svn-id: 8dbf393e6e9ab8d4979d29f9a341a98016792aa6@4891 0101bb08-14d6-0310-b084-bc0e0c8e3800
|
C
|
bsd-3-clause
|
Distrotech/libtheora,KTXSoftware/theora,KTXSoftware/theora,Distrotech/libtheora,KTXSoftware/theora,Distrotech/libtheora,Distrotech/libtheora,Distrotech/libtheora,KTXSoftware/theora,KTXSoftware/theora
|
a21685eab417189d887db6d5a83bfff83661c1eb
|
gui/mainwindow.h
|
gui/mainwindow.h
|
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
|
#pragma once
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
};
|
Use pragma once instead of ifdef
|
Use pragma once instead of ifdef
|
C
|
bsd-2-clause
|
csete/softrig,csete/softrig,csete/softrig
|
28756936d56729331733a17a2f750969a8713ece
|
ports/broadcom/boards/raspberrypi_zero2w/mpconfigboard.h
|
ports/broadcom/boards/raspberrypi_zero2w/mpconfigboard.h
|
#define MICROPY_HW_BOARD_NAME "Raspberry Pi Zero 2W"
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO3)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO2)
#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO14)
#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO15)
|
#define MICROPY_HW_BOARD_NAME "Raspberry Pi Zero 2W"
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO3)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO2)
#define MICROPY_HW_LED_STATUS (&pin_GPIO29)
#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO14)
#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO15)
|
Add HW_LED_STATUS pin to Zero 2W board
|
Add HW_LED_STATUS pin to Zero 2W board
|
C
|
mit
|
adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython
|
73069b2287eb0d7c14508e158683463e496f19a6
|
kernel/kabort.c
|
kernel/kabort.c
|
#include "kputs.c"
void abort(void)
{
// TODO: Add proper kernel panic.
kputs("Kernel Panic! abort()\n");
while ( 1 ) { }
}
|
#ifndef KABORT_C
#define KABORT_C
#include "kputs.c"
void kabort(void)
{
// TODO: Add proper kernel panic.
kputs("Kernel Panic! abort()\n");
while ( 1 ) { }
}
#endif
|
Add header guards. Properly name function.
|
Add header guards. Properly name function.
|
C
|
mit
|
Herbstein/kernel-of-truth,awensaunders/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,Herbstein/kernel-of-truth,Herbstein/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,awensaunders/kernel-of-truth,awensaunders/kernel-of-truth
|
f1540aa94ffea5a5a241e69cfb317c6361421f03
|
src/replace_format_ptr.c
|
src/replace_format_ptr.c
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* replace_format_ptr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jlagneau <jlagneau@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/04/19 10:28:27 by jlagneau #+# #+# */
/* Updated: 2017/04/19 10:32:52 by jlagneau ### ########.fr */
/* */
/* ************************************************************************** */
#include <libft.h>
#include <ft_printf.h>
int replace_format_ptr(char *format, char *pos, va_list ap)
{
int ret;
char *tmp;
char *data;
tmp = NULL;
if (!(tmp = ft_itoa_base(va_arg(ap, unsigned int), BASE_HEX_LOWER)))
return (-1);
if (ft_strcmp(tmp, "0") == 0)
data = ft_strdup("(nil)");
else
data = ft_strjoin("0x", tmp);
ret = replace_format(format, data, pos, 2);
ft_strdel(&data);
ft_strdel(&tmp);
return (ret);
}
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* replace_format_ptr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jlagneau <jlagneau@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/04/19 10:28:27 by jlagneau #+# #+# */
/* Updated: 2017/04/19 12:10:38 by jlagneau ### ########.fr */
/* */
/* ************************************************************************** */
#include <libft.h>
#include <ft_printf.h>
int replace_format_ptr(char *format, char *pos, va_list ap)
{
int ret;
char *tmp;
char *data;
tmp = NULL;
if (!(tmp = ft_ltoa_base(va_arg(ap, unsigned long), BASE_HEX_LOWER)))
return (-1);
if (ft_strcmp(tmp, "0") == 0)
data = ft_strdup("(nil)");
else
data = ft_strjoin("0x", tmp);
ret = replace_format(format, data, pos, 2);
ft_strdel(&data);
ft_strdel(&tmp);
return (ret);
}
|
Fix format ptr from unsigned int to unsigned long
|
Fix format ptr from unsigned int to unsigned long
|
C
|
mit
|
jlagneau/libftprintf,jlagneau/libftprintf
|
9a779b1446afdf1f4b6d1b8ba598ffb329edccb3
|
Labs/Lab3/lab3_skeleton.c
|
Labs/Lab3/lab3_skeleton.c
|
/* Based on msp430g2xx3_wdt_02.c from the TI Examples */
#include <msp430.h>
int main(void)
{
WDTCTL = WDT_ADLY_250; // WDT 250ms, ACLK, interval timer
IE1 |= WDTIE; // Enable WDT interrupt
P1DIR |= BIT0; // Set P1.0 to output direction
__bis_SR_register(GIE); // Enable interrupts
while (1) {
__bis_SR_register(LPM3_bits); // Enter LPM3 w/interrupt
P1OUT ^= BIT0;
}
}
// Watchdog Timer interrupt service routine
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=WDT_VECTOR
__interrupt void watchdog_timer(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(WDT_VECTOR))) watchdog_timer (void)
#else
#error Compiler not supported!
#endif
{
__bic_SR_register_on_exit(LPM3_bits);
}
|
/* Based on msp430g2xx3_wdt_02.c from the TI Examples */
#include <msp430.h>
int main(void)
{
BCSCTL3 |= LFXT1S_2; // ACLK = VLO
WDTCTL = WDT_ADLY_250; // WDT 250ms, ACLK, interval timer
IE1 |= WDTIE; // Enable WDT interrupt
P1DIR |= BIT0; // Set P1.0 to output direction
__bis_SR_register(GIE); // Enable interrupts
while (1) {
__bis_SR_register(LPM3_bits); // Enter LPM3 w/interrupt
P1OUT ^= BIT0;
}
}
// Watchdog Timer interrupt service routine
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=WDT_VECTOR
__interrupt void watchdog_timer(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(WDT_VECTOR))) watchdog_timer (void)
#else
#error Compiler not supported!
#endif
{
__bic_SR_register_on_exit(LPM3_bits);
}
|
Update lab3 skeleton code to properly source ACLK from VLO
|
Update lab3 skeleton code to properly source ACLK from VLO
|
C
|
mit
|
ckemere/ELEC327,ckemere/ELEC327,ckemere/ELEC327,ckemere/ELEC327,ckemere/ELEC327
|
9204bf4660feeb3acbc0de2500698adcfdfbd521
|
include/arch/x64/isr.h
|
include/arch/x64/isr.h
|
#pragma once
extern void _service_interrupt(void);
extern void isr0(void);
extern void isr1(void);
extern void isr2(void);
extern void isr3(void);
extern void isr4(void);
extern void isr5(void);
extern void isr6(void);
extern void isr7(void);
extern void isr8(void);
extern void isr9(void);
extern void isr10(void);
extern void isr11(void);
extern void isr12(void);
extern void isr13(void);
extern void isr14(void);
extern void isr15(void);
extern void isr16(void);
extern void isr17(void);
extern void isr18(void);
extern void isr19(void);
extern void isr20(void);
extern void isr21(void);
extern void isr22(void);
extern void isr23(void);
extern void isr24(void);
extern void isr25(void);
extern void isr26(void);
extern void isr27(void);
extern void isr28(void);
extern void isr29(void);
extern void isr30(void);
extern void isr31(void);
extern void isr32(void);
extern void isr33(void);
extern void isr34(void);
|
#pragma once
extern void _service_interrupt(void);
typedef void (*isr_f)(void);
extern void isr0(void);
extern void isr1(void);
extern void isr2(void);
extern void isr3(void);
extern void isr4(void);
extern void isr5(void);
extern void isr6(void);
extern void isr7(void);
extern void isr8(void);
extern void isr9(void);
extern void isr10(void);
extern void isr11(void);
extern void isr12(void);
extern void isr13(void);
extern void isr14(void);
extern void isr15(void);
extern void isr16(void);
extern void isr17(void);
extern void isr18(void);
extern void isr19(void);
extern void isr20(void);
extern void isr21(void);
extern void isr22(void);
extern void isr23(void);
extern void isr24(void);
extern void isr25(void);
extern void isr26(void);
extern void isr27(void);
extern void isr28(void);
extern void isr29(void);
extern void isr30(void);
extern void isr31(void);
extern void isr32(void);
extern void isr33(void);
extern void isr34(void);
|
Define convenient ISR function pointer type
|
Define convenient ISR function pointer type
|
C
|
mit
|
iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth
|
d4e57c88ba4f7d17d09b0f6287456c213a05c566
|
tensorflow/core/grappler/optimizers/tfg_passes_builder.h
|
tensorflow/core/grappler/optimizers/tfg_passes_builder.h
|
/* Copyright 2022 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_GRAPPLER_OPTIMIZERS_TFG_PASSES_BUILDER_H_
#define TENSORFLOW_CORE_GRAPPLER_OPTIMIZERS_TFG_PASSES_BUILDER_H_
#include "mlir/Pass/PassManager.h" // from @llvm-project
namespace mlir {
namespace tfg {
// Constructs the default graph/function-level TFG pass pipeline.
void DefaultGrapplerPipeline(PassManager& mgr);
// Constructs the default module-level TFG pass pipeline.
void DefaultModuleGrapplerPipeline(PassManager& mgr);
// Add a remapper pass to the given pass manager.
void RemapperPassBuilder(PassManager& mgr);
} // namespace tfg
} // namespace mlir
#endif // TENSORFLOW_CORE_GRAPPLER_OPTIMIZERS_TFG_PASSES_BUILDER_H_
|
/* Copyright 2022 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_GRAPPLER_OPTIMIZERS_TFG_PASSES_BUILDER_H_
#define TENSORFLOW_CORE_GRAPPLER_OPTIMIZERS_TFG_PASSES_BUILDER_H_
#include "mlir/Pass/PassManager.h" // from @llvm-project
namespace mlir {
namespace tfg {
// Constructs the default graph/function-level TFG pass pipeline.
void DefaultGrapplerPipeline(PassManager& manager);
// Constructs the default module-level TFG pass pipeline.
void DefaultModuleGrapplerPipeline(PassManager& manager);
// Add a remapper pass to the given pass manager.
void RemapperPassBuilder(PassManager& manager);
} // namespace tfg
} // namespace mlir
#endif // TENSORFLOW_CORE_GRAPPLER_OPTIMIZERS_TFG_PASSES_BUILDER_H_
|
Make function parameter names consistent between header and impl.
|
[tfg] Make function parameter names consistent between header and impl.
PiperOrigin-RevId: 446807976
|
C
|
apache-2.0
|
karllessard/tensorflow,yongtang/tensorflow,yongtang/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,paolodedios/tensorflow,karllessard/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,gautam1858/tensorflow,paolodedios/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,tensorflow/tensorflow,karllessard/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_link_static_libraries_once,gautam1858/tensorflow,paolodedios/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,karllessard/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,tensorflow/tensorflow,gautam1858/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,yongtang/tensorflow,tensorflow/tensorflow,yongtang/tensorflow,gautam1858/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,gautam1858/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,yongtang/tensorflow,yongtang/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,gautam1858/tensorflow,gautam1858/tensorflow,Intel-tensorflow/tensorflow,paolodedios/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,gautam1858/tensorflow
|
0235bd2ec4410a7d4e3fd7ef4fc6d2ac98730f30
|
src/adts/adts_display.h
|
src/adts/adts_display.h
|
#pragma once
#include <sched.h> /* sched_getcpu() */
#include <stdio.h> /* printf() */
/**
**************************************************************************
* \brief
* preprocessor conditional printf formatter output
*
* \details
* Input arguments are equivalent to printf. referrence printf man pages
* for api details
*
**************************************************************************
*/
#if defined(__ADTS_DISPLAY)
#define CDISPLAY(_format, ...) \
do { \
char _buffer[256] = {0}; \
\
sprintf(_buffer, _format, ## __VA_ARGS__); \
printf("%3d %4d %-25.25s %-30.30s %s\n", \
sched_getcpu(), __LINE__, __FILE__, __FUNCTION__, _buffer); \
\
/* Serialize console output on exit/error */ \
fflush(stdout); \
} while(0);
#else
#define CDISPLAY(_format, ...) /* compile disabled */
#endif
/**
**************************************************************************
* \details
* Count digits in decimal number
*
**************************************************************************
*/
inline size_t
adts_digits_decimal( int32_t val )
{
size_t digits = 0;
while (val) {
val /= 10;
digits++;
}
return digits;
} /* adts_digits_decimal() */
|
#pragma once
#include <sched.h> /* sched_getcpu() */
#include <stdio.h> /* printf() */
/**
**************************************************************************
* \brief
* preprocessor conditional printf formatter output
*
* \details
* Input arguments are equivalent to printf. referrence printf man pages
* for api details
*
**************************************************************************
*/
#if defined(__ADTS_DISPLAY)
#define CDISPLAY(_format, ...) \
do { \
char _buffer[256] = {0}; \
size_t _limit = sizeof(_buffer) - 1; \
\
snprintf(_buffer, _limit, _format, ## __VA_ARGS__); \
printf("%3d %4d %-25.25s %-30.30s %s\n", \
sched_getcpu(), __LINE__, __FILE__, __FUNCTION__, _buffer); \
\
/* Serialize console output on exit/error */ \
fflush(stdout); \
} while(0);
#else
#define CDISPLAY(_format, ...) /* compile disabled */
#endif
/**
**************************************************************************
* \details
* Count digits in decimal number
*
**************************************************************************
*/
inline size_t
adts_digits_decimal( int32_t val )
{
size_t digits = 0;
while (val) {
val /= 10;
digits++;
}
return digits;
} /* adts_digits_decimal() */
|
Add buffer overflow safety to CDISPLAY
|
Add buffer overflow safety to CDISPLAY
|
C
|
mit
|
78613/sample,78613/sample
|
f9fab9d5c1d8a5711cc6d4a32e06a720958c24aa
|
cineio-broadcast-ios/cineio-broadcast-ios/CineConstants.h
|
cineio-broadcast-ios/cineio-broadcast-ios/CineConstants.h
|
#import <Foundation/Foundation.h>
#define API_VERSION "1"
#define BASE_URL "https://www.cine.io/api/"
#define SDK_VERSION "0.6.1"
#define USER_AGENT "cineio-ios"
extern NSString* const BaseUrl;
extern NSString* const UserAgent;
|
#import <Foundation/Foundation.h>
#define API_VERSION "1"
#define BASE_URL "https://www.cine.io/api/"
#define SDK_VERSION "0.6.1"
#define USER_AGENT "cineio-ios"
extern NSString* const BaseUrl;
extern NSString* const UserAgent;
|
Add line break after import
|
Add line break after import
|
C
|
mit
|
DisruptiveMind/cineio-broadcast-ios,cine-io/cineio-broadcast-ios,sanchosrancho/cineio-broadcast-ios,jrstv/jrstv-broadcast-ios,gouravd/cineio-broadcast-ios
|
a67eb4aed742365cd175540372e5f94ff82f998c
|
doc/tutorial_src/set_contents.c
|
doc/tutorial_src/set_contents.c
|
#include <cgreen/cgreen.h>
#include <cgreen/mocks.h>
void convert_to_uppercase(char *converted_string, const char *original_string) {
mock(converted_string, original_string);
}
Ensure(setting_content_of_out_parameter) {
expect(convert_to_uppercase,
when(original_string, is_equal_to_string("upper case")),
will_set_content_of_parameter(&converted_string,
"UPPER CASE", 11));
}
|
#include <cgreen/cgreen.h>
#include <cgreen/mocks.h>
void convert_to_uppercase(char *converted_string, const char *original_string) {
mock(converted_string, original_string);
}
Ensure(setting_content_of_out_parameter) {
expect(convert_to_uppercase,
when(original_string, is_equal_to_string("upper case")),
will_set_content_of_parameter(converted_string,
"UPPER CASE", 11));
}
|
Fix error in example code
|
[doc][set_parameter] Fix error in example code
|
C
|
isc
|
cgreen-devs/cgreen,cgreen-devs/cgreen,cgreen-devs/cgreen,cgreen-devs/cgreen,cgreen-devs/cgreen
|
a0241bdf2645c1190a385faa685326f364bfc3c9
|
elang/hir/instruction_visitor.h
|
elang/hir/instruction_visitor.h
|
// Copyright 2014-2015 Project Vogue. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ELANG_HIR_INSTRUCTION_VISITOR_H_
#define ELANG_HIR_INSTRUCTION_VISITOR_H_
#include "base/macros.h"
#include "elang/hir/instructions_forward.h"
namespace elang {
namespace hir {
//////////////////////////////////////////////////////////////////////
//
// InstructionVisitor
//
class InstructionVisitor {
public:
#define V(Name, ...) virtual void Visit##Name(Name##Instruction* instruction);
FOR_EACH_HIR_INSTRUCTION(V)
#undef V
protected:
InstructionVisitor();
virtual ~InstructionVisitor();
virtual void DoDefaultVisit(Instruction* instruction);
private:
DISALLOW_COPY_AND_ASSIGN(InstructionVisitor);
};
} // namespace hir
} // namespace elang
#endif // ELANG_HIR_INSTRUCTION_VISITOR_H_
|
// Copyright 2014-2015 Project Vogue. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ELANG_HIR_INSTRUCTION_VISITOR_H_
#define ELANG_HIR_INSTRUCTION_VISITOR_H_
#include "base/macros.h"
#include "elang/hir/hir_export.h"
#include "elang/hir/instructions_forward.h"
namespace elang {
namespace hir {
//////////////////////////////////////////////////////////////////////
//
// InstructionVisitor
//
class ELANG_HIR_EXPORT InstructionVisitor {
public:
virtual ~InstructionVisitor();
#define V(Name, ...) virtual void Visit##Name(Name##Instruction* instruction);
FOR_EACH_HIR_INSTRUCTION(V)
#undef V
protected:
InstructionVisitor();
virtual void DoDefaultVisit(Instruction* instruction);
private:
DISALLOW_COPY_AND_ASSIGN(InstructionVisitor);
};
} // namespace hir
} // namespace elang
#endif // ELANG_HIR_INSTRUCTION_VISITOR_H_
|
Add DLL export attribute to |hir::InstructionVisitor| to use it in compiler.
|
elang/hir: Add DLL export attribute to |hir::InstructionVisitor| to use it in compiler.
|
C
|
apache-2.0
|
eval1749/elang,eval1749/elang,eval1749/elang,eval1749/elang,eval1749/elang
|
f354befe514c37daad8932e9c2c46e1efce38c58
|
Classes/ObjectiveSugar.h
|
Classes/ObjectiveSugar.h
|
// C SUGAR
#define unless(condition) if(!(condition))
// OBJC SUGAR
#import "NSNumber+ObjectiveSugar.h"
#import "NSArray+ObjectiveSugar.h"
#import "NSMutableArray+ObjectiveSugar.h"
#import "NSDictionary+ObjectiveSugar.h"
#import "NSSet+ObjectiveSugar.h"
#import "NSString+ObjectiveSugar.h"
|
// C SUGAR
#define unless(condition) if(!(condition))
// OBJC SUGAR
#import "NSNumber+ObjectiveSugar.h"
#import "NSArray+ObjectiveSugar.h"
#import "NSMutableArray+ObjectiveSugar.h"
#import "NSDictionary+ObjectiveSugar.h"
#import "NSSet+ObjectiveSugar.h"
#import "NSString+ObjectiveSugar.h"
|
Fix GCC_WARN_ABOUT_MISSING_NEWLINE in header file
|
Fix GCC_WARN_ABOUT_MISSING_NEWLINE in header file
|
C
|
mit
|
Anish-kumar-dev/ObjectiveSugar,rizvve/ObjectiveSugar,orta/ObjectiveSugar,supermarin/ObjectiveSugar,gank0326/ObjectiveSugar,oarrabi/ObjectiveSugar,target/ObjectiveSugar,ManagerOrganization/ObjectiveSugar
|
c87e619ae400b67537cee83894d25cbf25e777ba
|
tests/regression/30-fast_global_inits/03-performance.c
|
tests/regression/30-fast_global_inits/03-performance.c
|
// PARAM: --sets solver td3 --enable ana.int.interval --enable exp.partition-arrays.enabled --enable exp.fast_global_inits --set ana.activated "['base','expRelation','mallocWrapper']"
// Without fast_global_inits this takes >150s, when it is enabled < 0.1s
int global_array[50][500][20];
int main(void) {
for(int i =0; i < 50; i++) {
assert(global_array[i][42][7] == 0);
}
}
|
// PARAM: --sets solver td3 --enable ana.int.interval --enable exp.partition-arrays.enabled --enable exp.fast_global_inits --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper']"
// Without fast_global_inits this takes >150s, when it is enabled < 0.1s
int global_array[50][500][20];
int main(void) {
for(int i =0; i < 50; i++) {
assert(global_array[i][42][7] == 0);
}
}
|
Fix 30/03 by adding threadid and threadflag analyses
|
Fix 30/03 by adding threadid and threadflag analyses
|
C
|
mit
|
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
|
bf523de92bd31ded4cc8b3a071779fa38a166298
|
test/Frontend/rewrite-includes-missing.c
|
test/Frontend/rewrite-includes-missing.c
|
// RUN: %clang_cc1 -verify -E -frewrite-includes %s -o - | FileCheck -strict-whitespace %s
#include "foobar.h" // expected-error {{'foobar.h' file not found}}
// CHECK: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "foobar.h"
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}# 4 "/usr/local/google/home/blaikie/Development/llvm/src/tools/clang/test/Frontend/rewrite-includes-missing.c" 2{{$}}
|
// RUN: %clang_cc1 -verify -E -frewrite-includes %s -o - | FileCheck -strict-whitespace %s
#include "foobar.h" // expected-error {{'foobar.h' file not found}}
// CHECK: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "foobar.h"
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}# 4 "{{.*}}rewrite-includes-missing.c" 2{{$}}
|
Remove absolute path form include test.
|
Remove absolute path form include test.
Review feedback/bot failure from r158459 by Simon Atanasyan and Benjamin Kramer (on IRC).
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@158464 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
|
61ffbc5697130918aa600a031ab48ea76791acb9
|
server/session_context.h
|
server/session_context.h
|
#ifndef __MESSAGES__MESSAGE_CONTEXT_H__
#define __MESSAGES__MESSAGE_CONTEXT_H__
#include "request_message.h"
#include "reply_message.h"
#include "backend.h"
namespace traffic {
class SessionContext : public RequestVisitor
{
private:
std::unique_ptr<ReplyMessage> _message;
DataProvider::ptr_t _data_provider;
protected:
void visit(StatisticRequest const &request);
void visit(SummaryRequest const &request);
void visit(ErrorRequest const &request);
public:
bool process_data(void const *data, size_t const size);
void encode_result(std::string &out);
SessionContext(DataProvider::ptr_t provider);
virtual ~SessionContext() { }
};
}
#endif
|
#ifndef __MESSAGES__MESSAGE_CONTEXT_H__
#define __MESSAGES__MESSAGE_CONTEXT_H__
#include "request_message.h"
#include "reply_message.h"
#include "backend.h"
namespace traffic {
/**
* \brief This is the context for a request/reply session.
*
* This context is allocated for each request to process the data. It represents
* the glue between the server, the messages and the backend. It uses the
* RequestMessage interface to parse data to a request, implements the
* RequestVisitor interface to select the correct backend method to query and
* provide a interface to serialize the result to the wire format.
*/
class SessionContext : public RequestVisitor
{
private:
std::unique_ptr<ReplyMessage> _message;
DataProvider::ptr_t _data_provider;
protected:
void visit(StatisticRequest const &request);
void visit(SummaryRequest const &request);
void visit(ErrorRequest const &request);
public:
/**
* \brief Process raw request data in wire format.
*
* This is the entry point for the context to process its request. It
* gets the wire data of the request, transforms it to a request
* instance and give it to the backend. The result from the backend will
* be stored internally.
*
* \param data The pointer to the raw request data.
* \param size The size of the request data.
* \return false in case of error.
*/
bool process_data(void const *data, size_t const size);
/**
* \brief Encode the current reply data to the wire format.
*
* This serialize the current state (result from the backend or error
* message) to the reply wire format and put the result into the given
* string reference.
*
* \param out The string to write the result to.
*/
void encode_result(std::string &out);
/**
* \brief Creat a session context.
*
* This is done for every incomming data packet.
*
* \param provider The DataProvider to use for this request.
*/
SessionContext(DataProvider::ptr_t provider);
virtual ~SessionContext() { }
};
}
#endif
|
Add documentation to the SessionContext
|
Add documentation to the SessionContext
Signed-off-by: Jan Losinski <577c4104c61edf9f052c616c0c23e67bef4a9955@wh2.tu-dresden.de>
|
C
|
bsd-3-clause
|
agdsn/traffic-service-server,agdsn/traffic-service-server
|
416d6a4d4c78a068172d95c63d770616f25bc40d
|
src/term_printf.c
|
src/term_printf.c
|
// Print formatted output to the VGA terminal
#include "vga.h"
#include <stdarg.h>
void term_print_dec(int x)
{
int divisor = 1;
for (; divisor < x; divisor *= 10)
;
for (; divisor > 0; divisor /= 10)
term_putchar(((x / divisor) % 10) + '0');
}
void term_printf(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
for (int i = 0; fmt[i] != '\0'; i++) {
if (fmt[i] != '%') {
term_putchar(fmt[i]);
} else {
char fmt_type = fmt[++i];
switch (fmt_type) {
case '%':
term_putchar('%');
break;
case 'd':
term_print_dec(va_arg(args, int));
break;
case 's':
term_putsn(va_arg(args, char*));
break;
case 'c':
term_putchar(va_arg(args, int));
break;
default:
break;
}
}
}
va_end(args);
}
|
// Print formatted output to the VGA terminal
#include "vga.h"
#include <stdarg.h>
static void term_print_dec(int x)
{
int divisor = 1;
for (; divisor <= x; divisor *= 10)
;
divisor /= 10;
for (; divisor > 0; divisor /= 10)
term_putchar(((x / divisor) % 10) + '0');
}
void term_printf(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
for (int i = 0; fmt[i] != '\0'; i++) {
if (fmt[i] != '%') {
term_putchar(fmt[i]);
} else {
char fmt_type = fmt[++i];
switch (fmt_type) {
case '%':
term_putchar('%');
break;
case 'd':
term_print_dec(va_arg(args, int));
break;
case 's':
term_putsn(va_arg(args, char*));
break;
case 'c':
term_putchar(va_arg(args, int));
break;
default:
break;
}
}
}
va_end(args);
}
|
Fix term_print_dec Would print a leading 0 if number wasn't a power of 10
|
Fix term_print_dec
Would print a leading 0 if number wasn't a power of 10
|
C
|
mit
|
orodley/studix,orodley/studix
|
f48419666e645208c0156aecab1ee6157303da3c
|
arch/ppc/syslib/ibm_ocp.c
|
arch/ppc/syslib/ibm_ocp.c
|
#include <linux/module.h>
#include <asm/ocp.h>
struct ocp_sys_info_data ocp_sys_info = {
.opb_bus_freq = 50000000, /* OPB Bus Frequency (Hz) */
.ebc_bus_freq = 33333333, /* EBC Bus Frequency (Hz) */
};
EXPORT_SYMBOL(ocp_sys_info);
|
#include <linux/module.h>
#include <asm/ibm4xx.h>
#include <asm/ocp.h>
struct ocp_sys_info_data ocp_sys_info = {
.opb_bus_freq = 50000000, /* OPB Bus Frequency (Hz) */
.ebc_bus_freq = 33333333, /* EBC Bus Frequency (Hz) */
};
EXPORT_SYMBOL(ocp_sys_info);
|
Fix compile breakage for IBM/AMCC 4xx arch/ppc platforms
|
[POWERPC] Fix compile breakage for IBM/AMCC 4xx arch/ppc platforms
The IBM/AMCC 405 platforms don't compile anymore in the current
kernel version. This fixes the compile breakage.
Signed-off-by: Stefan Roese <44b7497c4bb5f3e8c071b12b7ece82766a88068d@denx.de>
Signed-off-by: Paul Mackerras <19a0ba370c443ba08d20b5061586430ab449ee8c@samba.org>
|
C
|
apache-2.0
|
TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas
|
ce5148894cbf4a465e2bc1158e8a4f8a729f6632
|
test/PCH/va_arg.c
|
test/PCH/va_arg.c
|
// Test this without pch.
// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include %S/va_arg.h %s -emit-llvm -o - &&
// Test with pch.
// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -o %t %S/va_arg.h &&
// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include-pch %t %s -emit-llvm -o -
char *g0(char** argv, int argc) { return argv[argc]; }
char *g(char **argv) {
f(g0, argv, 1, 2, 3);
}
|
// Test this without pch.
// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include %S/va_arg.h %s -emit-llvm -o - &&
// Test with pch.
// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -emit-pch -o %t %S/va_arg.h &&
// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include-pch %t %s -emit-llvm -o -
char *g0(char** argv, int argc) { return argv[argc]; }
char *g(char **argv) {
f(g0, argv, 1, 2, 3);
}
|
Fix a problem with the RUN line of one of the PCH tests
|
Fix a problem with the RUN line of one of the PCH tests
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@70227 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
apple/swift-clang,apple/swift-clang,llvm-mirror/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,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang
|
e4bf49a203afcee266a24cd5b7b4c49944a74f3b
|
Modules/unicodedatabase.c
|
Modules/unicodedatabase.c
|
/* ------------------------------------------------------------------------
unicodedatabase -- The Unicode 3.0 data base.
Data was extracted from the Unicode 3.0 UnicodeData.txt file.
Written by Marc-Andre Lemburg (mal@lemburg.com).
Rewritten for Python 2.0 by Fredrik Lundh (fredrik@pythonware.com)
Copyright (c) Corporation for National Research Initiatives.
------------------------------------------------------------------------ */
#include <stdlib.h>
#include "unicodedatabase.h"
/* read the actual data from a separate file! */
#include "unicodedata_db.h"
const _PyUnicode_DatabaseRecord *
_PyUnicode_Database_GetRecord(int code)
{
int index;
if (code < 0 || code >= 65536)
index = 0;
else {
index = index1[(code>>SHIFT)];
index = index2[(index<<SHIFT)+(code&((1<<SHIFT)-1))];
}
return &_PyUnicode_Database_Records[index];
}
const char *
_PyUnicode_Database_GetDecomposition(int code)
{
int index;
if (code < 0 || code >= 65536)
index = 0;
else {
index = decomp_index1[(code>>DECOMP_SHIFT)];
index = decomp_index2[(index<<DECOMP_SHIFT)+
(code&((1<<DECOMP_SHIFT)-1))];
}
return decomp_data[index];
}
|
/* ------------------------------------------------------------------------
unicodedatabase -- The Unicode 3.0 data base.
Data was extracted from the Unicode 3.0 UnicodeData.txt file.
Written by Marc-Andre Lemburg (mal@lemburg.com).
Rewritten for Python 2.0 by Fredrik Lundh (fredrik@pythonware.com)
Copyright (c) Corporation for National Research Initiatives.
------------------------------------------------------------------------ */
#include "Python.h"
#include "unicodedatabase.h"
/* read the actual data from a separate file! */
#include "unicodedata_db.h"
const _PyUnicode_DatabaseRecord *
_PyUnicode_Database_GetRecord(int code)
{
int index;
if (code < 0 || code >= 65536)
index = 0;
else {
index = index1[(code>>SHIFT)];
index = index2[(index<<SHIFT)+(code&((1<<SHIFT)-1))];
}
return &_PyUnicode_Database_Records[index];
}
const char *
_PyUnicode_Database_GetDecomposition(int code)
{
int index;
if (code < 0 || code >= 65536)
index = 0;
else {
index = decomp_index1[(code>>DECOMP_SHIFT)];
index = decomp_index2[(index<<DECOMP_SHIFT)+
(code&((1<<DECOMP_SHIFT)-1))];
}
return decomp_data[index];
}
|
Fix header file usage so that NULL is defined. NULL is needed by unicodedata_db.h.
|
Fix header file usage so that NULL is defined. NULL is needed by
unicodedata_db.h.
|
C
|
mit
|
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
|
05a117847b43d44f336bbf272a1063661431a5e5
|
arch/sh/kernel/topology.c
|
arch/sh/kernel/topology.c
|
#include <linux/cpu.h>
#include <linux/cpumask.h>
#include <linux/init.h>
#include <linux/percpu.h>
#include <linux/node.h>
#include <linux/nodemask.h>
static DEFINE_PER_CPU(struct cpu, cpu_devices);
static int __init topology_init(void)
{
int i, ret;
#ifdef CONFIG_NEED_MULTIPLE_NODES
for_each_online_node(i)
register_one_node(i);
#endif
for_each_present_cpu(i) {
ret = register_cpu(&per_cpu(cpu_devices, i), i);
if (unlikely(ret))
printk(KERN_WARNING "%s: register_cpu %d failed (%d)\n",
__FUNCTION__, i, ret);
}
return 0;
}
subsys_initcall(topology_init);
|
/*
* arch/sh/kernel/topology.c
*
* Copyright (C) 2007 Paul Mundt
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/cpu.h>
#include <linux/cpumask.h>
#include <linux/init.h>
#include <linux/percpu.h>
#include <linux/node.h>
#include <linux/nodemask.h>
static DEFINE_PER_CPU(struct cpu, cpu_devices);
static int __init topology_init(void)
{
int i, ret;
#ifdef CONFIG_NEED_MULTIPLE_NODES
for_each_online_node(i)
register_one_node(i);
#endif
for_each_present_cpu(i) {
ret = register_cpu(&per_cpu(cpu_devices, i), i);
if (unlikely(ret))
printk(KERN_WARNING "%s: register_cpu %d failed (%d)\n",
__FUNCTION__, i, ret);
}
#if defined(CONFIG_NUMA) && !defined(CONFIG_SMP)
/*
* In the UP case, make sure the CPU association is still
* registered under each node. Without this, sysfs fails
* to make the connection between nodes other than node0
* and cpu0.
*/
for_each_online_node(i)
if (i != numa_node_id())
register_cpu_under_node(raw_smp_processor_id(), i);
#endif
return 0;
}
subsys_initcall(topology_init);
|
Fix up cpu to node mapping in sysfs.
|
sh: Fix up cpu to node mapping in sysfs.
Currently cpu_to_node() is always 0 in the UP case, though
we do want to have the CPU association linked in under sysfs
even in the cases where we're only on a single CPU.
Fix this up, so we have the cpu0 link on all of the available
nodes that don't already have a CPU link of their own.
Signed-off-by: Paul Mundt <38b52dbb5f0b63d149982b6c5de788ec93a89032@linux-sh.org>
|
C
|
mit
|
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs
|
96355a918a22e53d0c2ae369aae77b2c7b4b276e
|
third_party/widevine/cdm/android/widevine_cdm_version.h
|
third_party/widevine/cdm/android/widevine_cdm_version.h
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WIDEVINE_CDM_VERSION_H_
#define WIDEVINE_CDM_VERSION_H_
#include "third_party/widevine/cdm/widevine_cdm_common.h"
// Indicates that the Widevine CDM is available.
#define WIDEVINE_CDM_AVAILABLE
// Indicates that AVC1 decoding is available for ISO BMFF CENC.
#define WIDEVINE_CDM_AVC1_SUPPORT_AVAILABLE
// Indicates that AAC decoding is available for ISO BMFF CENC.
#define WIDEVINE_CDM_AAC_SUPPORT_AVAILABLE
#endif // WIDEVINE_CDM_VERSION_H_
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WIDEVINE_CDM_VERSION_H_
#define WIDEVINE_CDM_VERSION_H_
#include "third_party/widevine/cdm/widevine_cdm_common.h"
// Indicates that the Widevine CDM is available.
#define WIDEVINE_CDM_AVAILABLE
#endif // WIDEVINE_CDM_VERSION_H_
|
Remove obsolete defines from Android CDM file.
|
Remove obsolete defines from Android CDM file.
BUG=349185
Review URL: https://codereview.chromium.org/1000863003
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#321407}
|
C
|
bsd-3-clause
|
ltilve/chromium,Chilledheart/chromium,Chilledheart/chromium,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,Chilledheart/chromium,fujunwei/chromium-crosswalk,ltilve/chromium,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,Just-D/chromium-1,Just-D/chromium-1,Fireblend/chromium-crosswalk,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,ltilve/chromium,Chilledheart/chromium,Just-D/chromium-1,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,ltilve/chromium,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,ltilve/chromium,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,Chilledheart/chromium,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,Chilledheart/chromium,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ltilve/chromium,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,ltilve/chromium,ltilve/chromium,Just-D/chromium-1,ltilve/chromium,Chilledheart/chromium,Fireblend/chromium-crosswalk
|
130935d333492d5cca8d508f4d28023dc0e2ed61
|
MoleQueue/job.h
|
MoleQueue/job.h
|
/******************************************************************************
This source file is part of the MoleQueue project.
Copyright 2011 Kitware, Inc.
This source code is released under the New BSD License, (the "License").
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 JOB_H
#define JOB_H
#include <QObject>
namespace MoleQueue {
class Queue;
class Program;
class Job : public QObject
{
Q_OBJECT
public:
explicit Job(const Program *program);
~Job();
void setName(const QString &name);
QString name() const;
void setTitle(const QString &title);
QString title() const;
const Program* program() const;
const Queue* queue() const;
private:
QString m_name;
QString m_title;
const Program* m_program;
};
} // end MoleQueue namespace
#endif // JOB_H
|
/******************************************************************************
This source file is part of the MoleQueue project.
Copyright 2011 Kitware, Inc.
This source code is released under the New BSD License, (the "License").
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 JOB_H
#define JOB_H
#include <QObject>
namespace MoleQueue {
class Queue;
class Program;
/**
* Class to represent an execution of a Program.
*/
class Job : public QObject
{
Q_OBJECT
public:
/** Creates a new job. */
explicit Job(const Program *program);
/* Destroys the job object. */
~Job();
/** Set the name of the job to \p name. */
void setName(const QString &name);
/** Returns the name of the job. */
QString name() const;
/** Sets the title of the job to \p title. */
void setTitle(const QString &title);
/** Returns the title for the job. */
QString title() const;
/** Returns the program that the job is a type of. */
const Program* program() const;
/** Returns the queue that the job is a member of. */
const Queue* queue() const;
private:
/** The name of the job. */
QString m_name;
/** The title of the job. */
QString m_title;
/** The program that the job is a type of. */
const Program* m_program;
};
} // end MoleQueue namespace
#endif // JOB_H
|
Add documentation for the Job class
|
Add documentation for the Job class
|
C
|
bsd-3-clause
|
OpenChemistry/molequeue,OpenChemistry/molequeue,OpenChemistry/molequeue
|
b6170a2ec91bd2e15e17710c651f227adf1518c8
|
SQGlobalMarco.h
|
SQGlobalMarco.h
|
//
// SQGlobalMarco.h
//
// Created by Shi Eric on 3/18/12.
// Copyright (c) 2012 Safe&Quick[http://www.saick.net]. All rights reserved.
//
#ifndef _SQGlobalMarco_h
#define _SQGlobalMarco_h
#define kMinOSVersion 4.0f
#define saferelease(foo) {if(foo != nil) {[foo release]; foo = nil;}}
#define isLandscape (UIInterfaceOrientationIsLandscape\
([[UIApplication sharedApplication] statusBarOrientation]))
#define isPad ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)]\
&& [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define isPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define kOSVersion (float)([[[UIDevice currentDevice] systemVersion] length] > 0 ? [[[UIDevice currentDevice] systemVersion] doubleValue] : kMinOSVersion)
#endif
|
//
// SQGlobalMarco.h
//
// Created by Shi Eric on 3/18/12.
// Copyright (c) 2012 Safe&Quick[http://www.saick.net]. All rights reserved.
//
#ifndef _SQGlobalMarco_h
#define _SQGlobalMarco_h
#define kMinOSVersion 4.0f
#define saferelease(foo) {if(foo != nil) {[foo release]; foo = nil;}}
#define isLandscape (UIInterfaceOrientationIsLandscape\
([[UIApplication sharedApplication] statusBarOrientation]))
#define isPad ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)]\
&& [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define isPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define kOSVersion (float)([[[UIDevice currentDevice] systemVersion] length] > 0 ? [[[UIDevice currentDevice] systemVersion] doubleValue] : kMinOSVersion)
#define kScreenSize [[UIScreen mainScreen] bounds].size
// Radians to degrees
#define RADIANS_TO_DEGREES(radians) ((radians) * (180.0 / M_PI))
// Degrees to radians
#define DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI)
#endif
|
Add kScreenSize and Radians to or from degrees
|
Add kScreenSize and Radians to or from degrees
|
C
|
mit
|
shjborage/SQCommonUtils
|
5ce8b438da24b7a2f2de771d9276a6a6789236a2
|
include/core/SkSpinlock.h
|
include/core/SkSpinlock.h
|
/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
// This file is not part of the public Skia API.
#ifndef SkSpinlock_DEFINED
#define SkSpinlock_DEFINED
#include "SkAtomics.h"
#define SK_DECLARE_STATIC_SPINLOCK(name) namespace {} static SkPODSpinlock name
// This class has no constructor and must be zero-initialized (the macro above does this).
class SkPODSpinlock {
public:
void acquire() {
// To act as a mutex, we need an acquire barrier if we take the lock.
if (sk_atomic_exchange(&fLocked, true, sk_memory_order_acquire)) {
// Lock was contended. Fall back to an out-of-line spin loop.
this->contendedAcquire();
}
}
void release() {
// To act as a mutex, we need a release barrier.
sk_atomic_store(&fLocked, false, sk_memory_order_release);
}
private:
void contendedAcquire();
bool fLocked;
};
// For non-global-static use cases, this is normally what you want.
class SkSpinlock : public SkPODSpinlock {
public:
SkSpinlock() { this->release(); }
};
#endif//SkSpinlock_DEFINED
|
/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
// This file is not part of the public Skia API.
#ifndef SkSpinlock_DEFINED
#define SkSpinlock_DEFINED
#include "SkAtomics.h"
#define SK_DECLARE_STATIC_SPINLOCK(name) namespace {} static SkPODSpinlock name
// This class has no constructor and must be zero-initialized (the macro above does this).
class SK_API SkPODSpinlock {
public:
void acquire() {
// To act as a mutex, we need an acquire barrier if we take the lock.
if (sk_atomic_exchange(&fLocked, true, sk_memory_order_acquire)) {
// Lock was contended. Fall back to an out-of-line spin loop.
this->contendedAcquire();
}
}
void release() {
// To act as a mutex, we need a release barrier.
sk_atomic_store(&fLocked, false, sk_memory_order_release);
}
private:
void contendedAcquire();
bool fLocked;
};
// For non-global-static use cases, this is normally what you want.
class SkSpinlock : public SkPODSpinlock {
public:
SkSpinlock() { this->release(); }
};
#endif//SkSpinlock_DEFINED
|
Fix componene debug build failure in chromium
|
Fix componene debug build failure in chromium
The error log is as follows:
../../third_party/skia/include/core/SkSpinlock.h:24: error: undefined reference to 'SkPODSpinlock::contendedAcquire()'
collect2: error: ld returned 1 exit status
[mtklein added below here]
Despite the presence in include/ and the added SK_API, this file is not part of Skia's public API... it's just used by files which are.
TBR=reed@google.com
Review URL: https://codereview.chromium.org/1229003004
|
C
|
apache-2.0
|
noselhq/skia,pcwalton/skia,qrealka/skia-hc,noselhq/skia,ominux/skia,tmpvar/skia.cc,todotodoo/skia,shahrzadmn/skia,noselhq/skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,google/skia,Hikari-no-Tenshi/android_external_skia,pcwalton/skia,Jichao/skia,rubenvb/skia,ominux/skia,aosp-mirror/platform_external_skia,tmpvar/skia.cc,pcwalton/skia,Hikari-no-Tenshi/android_external_skia,noselhq/skia,Jichao/skia,pcwalton/skia,nvoron23/skia,todotodoo/skia,google/skia,Jichao/skia,nvoron23/skia,ominux/skia,nvoron23/skia,rubenvb/skia,vanish87/skia,shahrzadmn/skia,noselhq/skia,nvoron23/skia,vanish87/skia,nvoron23/skia,aosp-mirror/platform_external_skia,noselhq/skia,vanish87/skia,aosp-mirror/platform_external_skia,shahrzadmn/skia,tmpvar/skia.cc,Jichao/skia,Jichao/skia,todotodoo/skia,qrealka/skia-hc,ominux/skia,Jichao/skia,tmpvar/skia.cc,pcwalton/skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,todotodoo/skia,nvoron23/skia,vanish87/skia,tmpvar/skia.cc,nvoron23/skia,aosp-mirror/platform_external_skia,vanish87/skia,google/skia,nvoron23/skia,rubenvb/skia,tmpvar/skia.cc,aosp-mirror/platform_external_skia,google/skia,HalCanary/skia-hc,shahrzadmn/skia,rubenvb/skia,google/skia,HalCanary/skia-hc,todotodoo/skia,vanish87/skia,todotodoo/skia,aosp-mirror/platform_external_skia,noselhq/skia,shahrzadmn/skia,ominux/skia,HalCanary/skia-hc,nvoron23/skia,shahrzadmn/skia,pcwalton/skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,qrealka/skia-hc,shahrzadmn/skia,qrealka/skia-hc,tmpvar/skia.cc,tmpvar/skia.cc,HalCanary/skia-hc,rubenvb/skia,google/skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,ominux/skia,todotodoo/skia,shahrzadmn/skia,qrealka/skia-hc,ominux/skia,HalCanary/skia-hc,Jichao/skia,google/skia,todotodoo/skia,qrealka/skia-hc,tmpvar/skia.cc,vanish87/skia,vanish87/skia,pcwalton/skia,ominux/skia,rubenvb/skia,qrealka/skia-hc,google/skia,Hikari-no-Tenshi/android_external_skia,Jichao/skia,shahrzadmn/skia,todotodoo/skia,google/skia,noselhq/skia,vanish87/skia,aosp-mirror/platform_external_skia,ominux/skia,rubenvb/skia,HalCanary/skia-hc,pcwalton/skia,pcwalton/skia,HalCanary/skia-hc,Jichao/skia,rubenvb/skia,noselhq/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,qrealka/skia-hc,HalCanary/skia-hc,google/skia
|
bcc6e1e952df31d96efb7b0e0e1198e103d16b2b
|
PolyMapGenerator/Structure.h
|
PolyMapGenerator/Structure.h
|
#ifndef STRUCTURE_H
#define STRUCTURE_H
#include <vector>
#include "Math/Vector2.h"
enum class BiomeType
{
Snow,
Tundra,
Mountain,
Taiga,
Shrubland,
TemprateDesert,
TemprateRainForest,
TemprateDeciduousForest,
Grassland,
TropicalRainForest,
TropicalSeasonalForest,
SubtropicalDesert,
Ocean,
Lake,
Beach,
Size,
None
};
// Forward Declaration
struct Edge;
struct Corner;
#endif
|
#ifndef STRUCTURE_H
#define STRUCTURE_H
#include <vector>
#include "Math/Vector2.h"
enum class BiomeType
{
Snow,
Tundra,
Mountain,
Taiga,
Shrubland,
TemprateDesert,
TemprateRainForest,
TemprateDeciduousForest,
Grassland,
TropicalRainForest,
TropicalSeasonalForest,
SubtropicalDesert,
Ocean,
Lake,
Beach,
Size,
None
};
// Forward Declaration
struct Edge;
struct Corner;
struct Center
{
unsigned int m_index;
Vector2 m_positon;
bool m_water;
bool m_ocean;
bool m_coast;
bool m_border;
BiomeType m_biome;
double m_elevation;
double m_moisture;
std::vector<Edge*> m_edges;
std::vector<Corner*> m_corners;
std::vector<Center*> m_centers;
using CenterIterator = std::vector<Center*>::iterator;
};
#endif
|
Declare struct Center's member variables
|
Declare struct Center's member variables
|
C
|
mit
|
utilForever/PolyMapGenerator
|
f30001b81814882577a9ab1e34f64b4d240ca99a
|
lithos_c/inc/Lth_assert.h
|
lithos_c/inc/Lth_assert.h
|
//-----------------------------------------------------------------------------
//
// Copyright © 2016 Project Golan
//
// See "LICENSE" for more information.
//
//-----------------------------------------------------------------------------
//
// Assertions.
//
//-----------------------------------------------------------------------------
#ifndef lithos3__Lth_assert_h
#define lithos3__Lth_assert_h
#include <stdio.h>
#ifdef NDEBUG
#define Lth_assert(expression) ((void)0)
#else
#define Lth_assert(expression) \
if(!(expression)) \
printf("[lithos3] Assertion failed in %s (%s:%i): %s\n", \
__func__, __FILE__, __LINE__, #expression); \
else \
((void)0)
#endif
#endif//lithos3__Lth_assert_h
|
//-----------------------------------------------------------------------------
//
// Copyright © 2016 Project Golan
//
// See "LICENSE" for more information.
//
//-----------------------------------------------------------------------------
//
// Assertions.
//
//-----------------------------------------------------------------------------
#ifndef lithos3__Lth_assert_h
#define lithos3__Lth_assert_h
#include <stdio.h>
#ifdef NDEBUG
#define Lth_assert(expression) ((void)0)
#else
#define Lth_assert(expression) \
if(!(expression)) \
fprintf(stderr, "[lithos3] Assertion failed in %s (%s:%i): %s\n", \
__func__, __FILE__, __LINE__, #expression); \
else \
((void)0)
#endif
#endif//lithos3__Lth_assert_h
|
Fix Lth_Assert not using stderr
|
assert: Fix Lth_Assert not using stderr
|
C
|
mit
|
Project-Golan/LithOS3
|
3b9c212a5cbb1e13ced92639ce83f7a48b8b2331
|
drivers/scsi/qla2xxx/qla_version.h
|
drivers/scsi/qla2xxx/qla_version.h
|
/*
* QLogic Fibre Channel HBA Driver
* Copyright (c) 2003-2008 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.03.01-k8"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 3
#define QLA_DRIVER_PATCH_VER 1
#define QLA_DRIVER_BETA_VER 0
|
/*
* QLogic Fibre Channel HBA Driver
* Copyright (c) 2003-2008 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.03.01-k9"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 3
#define QLA_DRIVER_PATCH_VER 1
#define QLA_DRIVER_BETA_VER 0
|
Update version number to 8.03.01-k9.
|
[SCSI] qla2xxx: Update version number to 8.03.01-k9.
Signed-off-by: Giridhar Malavali <799b6491fce2c7a80b5fedcf9a728560cc9eb954@qlogic.com>
Signed-off-by: James Bottomley <407b36959ca09543ccda8f8e06721c791bc53435@suse.de>
|
C
|
mit
|
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs
|
abe85e1caed9feb7bacd69e85eaa479e3f1020ab
|
freestanding/stdarg.h
|
freestanding/stdarg.h
|
#ifndef _STDARG_H
#define _STDARG_H
// As defined in the System V x86-64 ABI spec, in section 3.5.7
typedef struct {
unsigned int next_int_reg_offset;
unsigned int next_vector_reg_offset;
void *next_stack_arg;
void *register_save_area;
} va_list[1];
#define va_start(list, last_arg) __builtin_va_start(list)
#define va_arg(list, type) __builtin_va_arg(list, type)
#define va_end(args) __builtin_va_end(list)
static unsigned long __builtin_va_arg_uint64(va_list list)
{
unsigned long result;
if (list->next_int_reg_offset >= 48) {
result = *(unsigned long *)list->next_stack_arg;
list->next_stack_arg = (char *)list->next_stack_arg + 8;
} else {
result = *(unsigned long *)
((char *)list->register_save_area + list->next_int_reg_offset);
list->next_int_reg_offset += 8;
}
return result;
}
#endif
|
#ifndef _STDARG_H
#define _STDARG_H
// As defined in the System V x86-64 ABI spec, in section 3.5.7
typedef struct {
unsigned int next_int_reg_offset;
unsigned int next_vector_reg_offset;
void *next_stack_arg;
void *register_save_area;
} va_list[1];
#define va_start(list, last_arg) __builtin_va_start(list)
#define va_arg(list, type) __builtin_va_arg(list, type)
#define va_end(list) __builtin_va_end(list)
static unsigned long __builtin_va_arg_uint64(va_list list)
{
unsigned long result;
if (list->next_int_reg_offset >= 48) {
result = *(unsigned long *)list->next_stack_arg;
list->next_stack_arg = (char *)list->next_stack_arg + 8;
} else {
result = *(unsigned long *)
((char *)list->register_save_area + list->next_int_reg_offset);
list->next_int_reg_offset += 8;
}
return result;
}
#endif
|
Fix dumb bug in va_end.
|
Fix dumb bug in va_end.
This was never noticed because we don't actually use the argument to
va_end.
|
C
|
mit
|
orodley/naive,orodley/naive,orodley/naive,orodley/naive
|
8b432d0e483c84b22255cc3518423dcbca6c3270
|
include/TextMetrics.h
|
include/TextMetrics.h
|
#ifndef _TEXTMETRICS_H_
#define _TEXTMETRICS_H_
namespace canvas {
class TextMetrics {
public:
TextMetrics() : width(0) { }
TextMetrics(float _width) : width(_width) { }
float width;
#if 0
float ideographicBaseline;
float alphabeticBaseline;
float hangingBaseline;
float emHeightDescent;
float emHeightAscent;
float actualBoundingBoxDescent;
float actualBoundingBoxAscent;
float fontBoundingBoxDescent;
float fontBoundingBoxAscent;
float actualBoundingBoxRight;
float actualBoundingBoxLeft;
#endif
};
};
#endif
|
#ifndef _TEXTMETRICS_H_
#define _TEXTMETRICS_H_
namespace canvas {
class TextMetrics {
public:
TextMetrics() : width(0) { }
TextMetrics(float _width) : width(_width) { }
TextMetrics(float _width, float fontBoundingBoxDescent, float _fontBoundingBoxAscent) :
width(_width) fontBoundingBoxDescent(_fontBoundingBoxDescent) fontBoundingBoxAscent(_fontBoundingBoxAscent) { }
float width;
float fontBoundingBoxDescent;
float fontBoundingBoxAscent;
#if 0
float ideographicBaseline;
float alphabeticBaseline;
float hangingBaseline;
float emHeightDescent;
float emHeightAscent;
float actualBoundingBoxDescent;
float actualBoundingBoxAscent;
float actualBoundingBoxRight;
float actualBoundingBoxLeft;
#endif
};
};
#endif
|
Add fontBoundingDescent and Ascent and add constructor with them
|
Add fontBoundingDescent and Ascent and add constructor with them
|
C
|
mit
|
rekola/canvas,Sometrik/canvas,Sometrik/canvas,rekola/canvas
|
44a05e70ec7310f90d053818a4f650b82e1512ee
|
include/ipc_ns.h
|
include/ipc_ns.h
|
#ifndef IPC_NS_H_
#define IPC_NS_H_
#include "crtools.h"
extern void show_ipc_ns(int fd);
extern int dump_ipc_ns(int ns_pid, struct cr_fdset *fdset);
extern int prepare_ipc_ns(int pid);
#endif /* IPC_NS_H_ */
|
#ifndef CR_IPC_NS_H_
#define CR_IPC_NS_H_
#include "crtools.h"
extern void show_ipc_ns(int fd);
extern int dump_ipc_ns(int ns_pid, struct cr_fdset *fdset);
extern int prepare_ipc_ns(int pid);
#endif /* CR_IPC_NS_H_ */
|
Add CR_ prefix to header defines
|
ips_ns.h: Add CR_ prefix to header defines
Reported-by: Stanislav Kinsbursky <43b28e187c4fe6e53d7ab0bb71957481e322f182@parallels.com>
Signed-off-by: Cyrill Gorcunov <7a1ea01eee6961eb1e372e3508c2670446d086f4@openvz.org>
|
C
|
lgpl-2.1
|
KKoukiou/criu-remote,tych0/criu,ldu4/criu,svloyso/criu,fbocharov/criu,AuthenticEshkinKot/criu,svloyso/criu,efiop/criu,efiop/criu,gonkulator/criu,AuthenticEshkinKot/criu,biddyweb/criu,KKoukiou/criu-remote,AuthenticEshkinKot/criu,rentzsch/criu,wtf42/criu,marcosnils/criu,AuthenticEshkinKot/criu,gonkulator/criu,gonkulator/criu,LK4D4/criu,rentzsch/criu,sdgdsffdsfff/criu,efiop/criu,eabatalov/criu,eabatalov/criu,fbocharov/criu,ldu4/criu,tych0/criu,sdgdsffdsfff/criu,svloyso/criu,fbocharov/criu,LK4D4/criu,KKoukiou/criu-remote,rentzsch/criu,kawamuray/criu,svloyso/criu,wtf42/criu,sdgdsffdsfff/criu,biddyweb/criu,marcosnils/criu,gonkulator/criu,gablg1/criu,biddyweb/criu,fbocharov/criu,efiop/criu,rentzsch/criu,sdgdsffdsfff/criu,efiop/criu,tych0/criu,LK4D4/criu,gablg1/criu,kawamuray/criu,eabatalov/criu,wtf42/criu,sdgdsffdsfff/criu,ldu4/criu,marcosnils/criu,biddyweb/criu,KKoukiou/criu-remote,tych0/criu,wtf42/criu,gonkulator/criu,fbocharov/criu,svloyso/criu,gablg1/criu,tych0/criu,eabatalov/criu,wtf42/criu,sdgdsffdsfff/criu,gonkulator/criu,kawamuray/criu,kawamuray/criu,ldu4/criu,rentzsch/criu,ldu4/criu,wtf42/criu,kawamuray/criu,LK4D4/criu,rentzsch/criu,gablg1/criu,svloyso/criu,marcosnils/criu,marcosnils/criu,ldu4/criu,AuthenticEshkinKot/criu,kawamuray/criu,eabatalov/criu,marcosnils/criu,AuthenticEshkinKot/criu,gablg1/criu,biddyweb/criu,efiop/criu,tych0/criu,fbocharov/criu,LK4D4/criu,eabatalov/criu,biddyweb/criu,LK4D4/criu,gablg1/criu,KKoukiou/criu-remote,KKoukiou/criu-remote
|
764632646a762e3ce9269676bf982b033d5d7785
|
includes/Utils.h
|
includes/Utils.h
|
#ifndef UTILS_H
#define UTILS_H
class Utils {
public:
static const std::size_t CalculatePadding(const std::size_t offset, const std::size_t alignment) {
const std::size_t multiplier = (offset / alignment) + 1;
const std::size_t padding = (multiplier * alignment) - offset;
return padding;
}
};
#endif /* UTILS_H */
|
#ifndef UTILS_H
#define UTILS_H
class Utils {
public:
static const std::size_t CalculatePadding(const std::size_t baseAddress, const std::size_t alignment) {
const std::size_t multiplier = (baseAddress / alignment) + 1;
const std::size_t alignedAddress = multiplier * alignment;
const std::size_t padding = alignedAddress - baseAddress;
return padding;
}
};
#endif /* UTILS_H */
|
Rename first parameter to baseAddres to avoid confusion
|
Rename first parameter to baseAddres to avoid confusion
|
C
|
mit
|
mtrebi/memory-allocators
|
c971b045e63517ceab1c26ca49a6e1ec436d92a8
|
tails_files/securedrop_init.c
|
tails_files/securedrop_init.c
|
#include <unistd.h>
int main(int argc, char* argv) {
setuid(0);
// Use absolute path to the Python binary and execl to avoid $PATH or symlink trickery
execl("/usr/bin/python2.7", "python2.7", "/home/vagrant/tails_files/test.py", (char*)NULL);
return 0;
}
|
#include <unistd.h>
int main(int argc, char* argv) {
setuid(0);
// Use absolute path to the Python binary and execl to avoid $PATH or symlink trickery
execl("/usr/bin/python2.7", "python2.7", "/home/amnesia/Persistent/.securedrop/securedrop_init.py", (char*)NULL);
return 0;
}
|
Fix path in tails_files C wrapper
|
Fix path in tails_files C wrapper
|
C
|
agpl-3.0
|
jaseg/securedrop,jeann2013/securedrop,kelcecil/securedrop,jrosco/securedrop,ageis/securedrop,jrosco/securedrop,chadmiller/securedrop,GabeIsman/securedrop,jaseg/securedrop,pwplus/securedrop,GabeIsman/securedrop,harlo/securedrop,chadmiller/securedrop,heartsucker/securedrop,heartsucker/securedrop,jeann2013/securedrop,pwplus/securedrop,heartsucker/securedrop,jrosco/securedrop,harlo/securedrop,pwplus/securedrop,conorsch/securedrop,micahflee/securedrop,ehartsuyker/securedrop,chadmiller/securedrop,jrosco/securedrop,ehartsuyker/securedrop,chadmiller/securedrop,pwplus/securedrop,chadmiller/securedrop,kelcecil/securedrop,micahflee/securedrop,GabeIsman/securedrop,harlo/securedrop,ehartsuyker/securedrop,heartsucker/securedrop,ehartsuyker/securedrop,ageis/securedrop,ehartsuyker/securedrop,GabeIsman/securedrop,ageis/securedrop,harlo/securedrop,kelcecil/securedrop,jeann2013/securedrop,ageis/securedrop,conorsch/securedrop,jeann2013/securedrop,jeann2013/securedrop,conorsch/securedrop,kelcecil/securedrop,GabeIsman/securedrop,harlo/securedrop,micahflee/securedrop,jrosco/securedrop,garrettr/securedrop,jaseg/securedrop,garrettr/securedrop,jaseg/securedrop,heartsucker/securedrop,harlo/securedrop,conorsch/securedrop,GabeIsman/securedrop,kelcecil/securedrop,garrettr/securedrop,jaseg/securedrop,ehartsuyker/securedrop,jaseg/securedrop,micahflee/securedrop,kelcecil/securedrop,pwplus/securedrop,conorsch/securedrop,pwplus/securedrop,jeann2013/securedrop,chadmiller/securedrop,jrosco/securedrop,garrettr/securedrop
|
8f74beb56f217b8a6e5307e6ca4d770e0b493d1f
|
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( uint16_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 ^= 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;
}
|
Fix types in CRC16 function
|
Fix types in CRC16 function
|
C
|
mit
|
Jacajack/modlib
|
dd9f4d4919164ce842502ece64583f13df8cc737
|
src/vast/actor.h
|
src/vast/actor.h
|
#ifndef VAST_ACTOR_H
#define VAST_ACTOR_H
#include <cppa/event_based_actor.hpp>
#include "vast/logger.h"
namespace vast {
namespace exit {
constexpr uint32_t done = cppa::exit_reason::user_defined;
constexpr uint32_t stop = cppa::exit_reason::user_defined + 1;
constexpr uint32_t error = cppa::exit_reason::user_defined + 2;
} // namespace exit
/// An actor enhanced in
template <typename Derived>
class actor : public cppa::event_based_actor
{
public:
/// Implements `cppa::event_based_actor::init`.
virtual void init() override
{
VAST_LOG_ACTOR_VERBOSE(derived()->description(), "spawned");
derived()->act();
if (! has_behavior())
{
VAST_LOG_ACTOR_ERROR(derived()->description(),
"act() did not set a behavior, terminating");
quit();
}
}
/// Overrides `event_based_actor::on_exit`.
virtual void on_exit() override
{
VAST_LOG_ACTOR_VERBOSE(derived()->description(), "terminated");
}
private:
Derived const* derived() const
{
return static_cast<Derived const*>(this);
}
Derived* derived()
{
return static_cast<Derived*>(this);
}
};
} // namespace vast
#endif
|
#ifndef VAST_ACTOR_H
#define VAST_ACTOR_H
#include <cppa/event_based_actor.hpp>
#include "vast/logger.h"
namespace vast {
namespace exit {
constexpr uint32_t done = cppa::exit_reason::user_defined;
constexpr uint32_t stop = cppa::exit_reason::user_defined + 1;
constexpr uint32_t error = cppa::exit_reason::user_defined + 2;
} // namespace exit
/// An actor enhanced in
template <typename Derived>
class actor : public cppa::event_based_actor
{
public:
/// Implements `cppa::event_based_actor::init`.
virtual void init() override
{
VAST_LOG_ACTOR_VERBOSE(derived()->description(), "spawned");
derived()->act();
if (! has_behavior())
{
VAST_LOG_ACTOR_ERROR(derived()->description(),
"act() did not set a behavior, terminating");
quit(exit::error);
}
}
/// Overrides `event_based_actor::on_exit`.
virtual void on_exit() override
{
VAST_LOG_ACTOR_VERBOSE(derived()->description(), "terminated");
}
private:
Derived const* derived() const
{
return static_cast<Derived const*>(this);
}
Derived* derived()
{
return static_cast<Derived*>(this);
}
};
} // namespace vast
#endif
|
Exit with error on missing behavior.
|
Exit with error on missing behavior.
|
C
|
bsd-3-clause
|
pmos69/vast,mavam/vast,mavam/vast,vast-io/vast,pmos69/vast,vast-io/vast,pmos69/vast,vast-io/vast,pmos69/vast,mavam/vast,mavam/vast,vast-io/vast,vast-io/vast
|
b5583121378597058f8f083243d2299fd262e509
|
webkit/glue/plugins/ppb_private.h
|
webkit/glue/plugins/ppb_private.h
|
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_
#define WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_
#include "ppapi/c/pp_var.h"
#define PPB_PRIVATE_INTERFACE "PPB_Private;1"
typedef enum _ppb_ResourceString {
PPB_RESOURCE_STRING_PDF_GET_PASSWORD = 0,
} PP_ResourceString;
typedef struct _ppb_Private {
// Returns a localized string.
PP_Var (*GetLocalizedString)(PP_ResourceString string_id);
} PPB_Private;
#endif // WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_
|
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_
#define WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_
#include "third_party/ppapi/c/pp_var.h"
#define PPB_PRIVATE_INTERFACE "PPB_Private;1"
typedef enum _ppb_ResourceString {
PPB_RESOURCE_STRING_PDF_GET_PASSWORD = 0,
} PP_ResourceString;
typedef struct _ppb_Private {
// Returns a localized string.
PP_Var (*GetLocalizedString)(PP_ResourceString string_id);
} PPB_Private;
#endif // WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_
|
Add third_party/ prefix to ppapi include for checkdeps.
|
Add third_party/ prefix to ppapi include for checkdeps.
The only users of this ppb should be inside chrome so this should work fine.
TBR=jam@chromium.org
Review URL: http://codereview.chromium.org/3019006
git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@52766 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
|
C
|
bsd-3-clause
|
wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser
|
bb824d72ab4db6bef2562f6129e6742f6fcbfc7d
|
src/gui/qxtfilterdialog_p.h
|
src/gui/qxtfilterdialog_p.h
|
#ifndef QXTFILTERDIALOG_P_H_INCLUDED
#define QXTFILTERDIALOG_P_H_INCLUDED
#include <QObject>
#include <QModelIndex>
#include <QRegExp>
#include <QPointer>
#include "qxtpimpl.h"
class QxtFilterDialog;
class QAbstractItemModel;
class QTreeView;
class QSortFilterProxyModel;
class QLineEdit;
class QCheckBox;
class QComboBox;
class QxtFilterDialogPrivate : public QObject, public QxtPrivate<QxtFilterDialog>
{
Q_OBJECT
public:
QxtFilterDialogPrivate();
QXT_DECLARE_PUBLIC(QxtFilterDialog);
/*widgets*/
QCheckBox * matchCaseOption;
QCheckBox * filterModeOption;
QComboBox * filterMode;
QTreeView * listingTreeView;
QLineEdit * lineEditFilter;
/*models*/
QPointer<QAbstractItemModel> model;
QSortFilterProxyModel* proxyModel;
/*properties*/
int lookupColumn;
int lookupRole;
QRegExp::PatternSyntax syntax;
Qt::CaseSensitivity caseSensitivity;
/*result*/
QModelIndex selectedIndex;
/*member functions*/
void updateFilterPattern();
public slots:
void createRegExpPattern(const QString &rawText);
void filterModeOptionStateChanged(const int state);
void matchCaseOptionStateChanged(const int state);
void filterModeChoosen(int index);
};
#endif
|
#ifndef QXTFILTERDIALOG_P_H_INCLUDED
#define QXTFILTERDIALOG_P_H_INCLUDED
#include <QObject>
#include <QModelIndex>
#include <QRegExp>
#include <QPointer>
#include "qxtpimpl.h"
class QxtFilterDialog;
class QAbstractItemModel;
class QTreeView;
class QSortFilterProxyModel;
class QLineEdit;
class QCheckBox;
class QComboBox;
class QxtFilterDialogPrivate : public QObject, public QxtPrivate<QxtFilterDialog>
{
Q_OBJECT
public:
QxtFilterDialogPrivate();
QXT_DECLARE_PUBLIC(QxtFilterDialog);
/*widgets*/
QCheckBox * matchCaseOption;
QCheckBox * filterModeOption;
QComboBox * filterMode;
QTreeView * listingTreeView;
QLineEdit * lineEditFilter;
/*models*/
QPointer<QAbstractItemModel> model;
QSortFilterProxyModel* proxyModel;
/*properties*/
int lookupColumn;
int lookupRole;
QRegExp::PatternSyntax syntax;
Qt::CaseSensitivity caseSensitivity;
/*result*/
QModelIndex selectedIndex;
/*member functions*/
void updateFilterPattern();
public slots:
void createRegExpPattern(const QString &rawText);
void filterModeOptionStateChanged(const int state);
void matchCaseOptionStateChanged(const int state);
void filterModeChoosen(int index);
};
#endif
|
Fix bad fileformat (was DOS without a final line terminator)
|
Fix bad fileformat (was DOS without a final line terminator)
|
C
|
bsd-3-clause
|
hrobeers/qxtweb-qt5,hrobeers/qxtweb-qt5,hrobeers/qxtweb-qt5,mmitkevich/libqxt,mmitkevich/libqxt,mmitkevich/libqxt,hrobeers/qxtweb-qt5,mmitkevich/libqxt,hrobeers/qxtweb-qt5
|
4dfe89bbf3a6f56e3eb3c5991036a6027d627543
|
indexer/config.h
|
indexer/config.h
|
//#define DEBUG_INDEXER
#define MAX_CORPUS_FILE_SZ (1024 * 8)
|
//#define DEBUG_INDEXER
#define MAX_CORPUS_FILE_SZ (1024 * 1024 * 16)
|
Increase corpus buffer to 16MB
|
Increase corpus buffer to 16MB
|
C
|
mit
|
yzhan018/the-day-after-tomorrow,t-k-/the-day-after-tomorrow,approach0/search-engine,approach0/search-engine,yzhan018/the-day-after-tomorrow,yzhan018/the-day-after-tomorrow,t-k-/the-day-after-tomorrow,approach0/search-engine,approach0/search-engine,yzhan018/the-day-after-tomorrow,t-k-/the-day-after-tomorrow,t-k-/the-day-after-tomorrow,yzhan018/the-day-after-tomorrow,t-k-/the-day-after-tomorrow,yzhan018/the-day-after-tomorrow,yzhan018/the-day-after-tomorrow,t-k-/the-day-after-tomorrow,t-k-/the-day-after-tomorrow
|
28b213cfe02713b8a0a986cb5f6efb3058dacb5f
|
TMEVSIM/TMevSimConverter.h
|
TMEVSIM/TMevSimConverter.h
|
#ifndef ROOT_TMevSimConverter
#define ROOT_TMevSimConverter
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
#include "TObject.h"
class TMevSimConverter : public TObject {
enum {kMaxParticles = 35};
Int_t fNPDGCodes; // Number of PDG codes known by G3
Int_t fPDGCode [kMaxParticles]; // Translation table of PDG codes
void DefineParticles();
public:
TMevSimConverter() {DefineParticles();}
virtual ~TMevSimConverter() {}
Int_t PDGFromId(Int_t gpid);
Int_t IdFromPDG(Int_t pdg);
ClassDef(TMevSimConverter,1)
};
#endif
|
#ifndef ROOT_TMevSimConverter
#define ROOT_TMevSimConverter
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
#include "TObject.h"
class TMevSimConverter : public TObject {
enum {kMaxParticles = 35};
Int_t fNPDGCodes; // Number of PDG codes known by G3
Int_t fPDGCode [kMaxParticles]; // Translation table of PDG codes
void DefineParticles();
public:
TMevSimConverter() : fNPDGCodes(0) {DefineParticles();}
virtual ~TMevSimConverter() {}
Int_t PDGFromId(Int_t gpid);
Int_t IdFromPDG(Int_t pdg);
ClassDef(TMevSimConverter,1)
};
#endif
|
Initialize fNPDGcodes to 0 to prevent sigsegv (Christian)
|
Initialize fNPDGcodes to 0 to prevent sigsegv (Christian)
|
C
|
bsd-3-clause
|
coppedis/AliRoot,ALICEHLT/AliRoot,alisw/AliRoot,coppedis/AliRoot,shahor02/AliRoot,mkrzewic/AliRoot,ALICEHLT/AliRoot,ALICEHLT/AliRoot,shahor02/AliRoot,shahor02/AliRoot,alisw/AliRoot,mkrzewic/AliRoot,shahor02/AliRoot,ecalvovi/AliRoot,coppedis/AliRoot,mkrzewic/AliRoot,mkrzewic/AliRoot,ecalvovi/AliRoot,miranov25/AliRoot,shahor02/AliRoot,sebaleh/AliRoot,jgrosseo/AliRoot,miranov25/AliRoot,coppedis/AliRoot,alisw/AliRoot,ecalvovi/AliRoot,coppedis/AliRoot,alisw/AliRoot,sebaleh/AliRoot,coppedis/AliRoot,jgrosseo/AliRoot,jgrosseo/AliRoot,sebaleh/AliRoot,miranov25/AliRoot,ALICEHLT/AliRoot,jgrosseo/AliRoot,ecalvovi/AliRoot,mkrzewic/AliRoot,alisw/AliRoot,miranov25/AliRoot,miranov25/AliRoot,sebaleh/AliRoot,ALICEHLT/AliRoot,ecalvovi/AliRoot,ALICEHLT/AliRoot,ecalvovi/AliRoot,alisw/AliRoot,shahor02/AliRoot,mkrzewic/AliRoot,miranov25/AliRoot,sebaleh/AliRoot,mkrzewic/AliRoot,coppedis/AliRoot,sebaleh/AliRoot,alisw/AliRoot,miranov25/AliRoot,sebaleh/AliRoot,jgrosseo/AliRoot,jgrosseo/AliRoot,ecalvovi/AliRoot,shahor02/AliRoot,alisw/AliRoot,jgrosseo/AliRoot,ALICEHLT/AliRoot,miranov25/AliRoot,coppedis/AliRoot
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.