commit
stringlengths 40
40
| old_file
stringlengths 4
112
| new_file
stringlengths 4
112
| old_contents
stringlengths 0
2.05k
| new_contents
stringlengths 28
3.9k
| subject
stringlengths 17
736
| message
stringlengths 18
4.78k
| lang
stringclasses 1
value | license
stringclasses 13
values | repos
stringlengths 7
111k
|
---|---|---|---|---|---|---|---|---|---|
ab734ec5a64b364fcf8aff3d91eea860887afc42 | onnxruntime/core/framework/tensor_external_data_info.h | onnxruntime/core/framework/tensor_external_data_info.h | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include <string>
#include "core/common/status.h"
#include "core/graph/onnx_protobuf.h"
#include "core/session/onnxruntime_c_api.h"
namespace onnxruntime {
class ExternalDataInfo {
private:
std::basic_string<ORTCHAR_T> rel_path_;
//-1 means doesn't exist
ptrdiff_t offset_;
//-1 means doesn't exist
ptrdiff_t length_;
std::string checksum_;
public:
const std::basic_string<ORTCHAR_T>& GetRelPath() const { return rel_path_; }
ptrdiff_t GetOffset() const { return offset_; }
ptrdiff_t GetLength() const { return length_; }
const std::string& GetChecksum() const { return checksum_; }
// If the value of 'offset' or 'length' field is larger the max value of ssize_t, this function will treat it as a
// wrong value and return FAIL.
static common::Status Create(const ::google::protobuf::RepeatedPtrField<::ONNX_NAMESPACE::StringStringEntryProto>& input,
std::unique_ptr<ExternalDataInfo>& out);
};
} // namespace onnxruntime | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include <string>
#include "core/common/status.h"
#include "core/graph/onnx_protobuf.h"
#include "core/session/onnxruntime_c_api.h"
namespace onnxruntime {
class ExternalDataInfo {
private:
std::basic_string<ORTCHAR_T> rel_path_;
ptrdiff_t offset_ = 0;
ptrdiff_t length_ = 0;
std::string checksum_;
public:
const std::basic_string<ORTCHAR_T>& GetRelPath() const { return rel_path_; }
ptrdiff_t GetOffset() const { return offset_; }
ptrdiff_t GetLength() const { return length_; }
const std::string& GetChecksum() const { return checksum_; }
// If the value of 'offset' or 'length' field is larger the max value of ssize_t, this function will treat it as a
// wrong value and return FAIL.
static common::Status Create(const ::google::protobuf::RepeatedPtrField<::ONNX_NAMESPACE::StringStringEntryProto>& input,
std::unique_ptr<ExternalDataInfo>& out);
};
} // namespace onnxruntime | Fix a bug in ExternalDataInfo | Fix a bug in ExternalDataInfo
| C | mit | microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime |
ec2bf942662f8a8f1049b80208192691b64da6a5 | React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h | React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <UIKit/UIKit.h>
#import <React/RCTViewComponentView.h>
NS_ASSUME_NONNULL_BEGIN
/**
* UIView class for root <ShimmeringView> component.
*/
@interface RCTActivityIndicatorViewComponentView : RCTViewComponentView
@end
NS_ASSUME_NONNULL_END
| /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <UIKit/UIKit.h>
#import <React/RCTViewComponentView.h>
NS_ASSUME_NONNULL_BEGIN
/**
* UIView class for root <ActivityIndicator> component.
*/
@interface RCTActivityIndicatorViewComponentView : RCTViewComponentView
@end
NS_ASSUME_NONNULL_END
| Fix incorrect information in comment | Fix incorrect information in comment
Summary: `RCTActivityIndicatorViewComponentView` is a component for `ActivityIndicator` not for `ShimmeringView`.
Reviewed By: cpojer
Differential Revision: D16360505
fbshipit-source-id: d6f7685eea24060c9e1b43d5782a65396d6c375e
| C | bsd-3-clause | exponentjs/react-native,javache/react-native,arthuralee/react-native,janicduplessis/react-native,janicduplessis/react-native,hoangpham95/react-native,javache/react-native,facebook/react-native,hammerandchisel/react-native,janicduplessis/react-native,facebook/react-native,myntra/react-native,exponent/react-native,facebook/react-native,hammerandchisel/react-native,facebook/react-native,janicduplessis/react-native,exponentjs/react-native,exponent/react-native,pandiaraj44/react-native,exponent/react-native,exponent/react-native,exponentjs/react-native,hoangpham95/react-native,exponentjs/react-native,janicduplessis/react-native,pandiaraj44/react-native,exponentjs/react-native,javache/react-native,myntra/react-native,exponent/react-native,hammerandchisel/react-native,hoangpham95/react-native,hammerandchisel/react-native,javache/react-native,hammerandchisel/react-native,hammerandchisel/react-native,exponentjs/react-native,hammerandchisel/react-native,myntra/react-native,pandiaraj44/react-native,hoangpham95/react-native,myntra/react-native,exponent/react-native,arthuralee/react-native,arthuralee/react-native,myntra/react-native,javache/react-native,pandiaraj44/react-native,myntra/react-native,hammerandchisel/react-native,hoangpham95/react-native,javache/react-native,exponentjs/react-native,janicduplessis/react-native,javache/react-native,javache/react-native,hoangpham95/react-native,myntra/react-native,facebook/react-native,facebook/react-native,exponent/react-native,myntra/react-native,javache/react-native,arthuralee/react-native,myntra/react-native,hoangpham95/react-native,hoangpham95/react-native,facebook/react-native,pandiaraj44/react-native,facebook/react-native,arthuralee/react-native,exponent/react-native,facebook/react-native,pandiaraj44/react-native,janicduplessis/react-native,exponentjs/react-native,pandiaraj44/react-native,janicduplessis/react-native,pandiaraj44/react-native |
5bb717efd8b6fab5fa7bc324dce6b0a8e4261f86 | cc1/tests/test006.c | cc1/tests/test006.c | /*
name: TEST006
description: Basic test for if
output:
G1 M c
F1
X2 F1 main
G2 F1 main {
-
j L2 #I0 #I0 =I
yI #I1
j L3
L2
j L4 #I0 #I0 =I
j L5
L4
j L6 #I1 #I0 =I
j L7 G1 MI #I0 =I
yI #I1
j L8
L7
yI #I0
L8
j L9
L6
yI #I1
L9
L5
L3
yI #I1
}
*/
char c;
int
main()
{
if(0) {
return 1;
} else if(0) {
/* empty */
} else {
if(1) {
if(c)
return 1;
else
return 0;
} else {
return 1;
}
}
return 1;
}
| Add test of IF statement | Add test of IF statement
| C | isc | k0gaMSX/scc,k0gaMSX/kcc,8l/scc,8l/scc,k0gaMSX/scc,8l/scc,k0gaMSX/kcc,k0gaMSX/scc |
|
03a057fa63e6f59cab6180bdf530558516c9da8d | runtime/test/tasking/nested_task_creation.c | runtime/test/tasking/nested_task_creation.c | // RUN: %libomp-compile-and-run
#include <stdio.h>
#include <omp.h>
#include "omp_my_sleep.h"
/*
* This test creates tasks that themselves create a new task.
* The runtime has to take care that they are correctly freed.
*/
int main()
{
#pragma omp task
{
#pragma omp task
{
my_sleep( 0.1 );
}
}
#pragma omp parallel num_threads(2)
{
#pragma omp single
#pragma omp task
{
#pragma omp task
{
my_sleep( 0.1 );
}
}
}
printf("pass\n");
return 0;
}
| Add test case for nested creation of tasks | Add test case for nested creation of tasks
For discussion in D23115
git-svn-id: f99161ee8ccfe2101cbe1bdda2220bce2ed25485@277730 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/openmp,llvm-mirror/openmp,llvm-mirror/openmp,llvm-mirror/openmp,llvm-mirror/openmp |
|
817f72d680828bb848099adf69fd35c14ff2e182 | arch/m68k/include/asm/virtconvert.h | arch/m68k/include/asm/virtconvert.h | #ifndef __VIRT_CONVERT__
#define __VIRT_CONVERT__
/*
* Macros used for converting between virtual and physical mappings.
*/
#ifdef __KERNEL__
#include <linux/compiler.h>
#include <linux/mmzone.h>
#include <asm/setup.h>
#include <asm/page.h>
/*
* Change virtual addresses to physical addresses and vv.
*/
static inline unsigned long virt_to_phys(void *address)
{
return __pa(address);
}
static inline void *phys_to_virt(unsigned long address)
{
return __va(address);
}
/* Permanent address of a page. */
#ifdef CONFIG_MMU
#ifdef CONFIG_SINGLE_MEMORY_CHUNK
#define page_to_phys(page) \
__pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT))
#else
#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
#endif
#else
#define page_to_phys(page) (((page) - mem_map) << PAGE_SHIFT)
#endif
/*
* IO bus memory addresses are 1:1 with the physical address,
*/
#define virt_to_bus virt_to_phys
#define bus_to_virt phys_to_virt
#endif
#endif
| #ifndef __VIRT_CONVERT__
#define __VIRT_CONVERT__
/*
* Macros used for converting between virtual and physical mappings.
*/
#ifdef __KERNEL__
#include <linux/compiler.h>
#include <linux/mmzone.h>
#include <asm/setup.h>
#include <asm/page.h>
/*
* Change virtual addresses to physical addresses and vv.
*/
static inline unsigned long virt_to_phys(void *address)
{
return __pa(address);
}
static inline void *phys_to_virt(unsigned long address)
{
return __va(address);
}
/* Permanent address of a page. */
#if defined(CONFIG_MMU) && defined(CONFIG_SINGLE_MEMORY_CHUNK)
#define page_to_phys(page) \
__pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT))
#else
#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
#endif
/*
* IO bus memory addresses are 1:1 with the physical address,
*/
#define virt_to_bus virt_to_phys
#define bus_to_virt phys_to_virt
#endif
#endif
| Correct page_to_phys when PAGE_OFFSET is non-zero. | m68knommu: Correct page_to_phys when PAGE_OFFSET is non-zero.
The definition of page_to_phys for nommu produces an incorrect value when
PAGE_OFFSET is non-zero. The nommu version of page_to_pfn works correctly
for non-zero PAGE_OFFSET, so use that instead.
Signed-off-by: Steven King <[email protected]>
Signed-off-by: Greg Ungerer <[email protected]>
| C | mit | KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs |
ff7f701a95cc88bd107de6b9082e398106482111 | include/Support/DataTypes.h | include/Support/DataTypes.h | //===-- include/Support/DataTypes.h - Define fixed size types ----*- C++ -*--=//
//
// This file contains definitions to figure out the size of _HOST_ data types.
// This file is important because different host OS's define different macros,
// which makes portability tough. This file exports the following definitions:
//
// LITTLE_ENDIAN: is #define'd if the host is little endian
// int64_t : is a typedef for the signed 64 bit system type
// uint64_t : is a typedef for the unsigned 64 bit system type
//
// No library is required when using these functinons.
//
//===----------------------------------------------------------------------===//
// TODO: This file sucks. Not only does it not work, but this stuff should be
// autoconfiscated anyways. Major FIXME
#ifndef LLVM_SUPPORT_DATATYPES_H
#define LLVM_SUPPORT_DATATYPES_H
#include <inttypes.h>
#ifdef LINUX
#define __STDC_LIMIT_MACROS 1
#include <stdint.h> // Defined by ISO C 99
#include <endian.h>
#else
#include <sys/types.h>
#ifdef _LITTLE_ENDIAN
#define LITTLE_ENDIAN 1
#endif
#endif
#endif
| //===-- include/Support/DataTypes.h - Define fixed size types ----*- C++ -*--=//
//
// This file contains definitions to figure out the size of _HOST_ data types.
// This file is important because different host OS's define different macros,
// which makes portability tough. This file exports the following definitions:
//
// LITTLE_ENDIAN: is #define'd if the host is little endian
// int64_t : is a typedef for the signed 64 bit system type
// uint64_t : is a typedef for the unsigned 64 bit system type
//
// No library is required when using these functinons.
//
//===----------------------------------------------------------------------===//
// TODO: This file sucks. Not only does it not work, but this stuff should be
// autoconfiscated anyways. Major FIXME
#ifndef LLVM_SUPPORT_DATATYPES_H
#define LLVM_SUPPORT_DATATYPES_H
#include <inttypes.h>
#ifdef __linux__
#define __STDC_LIMIT_MACROS 1
#include <stdint.h> // Defined by ISO C 99
#include <endian.h>
#else
#include <sys/types.h>
#ifdef _LITTLE_ENDIAN
#define LITTLE_ENDIAN 1
#endif
#endif
#endif
| Add better linux support by using the right macro. This still should be autoconfiscated, but for now this is sufficient. | Add better linux support by using the right macro. This still should be
autoconfiscated, but for now this is sufficient.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@3701 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,chubbymaggie/asap,chubbymaggie/asap,dslab-epfl/asap,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm |
b5ba1b31c793185d6e0ee62c1928c84bcff9818e | include/asm-sparc64/setup.h | include/asm-sparc64/setup.h | /*
* Just a place holder.
*/
#ifndef _SPARC64_SETUP_H
#define _SPARC64_SETUP_H
#define COMMAND_LINE_SIZE 256
#endif /* _SPARC64_SETUP_H */
| /*
* Just a place holder.
*/
#ifndef _SPARC64_SETUP_H
#define _SPARC64_SETUP_H
#define COMMAND_LINE_SIZE 2048
#endif /* _SPARC64_SETUP_H */
| Increase command line size to 2048 like other arches. | [SPARC64]: Increase command line size to 2048 like other arches.
Signed-off-by: David S. Miller <[email protected]>
| C | mit | KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas |
ccf1eb48c779fc3ebeda4fdd90eef1132f8a9734 | include/ygo/data/CardData.h | include/ygo/data/CardData.h | #ifndef YGO_DATA_CARDDATA_H
#define YGO_DATA_CARDDATA_H
#include <string>
#include "CardType.h"
namespace ygo
{
namespace data
{
struct StaticCardData
{
std::string name;
CardType cardType;
// monster only
Attribute attribute;
MonsterType monsterType;
Type type;
MonsterType monsterAbility;
int level;
int attack;
int defense;
int lpendulum;
int rpendulum;
// spell and trap only
SpellType spellType;
TrapType trapType;
std::string text;
};
}
}
#endif
| #ifndef YGO_DATA_CARDDATA_H
#define YGO_DATA_CARDDATA_H
#include <string>
#include "CardType.h"
namespace ygo
{
namespace data
{
struct StaticCardData
{
std::string name;
CardType cardType;
// monster only
Attribute attribute;
MonsterType monsterType;
Type type;
MonsterType monsterAbility;
int level;
int attack;
int defense;
int lpendulum;
int rpendulum;
// spell and trap only
SpellType spellType;
TrapType trapType;
// card text
std::string text;
};
}
}
#endif
| Clarify data in static card data | Clarify data in static card data
| C | mit | DeonPoncini/ygodata |
0676fd9376ac95da74f5091fd21ac93769b2275f | arch/amiga/isa/isa_machdep.c | arch/amiga/isa/isa_machdep.c | /* $OpenBSD: isa_machdep.c,v 1.4 1999/03/05 19:17:44 niklas Exp $ */
/*
* Copyright (c) 1999 Niklas Hallqvist
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Niklas Hallqvist.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <machine/intr.h>
#include <dev/isa/isareg.h>
#include <dev/isa/isavar.h>
/*
* Just check to see if an IRQ is available/can be shared.
* 0 = interrupt not available
* 1 = interrupt shareable
* 2 = interrupt all to ourself
*/
int
__isa_intr_check(irq, type, intrtype)
int irq;
int type;
int *intrtype;
{
if (type == IST_NONE)
return (0);
switch (intrtype[irq]) {
case IST_NONE:
return (2);
break;
case IST_LEVEL:
if (type != intrtype[irq])
return (0);
return (1);
break;
case IST_EDGE:
case IST_PULSE:
if (type != IST_NONE)
return (0);
}
return (1);
}
| Add forgotten file, espie@ has checked it compiles | Add forgotten file, espie@ has checked it compiles
| C | isc | orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars |
|
1d76413d676c592f8d0bd1eb288f0e69fff61f7e | pq-crypto/pq-random.c | pq-crypto/pq-random.c | /*
* Copyright 2019 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 <sys/param.h>
#include "pq-crypto/pq-random.h"
#include "utils/s2n_mem.h"
static int (*random_data_generator)(struct s2n_blob *) = &s2n_get_private_random_data;
int initialize_pq_crypto_generator(int (*generator_ptr)(struct s2n_blob *))
{
if (generator_ptr == NULL) {
return -1;
}
random_data_generator = generator_ptr;
return 0;
}
int get_random_bytes(OUT unsigned char *buffer, unsigned int num_bytes)
{
struct s2n_blob out = {.data = buffer,.size = num_bytes };
return random_data_generator(&out);
}
| /*
* Copyright 2019 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 <stdlib.h>
#include <sys/param.h>
#include "pq-crypto/pq-random.h"
#include "utils/s2n_mem.h"
static int (*random_data_generator)(struct s2n_blob *) = &s2n_get_private_random_data;
int initialize_pq_crypto_generator(int (*generator_ptr)(struct s2n_blob *))
{
if (generator_ptr == NULL) {
return -1;
}
random_data_generator = generator_ptr;
return 0;
}
int get_random_bytes(OUT unsigned char *buffer, unsigned int num_bytes)
{
struct s2n_blob out = {.data = buffer,.size = num_bytes };
return random_data_generator(&out);
}
| Enable compiling with older versions of GCC | Enable compiling with older versions of GCC
| C | apache-2.0 | awslabs/s2n,colmmacc/s2n,wcs1only/s2n,colmmacc/s2n,PKRoma/s2n,gibson-compsci/s2n,wcs1only/s2n,awslabs/s2n,alexeblee/s2n,raycoll/s2n,PKRoma/s2n,wcs1only/s2n,gibson-compsci/s2n,raycoll/s2n,colmmacc/s2n,gibson-compsci/s2n,raycoll/s2n,awslabs/s2n,PKRoma/s2n,wcs1only/s2n,colmmacc/s2n,PKRoma/s2n,awslabs/s2n,raycoll/s2n,alexeblee/s2n,alexeblee/s2n,alexeblee/s2n,wcs1only/s2n,raycoll/s2n,awslabs/s2n,alexeblee/s2n,PKRoma/s2n,PKRoma/s2n,wcs1only/s2n,colmmacc/s2n,colmmacc/s2n,alexeblee/s2n,raycoll/s2n,wcs1only/s2n,gibson-compsci/s2n,awslabs/s2n,gibson-compsci/s2n,gibson-compsci/s2n,wcs1only/s2n,PKRoma/s2n,PKRoma/s2n |
c3bc56209f8df216b4cfc6db86b36b1429fac35b | git_test.c | git_test.c | #include <git2.h>
#include <stdio.h>
int main(int argc, char const *argv[])
{
git_libgit2_init();
const char *GIT_REPO_PATH = ".";
git_repository *repo = NULL;
git_repository_open(&repo, GIT_REPO_PATH);
git_revwalk *walker = NULL;
git_revwalk_new(&walker, repo);
git_revwalk_sorting(walker, GIT_SORT_NONE);
git_revwalk_push_head(walker);
git_oid oid;
while (!git_revwalk_next(&oid, walker))
{
git_commit *commit = NULL;
git_commit_lookup(&commit, repo, &oid);
printf("%s %s\n", git_oid_tostr_s(&oid), git_commit_summary(commit));
git_commit_free(commit);
}
git_revwalk_free(walker);
git_repository_free(repo);
git_libgit2_shutdown();
return 0;
}
| Add libgit2 example to print all commit history inside current directory. | Add libgit2 example to print all commit history inside current
directory.
Compile with:
gcc git_test.c -o git_test -lgit2
| C | apache-2.0 | tisma/ctorious,tisma/ctorious |
|
de0afa4fa188b5659acf2859848e644e0864cdc5 | hal1.h | hal1.h | #ifndef HAL1_H
#define HAL1_H
// Configurable constants
extern int const MAIN_MOTOR_PWM_TOP;
extern int const MAIN_MOTOR_BRAKE_SPEED;
extern int const MAIN_MOTOR_MIN_SPEED;
extern int const MAIN_MOTOR_MED_SPEED;
extern int const MAIN_MOTOR_MAX_SPEED;
extern int const MAGNET_OPEN_WAIT;
void init(void);
void main_motor_stop();
void main_motor_cw_open(uint8_t speed);
void main_motor_ccw_close(uint8_t speed);
void aux_motor_stop();
void aux_motor_cw_close();
void aux_motor_ccw_open();
void magnet_off();
void magnet_on();
bool door_nearly_open();
bool door_fully_open();
bool door_fully_closed();
bool sensor_proximity();
bool button_openclose();
bool button_stop();
bool main_encoder();
bool aux_outdoor_limit();
bool aux_indoor_limit();
bool door_nearly_closed();
bool aux_encoder();
// Private functions
static void set_main_motor_speed(int speed);
#endif
| #ifndef HAL1_H
#define HAL1_H
// Configurable constants
extern int const MAIN_MOTOR_PWM_TOP;
extern int const MAIN_MOTOR_BRAKE_SPEED;
extern int const MAIN_MOTOR_MIN_SPEED;
extern int const MAIN_MOTOR_MED_SPEED;
extern int const MAIN_MOTOR_MAX_SPEED;
extern int const MAGNET_OPEN_WAIT;
void init(void);
void main_motor_stop();
void main_motor_cw_open(uint8_t speed);
void main_motor_ccw_close(uint8_t speed);
void aux_motor_stop();
void aux_motor_cw_close(uint8_t speed);
void aux_motor_ccw_open(uint8_t speed);
void magnet_off();
void magnet_on();
bool door_nearly_open();
bool door_fully_open();
bool door_fully_closed();
bool sensor_proximity();
bool button_openclose();
bool button_stop();
bool main_encoder();
bool aux_outdoor_limit();
bool aux_indoor_limit();
bool door_nearly_closed();
bool aux_encoder();
// Private functions
static void set_main_motor_speed(int speed);
#endif
| Add speed to aux motor functions. | Add speed to aux motor functions.
| C | unlicense | plzz/ovisysteemi,plzz/ovisysteemi |
ebf93089a14d4ee802a317a78225361f6c61fe14 | base_sheet.h | base_sheet.h | #include "helper.h"
#include <string> // string
#include <stdlib.h> // srand, rand
#include <time.h> // time - for rand seed
#include <algorithm> // sort
using namespace std;
class BaseSheet
{
protected:
int _level;
int _str;
int _dex;
int _con;
int _int;
int _wis;
int _cha;
int _speed ;
// All of these others have enums and a string
// The string is to print out - maybe not the best way
Size _size;
string _size_text;
Alignment_0 _alignment_0;
Alignment_1 _alignment_1;
string _alignment_text;
Race _race;
string _race_text;
DndClass _class;
string _class_text;
void set_class(DndClass myClass);
public:
BaseSheet(DndClass myClass);
void print_stats();
void level_up();
virtual void check_for_abilities();
void roll_stats(int[]);
virtual void assign_stats(int[]);
};
| #include "helper.h"
#include <string> // string
#include <stdlib.h> // srand, rand
#include <time.h> // time - for rand seed
#include <algorithm> // sort
#include <functional> // std::greater for mac osx
using namespace std;
class BaseSheet
{
protected:
int _level;
int _str;
int _dex;
int _con;
int _int;
int _wis;
int _cha;
int _speed ;
// All of these others have enums and a string
// The string is to print out - maybe not the best way
Size _size;
string _size_text;
Alignment_0 _alignment_0;
Alignment_1 _alignment_1;
string _alignment_text;
Race _race;
string _race_text;
DndClass _class;
string _class_text;
void set_class(DndClass myClass);
public:
BaseSheet(DndClass myClass);
void print_stats();
void level_up();
virtual void check_for_abilities();
void roll_stats(int[]);
virtual void assign_stats(int[]);
};
| Add include <functional> for osx | Add include <functional> for osx
| C | mit | golddiamonds/character |
245dbbfe13b1a31e5955106d58687c3b384dca66 | dev/ic/i8237reg.h | dev/ic/i8237reg.h | /* $OpenBSD: i8237reg.h,v 1.2 1996/04/18 23:47:19 niklas Exp $ */
/* $NetBSD: i8237reg.h,v 1.5 1996/03/01 22:27:09 mycroft Exp $ */
/*
* Intel 8237 DMA Controller
*/
#define DMA37MD_WRITE 0x04 /* read the device, write memory operation */
#define DMA37MD_READ 0x08 /* write the device, read memory operation */
#define DMA37MD_LOOP 0x10 /* auto-initialize mode */
#define DMA37MD_SINGLE 0x40 /* single pass mode */
#define DMA37MD_CASCADE 0xc0 /* cascade mode */
#define DMA37SM_CLEAR 0x00 /* clear mask bit */
#define DMA37SM_SET 0x04 /* set mask bit */
| /* $OpenBSD: i8237reg.h,v 1.3 1999/08/04 23:07:49 niklas Exp $ */
/* $NetBSD: i8237reg.h,v 1.5 1996/03/01 22:27:09 mycroft Exp $ */
/*
* Intel 8237 DMA Controller
*/
#define DMA37MD_DEMAND 0x00 /* demand mode */
#define DMA37MD_WRITE 0x04 /* read the device, write memory operation */
#define DMA37MD_READ 0x08 /* write the device, read memory operation */
#define DMA37MD_LOOP 0x10 /* auto-initialize mode */
#define DMA37MD_SINGLE 0x40 /* single pass mode */
#define DMA37MD_CASCADE 0xc0 /* cascade mode */
#define DMA37SM_CLEAR 0x00 /* clear mask bit */
#define DMA37SM_SET 0x04 /* set mask bit */
| Add new manifest constant for demand mode DMA; form NetBSD | Add new manifest constant for demand mode DMA; form NetBSD
| C | isc | orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars |
734e841eb3c657ecd5de0884b2aac2929d1bf28c | src/bin/e_randr.h | src/bin/e_randr.h | #ifdef E_TYPEDEFS
typedef struct _E_Randr_Output_Config E_Randr_Output_Config;
typedef struct _E_Randr_Crtc_Config E_Randr_Crtc_Config;
typedef struct _E_Randr_Config E_Randr_Config;
#else
# ifndef E_RANDR_H
# define E_RANDR_H
#define E_RANDR_CONFIG_FILE_EPOCH 1
#define E_RANDR_CONFIG_FILE_GENERATION 1
#define E_RANDR_CONFIG_FILE_VERSION \
((E_RANDR_CONFIG_FILE_EPOCH * 1000000) + E_RANDR_CONFIG_FILE_GENERATION)
struct _E_Randr_Output_Config
{
unsigned int xid; // ecore_x_randr output id (xid)
unsigned int crtc; // ecore_x_randr crtc id (xid)
unsigned int policy; // value of the ecore_x_randr_output_policy
unsigned char primary; // flag to indicate if primary output
unsigned long edid_count; // monitor's edid length
unsigned char *edid; // monitor's edid
double timestamp; // config timestamp
};
struct _E_Randr_Crtc_Config
{
unsigned int xid; // ecore_x_randr crtc id (xid)
int x, y, width, height; // geometry
unsigned int orient; // value of the ecore_x_randr_orientation
unsigned int mode; // ecore_x_randr mode id (xid)
Eina_List *outputs; // list of outputs for this crtc
double timestamp; // config timestamp
};
struct _E_Randr_Config
{
/* RANDR CONFIG
*
* Screen:
* width, height (int);
*
* list of crtcs
* each crtc having:
* unsigned int crtc_id (Ecore_X_ID);
* int x, y, w, h; (Eina_Rectangle);
* unsigned int orientation (Ecore_X_Randr_Orienation);
* unsigned int mode_id (Ecore_X_ID);
* list of outputs
* each output having:
* unsigned int output_id (Ecore_X_ID);
* unsigned int crtc_id (Ecore_X_ID);
* unsigned int output_policy;
*/
int version; // INTERNAL CONFIG VERSION
struct
{
int width, height; // geometry
double timestamp; // config timestamp
} screen;
Eina_List *crtcs;
};
EINTERN Eina_Bool e_randr_init(void);
EINTERN int e_randr_shutdown(void);
EAPI Eina_Bool e_randr_config_save(void);
extern EAPI E_Randr_Config *e_randr_cfg;
# endif
#endif
| Add new randr header file. | Add new randr header file.
Signed-off-by: Christopher Michael <[email protected]>
SVN revision: 84109
| C | bsd-2-clause | rvandegrift/e,tasn/enlightenment,FlorentRevest/Enlightenment,FlorentRevest/Enlightenment,rvandegrift/e,tasn/enlightenment,rvandegrift/e,tizenorg/platform.upstream.enlightenment,FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment,tasn/enlightenment,tizenorg/platform.upstream.enlightenment |
|
1ca47e1e88457d9bd9998e2cc2aae19495d4668b | examples/rmc-test.c | examples/rmc-test.c | #include "rmc.h"
// Some test cases that required some bogosity to not have the branches get
// optimized away.
//
// Also, if r doesn't get used usefully, that load gets optimized away.
// I can't decide whether that is totally fucked or not.
int global_p, global_q;
int bogus_ctrl_dep1() {
XEDGE(read, write);
L(read, int r = global_p);
if (r == r) {
L(write, global_q = 1);
}
return r;
}
// Do basically the same thing in each branch
int bogus_ctrl_dep2() {
XEDGE(read, write);
L(read, int r = global_p);
if (r) {
L(write, global_q = 1);
} else {
L(write, global_q = 1);
}
return r;
}
// Have a bogus ctrl dep
int bogus_ctrl_dep3() {
XEDGE(read, write);
L(read, int r = global_p);
if (r) {};
L(write, global_q = 1);
return r;
}
| #include "rmc.h"
// Some test cases that required some bogosity to not have the branches get
// optimized away.
//
// Also, if r doesn't get used usefully, that load gets optimized away.
// I can't decide whether that is totally fucked or not.
int global_p, global_q;
int bogus_ctrl_dep1() {
XEDGE(read, write);
L(read, int r = global_p);
if (r == r) {
L(write, global_q = 1);
}
return r;
}
// Do basically the same thing in each branch
int bogus_ctrl_dep2() {
XEDGE(read, write);
L(read, int r = global_p);
if (r) {
L(write, global_q = 1);
} else {
L(write, global_q = 1);
}
return r;
}
// Have a totally ignored ctrl dep
int bogus_ctrl_dep3() {
XEDGE(read, write);
L(read, int r = global_p);
if (r) {};
L(write, global_q = 1);
return r;
}
// Have a ctrl dep that is redundant
int bogus_ctrl_dep4() {
XEDGE(read, write);
L(read, int r = global_p);
if (r || 1) {
L(write, global_q = 1);
}
return r;
}
| Add another ctrl dep test that we get right! | Add another ctrl dep test that we get right!
| C | mit | msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler |
f8203a77c906cc8e5991d46a3387b2273223a7b5 | exercise109.c | exercise109.c | /* Exercise 1-8: Write a program to copy its input to its output, replacing
* each string of one of more blanks with a single blank. */
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int16_t character, previous_character;
while ((character = getchar()) != EOF) {
if ((previous_character == ' ') && (character == ' ')) {
continue;
} else {
putchar(character);
previous_character = character;
}
}
return EXIT_SUCCESS;
}
| Add solution to Exercise 1-9. | Add solution to Exercise 1-9.
| C | unlicense | damiendart/knr-solutions,damiendart/knr-solutions,damiendart/knr-solutions |
|
50dd6a56970747d566d2ce3eee4305e2e530a16d | src/bin/e_error.c | src/bin/e_error.c | #include "e.h"
/* local subsystem functions */
/* local subsystem globals */
/* externally accessible functions */
EAPI void
e_error_message_show_internal(char *txt)
{
/* FIXME: maybe log these to a file and display them at some point */
printf("<<<< Enlightenment Error >>>>\n"
"%s\n",
txt);
}
/* local subsystem functions */
| #include "e.h"
/* local subsystem functions */
/* local subsystem globals */
/* externally accessible functions */
EAPI void
e_error_message_show_internal(char *txt)
{
/* FIXME: maybe log these to a file and display them at some point */
printf("<<<< Enlightenment Error >>>>\n%s\n", txt);
}
/* local subsystem functions */
| Fix formatting. (Really ??? 3 lines for something that can fit on one ?) | E: Fix formatting. (Really ??? 3 lines for something that can fit on
one ?)
SVN revision: 61614
| C | bsd-2-clause | tizenorg/platform.upstream.enlightenment,FlorentRevest/Enlightenment,tasn/enlightenment,rvandegrift/e,FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment,tasn/enlightenment,rvandegrift/e,tizenorg/platform.upstream.enlightenment,rvandegrift/e,tasn/enlightenment,FlorentRevest/Enlightenment |
b54503d351bf638969a5dd9e7113f8bc419ee24f | tmcd/decls.h | tmcd/decls.h | /*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2002 University of Utah and the Flux Group.
* All rights reserved.
*/
#define TBSERVER_PORT 7777
#define TBSERVER_PORT2 14443
#define MYBUFSIZE 2048
#define BOSSNODE_FILENAME "bossnode"
/*
* As the tmcd changes, incompatable changes with older version of
* the software cause problems. Starting with version 3, the client
* will tell tmcd what version they are. If no version is included,
* assume its DEFAULT_VERSION.
*
* Be sure to update the versions as the TMCD changes. Both the
* tmcc and tmcd have CURRENT_VERSION compiled in, so be sure to
* install new versions of each binary when the current version
* changes. libsetup.pm module also encodes a current version, so be
* sure to change it there too!
*
* Note, this is assumed to be an integer. No need for 3.23.479 ...
* NB: See ron/libsetup.pm. That is version 4! I'll merge that in.
*/
#define DEFAULT_VERSION 2
#define CURRENT_VERSION 6
| /*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2002 University of Utah and the Flux Group.
* All rights reserved.
*/
#define TBSERVER_PORT 7777
#define TBSERVER_PORT2 14447
#define MYBUFSIZE 2048
#define BOSSNODE_FILENAME "bossnode"
/*
* As the tmcd changes, incompatable changes with older version of
* the software cause problems. Starting with version 3, the client
* will tell tmcd what version they are. If no version is included,
* assume its DEFAULT_VERSION.
*
* Be sure to update the versions as the TMCD changes. Both the
* tmcc and tmcd have CURRENT_VERSION compiled in, so be sure to
* install new versions of each binary when the current version
* changes. libsetup.pm module also encodes a current version, so be
* sure to change it there too!
*
* Note, this is assumed to be an integer. No need for 3.23.479 ...
* NB: See ron/libsetup.pm. That is version 4! I'll merge that in.
*/
#define DEFAULT_VERSION 2
#define CURRENT_VERSION 6
| Change alternate port number; seemed to be taken already! | Change alternate port number; seemed to be taken already!
| C | agpl-3.0 | nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome |
de7f24245a2b51af5ff3489d897ed490d8a0e776 | BRScroller/BRScrollerUtilities.h | BRScroller/BRScrollerUtilities.h | //
// BRScrollerUtilities.h
// BRScroller
//
// Created by Matt on 7/11/13.
// Copyright (c) 2013 Blue Rocket. Distributable under the terms of the Apache License, Version 2.0.
//
#ifndef BRScroller_BRScrollerUtilities_h
#define BRScroller_BRScrollerUtilities_h
#include <CoreFoundation/CoreFoundation.h>
#include <QuartzCore/QuartzCore.h>
bool BRFloatsAreEqual(CGFloat a, CGFloat b);
CGSize BRAspectSizeToFit(CGSize size, CGSize maxSize);
#endif
| //
// BRScrollerUtilities.h
// BRScroller
//
// Created by Matt on 7/11/13.
// Copyright (c) 2013 Blue Rocket. Distributable under the terms of the Apache License, Version 2.0.
//
#ifndef BRScroller_BRScrollerUtilities_h
#define BRScroller_BRScrollerUtilities_h
#include <CoreGraphics/CoreGraphics.h>
bool BRFloatsAreEqual(CGFloat a, CGFloat b);
CGSize BRAspectSizeToFit(CGSize size, CGSize maxSize);
#endif
| Fix import to what's actually needed. | Fix import to what's actually needed.
| C | apache-2.0 | Blue-Rocket/BRScroller,Blue-Rocket/BRScroller |
4c22fc7c302ac0e6a26c7113bef5c6d23cc1625a | test/studies/filerator/direnthelp.h | test/studies/filerator/direnthelp.h | #include "dirent.h"
typedef DIR* DIRptr;
typedef struct dirent* direntptr;
#define chpl_rt_direntptr_getname(x) ((x)->d_name)
//
// Note: This is not portable; more generally, need to use lstat() or similar;
// see the readdir() man page for notes
//
#define chpl_rt_direntptr_isDir(x) ((x)->d_type == DT_DIR)
| #include "dirent.h"
typedef DIR* DIRptr;
#ifndef __USE_FILE_OFFSET64
typedef struct dirent* direntptr;
#else
#ifdef __REDIRECT
typedef struct dirent* direntptr;
#else
typedef struct dirent64* direntptr;
#endif
#endif
#define chpl_rt_direntptr_getname(x) ((x)->d_name)
//
// Note: This is not portable; more generally, need to use lstat() or similar;
// see the readdir() man page for notes
//
#define chpl_rt_direntptr_isDir(x) ((x)->d_type == DT_DIR)
| Make the filerator test more portable | Make the filerator test more portable
For some reason that I haven't been able to determine, the return type of
readdir() is sometimes dirent64* rather than dirent* as all the man pages and
documentation that I can find suggest. This happens with prgenv-pgi and
prgenv-cray compilers for example. Here, I'm guarding our typedef of
'direntptr' for Chapel's use with a similar #ifndef structure as the
/usr/lib/dirent.h file to make this test work on our current systems. This is
likely be something that we need to understand and resolve better before
putting a filerator into our standard libraries, though... :(
git-svn-id: 88467cb1fb04b8a755be7e1ee1026be4190196ef@23824 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
| C | apache-2.0 | CoryMcCartan/chapel,CoryMcCartan/chapel,hildeth/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,hildeth/chapel,sungeunchoi/chapel,hildeth/chapel,chizarlicious/chapel,sungeunchoi/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,chizarlicious/chapel,chizarlicious/chapel,sungeunchoi/chapel,chizarlicious/chapel,CoryMcCartan/chapel,chizarlicious/chapel,hildeth/chapel,hildeth/chapel,hildeth/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,chizarlicious/chapel,CoryMcCartan/chapel,hildeth/chapel,chizarlicious/chapel,sungeunchoi/chapel,sungeunchoi/chapel |
d60caada8b9cad01a953981954856f26805674ec | include/llvm/TableGen/TableGenBackend.h | include/llvm/TableGen/TableGenBackend.h | //===- llvm/TableGen/TableGenBackend.h - Backend utilities ------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Useful utilities for TableGen backends.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TABLEGEN_TABLEGENBACKEND_H
#define LLVM_TABLEGEN_TABLEGENBACKEND_H
#include "llvm/ADT/StringRef.h"
namespace llvm {
class raw_ostream;
/// emitSourceFileHeader - Output an LLVM style file header to the specified
/// raw_ostream.
void emitSourceFileHeader(StringRef Desc, raw_ostream &OS);
} // End llvm namespace
#endif
| //===- llvm/TableGen/TableGenBackend.h - Backend utilities ------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Useful utilities for TableGen backends.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TABLEGEN_TABLEGENBACKEND_H
#define LLVM_TABLEGEN_TABLEGENBACKEND_H
namespace llvm {
class StringRef;
class raw_ostream;
/// emitSourceFileHeader - Output an LLVM style file header to the specified
/// raw_ostream.
void emitSourceFileHeader(StringRef Desc, raw_ostream &OS);
} // End llvm namespace
#endif
| Remove unnecessary include and just forward declare. NFC | [TableGen] Remove unnecessary include and just forward declare. NFC
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@238179 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap |
7513987860278927682945fc5f2d06c79bcac2ed | include/tma.h | include/tma.h | /* Copyright (c) 2011, Jon Maken
* License: 3-clause BSD
* Revision: 11/26/2011 7:57:44 PM
*/
#if defined(_WIN32)
# define TMA_CAPI(type) extern "C" __declspec(dllexport) type
#else
# define TMA_CAPI(type) extern "C" type
#endif
| Add custom code timing DLLs header | Add custom code timing DLLs header
| C | bsd-3-clause | jonforums/tma,jonforums/tma,jonforums/tma |
|
351c01d249e0b93f4d2805f5b93d6cb52fae8894 | UIKitExtensions/UIView/Framing.h | UIKitExtensions/UIView/Framing.h | // UIKitExtensions
//
// UIKitExtensions/UIView/Framing.h
//
// Copyright (c) 2013 Stanislaw Pankevich
// Released under the MIT license
//
// Inspired by FrameAccessor
// https://github.com/AlexDenisov/FrameAccessor/
#import <UIKit/UIKit.h>
@interface UIView (Framing)
@property CGPoint viewOrigin;
@property CGSize viewSize;
@property CGFloat x;
@property CGFloat y;
@property CGFloat height;
@property CGFloat width;
@property CGFloat centerX;
@property CGFloat centerY;
@end
| // UIKitExtensions
//
// UIKitExtensions/UIView/Framing.h
//
// Copyright (c) 2013 Stanislaw Pankevich
// Released under the MIT license
//
// Inspired by FrameAccessor
// https://github.com/AlexDenisov/FrameAccessor/
#import <UIKit/UIKit.h>
@interface UIView (Framing)
// http://stackoverflow.com/questions/16118106/uitextview-strange-text-clipping
// https://github.com/genericspecific/CKUITools/issues/8
@property CGPoint viewOrigin;
@property CGSize viewSize;
@property CGFloat x;
@property CGFloat y;
@property CGFloat height;
@property CGFloat width;
@property CGFloat centerX;
@property CGFloat centerY;
@end
| Add links to original problem | Add links to original problem
| C | mit | stanislaw/UIKitExtensions,stanislaw/UIKitExtensions,stanislaw/UIKitExtensions,stanislaw/UIKitExtensions |
5422ab894dc9c35d94656d6879879e076fc9d0e0 | hw/vpi/tenyr_vpi.h | hw/vpi/tenyr_vpi.h | #ifndef TENYR_VPI_
#define TENYR_VPI_
#include <vpi_user.h>
struct tenyr_sim_state;
typedef int tenyr_sim_cb(p_cb_data data);
typedef int tenyr_sim_call(struct tenyr_sim_state *state, void *userdata);
struct tenyr_sim_state {
struct {
tenyr_sim_call *genesis; ///< beginning of sim
tenyr_sim_call *posedge; ///< rising edge of clock
tenyr_sim_call *negedge; ///< falling edge of clock
tenyr_sim_call *apocalypse; ///< end of sim
} cb;
struct {
struct {
vpiHandle genesis, apocalypse;
} cb;
struct {
vpiHandle tenyr_load;
vpiHandle tenyr_putchar;
#if 0
// XXX this code is not tenyr-correct -- it can block
vpiHandle tenyr_getchar;
#endif
} tf;
} handle;
void *extstate; ///< external state possibly used by tenyr_sim_cb's
};
#endif
| #ifndef TENYR_VPI_
#define TENYR_VPI_
#include <vpi_user.h>
struct tenyr_sim_state;
typedef int tenyr_sim_cb(p_cb_data data);
typedef int tenyr_sim_call(struct tenyr_sim_state *state, void *userdata);
struct tenyr_sim_state {
struct {
tenyr_sim_call *genesis; ///< beginning of sim
tenyr_sim_call *posedge; ///< rising edge of clock
tenyr_sim_call *negedge; ///< falling edge of clock
tenyr_sim_call *apocalypse; ///< end of sim
} cb;
struct {
struct {
vpiHandle genesis, apocalypse;
} cb;
struct {
vpiHandle tenyr_load;
vpiHandle tenyr_putchar;
#if 0
// XXX this code is not tenyr-correct -- it can block
vpiHandle tenyr_getchar;
#endif
} tf;
} handle;
void *extstate; ///< external state possibly used by tenyr_sim_cb's
};
#endif
| Mend incorrect whitespace from 3103a58 | Mend incorrect whitespace from 3103a58
| C | mit | kulp/tenyr,kulp/tenyr,kulp/tenyr |
7d6b667ae70747e9f111eedb98f66fca20c9f43e | value.h | value.h | #pragma once
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
enum Turbo_Type {TJ_Error, TJ_String, TJ_Number, TJ_Object, TJ_Array, TJ_Boolean, TJ_Null};
struct Turbo_Value{
enum Turbo_Type type;
unsigned length;
union{
double number;
int boolean;
const char *string;
struct Turbo_Value *array;
struct Turbo_Property *object;
struct Turbo_Error *error;
} value;
};
const char *Turbo_Value(struct Turbo_Value * __restrict__ to, const char *in, const char *const end);
void Turbo_WriteValue(struct Turbo_Value *that, FILE *out, int level);
#ifdef __cplusplus
}
#endif
| #pragma once
#include <stdio.h>
#ifdef _MSC_VER
#define __restrict__ __restrict
#elif defined __WATCOMC__
#define __restrict__
#endif
#ifdef __cplusplus
extern "C" {
#endif
enum Turbo_Type {TJ_Error, TJ_String, TJ_Number, TJ_Object, TJ_Array, TJ_Boolean, TJ_Null};
struct Turbo_Value{
enum Turbo_Type type;
unsigned length;
union{
double number;
int boolean;
const char *string;
struct Turbo_Value *array;
struct Turbo_Property *object;
struct Turbo_Error *error;
} value;
};
const char *Turbo_Value(struct Turbo_Value * __restrict__ to, const char *in, const char *const end);
void Turbo_WriteValue(struct Turbo_Value *that, FILE *out, int level);
#ifdef __cplusplus
}
#endif
| Handle restrict on Windows compilers | Handle restrict on Windows compilers
| C | bsd-3-clause | FlyingJester/TurboJSON,FlyingJester/TurboJSON,FlyingJester/TurboJSON |
7e3f73b484dce568b5cee7f4e3209181efdf5cc7 | ppapi/tests/arch_dependent_sizes_64.h | ppapi/tests/arch_dependent_sizes_64.h | /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* This file has compile assertions for the sizes of types that are dependent
* on the architecture for which they are compiled (i.e., 32-bit vs 64-bit).
*/
#ifndef PPAPI_TESTS_ARCH_DEPENDENT_SIZES_64_H_
#define PPAPI_TESTS_ARCH_DEPENDENT_SIZES_64_H_
#include "ppapi/tests/test_struct_sizes.c"
PP_COMPILE_ASSERT_SIZE_IN_BYTES(GLintptr, 8);
PP_COMPILE_ASSERT_SIZE_IN_BYTES(GLsizeiptr, 8);
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_CompletionCallback_Func, 8);
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_URLLoaderTrusted_StatusCallback, 8);
PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_CompletionCallback, 24);
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PPB_VideoDecoder_Dev, 64);
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PPP_VideoDecoder_Dev, 32);
#endif /* PPAPI_TESTS_ARCH_DEPENDENT_SIZES_64_H_ */
| /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* This file has compile assertions for the sizes of types that are dependent
* on the architecture for which they are compiled (i.e., 32-bit vs 64-bit).
*/
#ifndef PPAPI_TESTS_ARCH_DEPENDENT_SIZES_64_H_
#define PPAPI_TESTS_ARCH_DEPENDENT_SIZES_64_H_
#include "ppapi/tests/test_struct_sizes.c"
// TODO(jschuh): Resolve ILP64 to LLP64 issue. crbug.com/177779
#if !defined(_WIN64)
PP_COMPILE_ASSERT_SIZE_IN_BYTES(GLintptr, 8);
PP_COMPILE_ASSERT_SIZE_IN_BYTES(GLsizeiptr, 8);
#endif
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_CompletionCallback_Func, 8);
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_URLLoaderTrusted_StatusCallback, 8);
PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_CompletionCallback, 24);
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PPB_VideoDecoder_Dev, 64);
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PPP_VideoDecoder_Dev, 32);
#endif /* PPAPI_TESTS_ARCH_DEPENDENT_SIZES_64_H_ */
| Disable GL sizes PPAPI tests | Disable GL sizes PPAPI tests
The wrong size is defined for Win64. It needs a real fix, but first I need to unblock the builder.
BUG=177779
Review URL: https://chromiumcodereview.appspot.com/12310080
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@184296 0039d316-1c4b-4281-b951-d872f2087c98
| C | bsd-3-clause | markYoungH/chromium.src,axinging/chromium-crosswalk,Chilledheart/chromium,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,zcbenz/cefode-chromium,Jonekee/chromium.src,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,dednal/chromium.src,Jonekee/chromium.src,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,timopulkkinen/BubbleFish,ondra-novak/chromium.src,Just-D/chromium-1,hujiajie/pa-chromium,jaruba/chromium.src,anirudhSK/chromium,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,ondra-novak/chromium.src,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,Jonekee/chromium.src,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,ltilve/chromium,ChromiumWebApps/chromium,anirudhSK/chromium,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,markYoungH/chromium.src,dednal/chromium.src,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,dushu1203/chromium.src,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,bright-sparks/chromium-spacewalk,pozdnyakov/chromium-crosswalk,patrickm/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,hujiajie/pa-chromium,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Jonekee/chromium.src,Chilledheart/chromium,dednal/chromium.src,bright-sparks/chromium-spacewalk,patrickm/chromium.src,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,M4sse/chromium.src,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,Jonekee/chromium.src,hujiajie/pa-chromium,hujiajie/pa-chromium,dednal/chromium.src,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,ChromiumWebApps/chromium,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,ltilve/chromium,anirudhSK/chromium,jaruba/chromium.src,Jonekee/chromium.src,dednal/chromium.src,anirudhSK/chromium,jaruba/chromium.src,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,hujiajie/pa-chromium,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,Just-D/chromium-1,hujiajie/pa-chromium,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,zcbenz/cefode-chromium,littlstar/chromium.src,anirudhSK/chromium,patrickm/chromium.src,pozdnyakov/chromium-crosswalk,chuan9/chromium-crosswalk,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,dushu1203/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,ltilve/chromium,timopulkkinen/BubbleFish,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk,dednal/chromium.src,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,hgl888/chromium-crosswalk,ondra-novak/chromium.src,littlstar/chromium.src,Chilledheart/chromium,zcbenz/cefode-chromium,mogoweb/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,dednal/chromium.src,zcbenz/cefode-chromium,M4sse/chromium.src,chuan9/chromium-crosswalk,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,ondra-novak/chromium.src,dushu1203/chromium.src,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,jaruba/chromium.src,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,zcbenz/cefode-chromium,pozdnyakov/chromium-crosswalk,axinging/chromium-crosswalk,Chilledheart/chromium,Fireblend/chromium-crosswalk,timopulkkinen/BubbleFish,zcbenz/cefode-chromium,Jonekee/chromium.src,Jonekee/chromium.src,Just-D/chromium-1,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,mogoweb/chromium-crosswalk,M4sse/chromium.src,anirudhSK/chromium,krieger-od/nwjs_chromium.src,Just-D/chromium-1,jaruba/chromium.src,ChromiumWebApps/chromium,dushu1203/chromium.src,patrickm/chromium.src,M4sse/chromium.src,Fireblend/chromium-crosswalk,patrickm/chromium.src,dushu1203/chromium.src,jaruba/chromium.src,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,ondra-novak/chromium.src,M4sse/chromium.src,markYoungH/chromium.src,zcbenz/cefode-chromium,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,M4sse/chromium.src,M4sse/chromium.src,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,littlstar/chromium.src,ondra-novak/chromium.src,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,anirudhSK/chromium,mogoweb/chromium-crosswalk,jaruba/chromium.src,anirudhSK/chromium,dednal/chromium.src,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,chuan9/chromium-crosswalk,zcbenz/cefode-chromium,krieger-od/nwjs_chromium.src,hujiajie/pa-chromium,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,pozdnyakov/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,markYoungH/chromium.src,anirudhSK/chromium,ChromiumWebApps/chromium,patrickm/chromium.src,dednal/chromium.src,bright-sparks/chromium-spacewalk,ltilve/chromium,zcbenz/cefode-chromium,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,hujiajie/pa-chromium,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,ltilve/chromium,markYoungH/chromium.src,littlstar/chromium.src,M4sse/chromium.src,crosswalk-project/chromium-crosswalk-efl,zcbenz/cefode-chromium,hgl888/chromium-crosswalk,dednal/chromium.src,Just-D/chromium-1,fujunwei/chromium-crosswalk,jaruba/chromium.src,axinging/chromium-crosswalk,anirudhSK/chromium,littlstar/chromium.src,Just-D/chromium-1,ltilve/chromium,dushu1203/chromium.src,hujiajie/pa-chromium,Just-D/chromium-1,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,Chilledheart/chromium,markYoungH/chromium.src,patrickm/chromium.src,littlstar/chromium.src,Fireblend/chromium-crosswalk,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,zcbenz/cefode-chromium,markYoungH/chromium.src,mogoweb/chromium-crosswalk,ondra-novak/chromium.src,mogoweb/chromium-crosswalk,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,dushu1203/chromium.src,jaruba/chromium.src,ltilve/chromium,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src |
4c54e21bfaf52047e4d0790623197df84a7410e4 | src/sys/utsname.c | src/sys/utsname.c | /* $Id$ */
/* Copyright (c) 2006 The DeforaOS Project */
#include "../syscalls.h"
#include "sys/utsname.h"
/* uname */
#ifndef __NetBSD__
syscall1(int, uname, struct utsname *, utsname);
#endif
| /* $Id$ */
/* Copyright (c) 2007 The DeforaOS Project */
#include "../syscalls.h"
#include "sys/utsname.h"
/* uname */
#if !defined(__NetBSD__) || defined(NETBSD_USE_LINUX_EMULATION)
syscall1(int, uname, struct utsname *, utsname);
#endif
| Allow uname() with linux emulation on NetBSD | Allow uname() with linux emulation on NetBSD
| C | bsd-2-clause | DeforaOS/libc,DeforaOS/libc |
3e23ab61c6fe1bfd219f94bae2857985ef50da69 | Pod/Classes/CMHLoginViewController.h | Pod/Classes/CMHLoginViewController.h | #import <ResearchKit/ResearchKit.h>
@class CMHLoginViewController;
@protocol CMHLoginViewControllerDelegate <NSObject>
@optional
- (void)loginViewControllerCancelled:(CMHLoginViewController *_Nonnull)viewController;
- (void)loginViewController:(CMHLoginViewController *_Nonnull)viewController didLogin:(BOOL)success error:(NSError *_Nullable)error;
@end
@interface CMHLoginViewController : ORKTaskViewController
- (_Nonnull instancetype)initWithTitle:(NSString *_Nullable)title text:(NSString *_Nullable)text delegate:(id<CMHLoginViewControllerDelegate>)delegate;
@property (weak, nonatomic, nullable) id<CMHLoginViewControllerDelegate> loginDelegate;
- (instancetype)initWithTask:(nullable id<ORKTask>)task taskRunUUID:(nullable NSUUID *)taskRunUUID NS_UNAVAILABLE;
- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;
- (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil NS_UNAVAILABLE;
- (instancetype)initWithTask:(nullable id<ORKTask>)task restorationData:(nullable NSData *)data delegate:(nullable id<ORKTaskViewControllerDelegate>)delegate NS_UNAVAILABLE;
@end
| #import <ResearchKit/ResearchKit.h>
@class CMHLoginViewController;
@protocol CMHLoginViewControllerDelegate <NSObject>
@optional
- (void)loginViewControllerCancelled:(CMHLoginViewController *_Nonnull)viewController;
- (void)loginViewController:(CMHLoginViewController *_Nonnull)viewController didLogin:(BOOL)success error:(NSError *_Nullable)error;
@end
@interface CMHLoginViewController : ORKTaskViewController
- (_Nonnull instancetype)initWithTitle:(NSString *_Nullable)title text:(NSString *_Nullable)text delegate:(_Nullable id<CMHLoginViewControllerDelegate>)delegate;
@property (weak, nonatomic, nullable) id<CMHLoginViewControllerDelegate> loginDelegate;
- (_Null_unspecified instancetype)initWithTask:(nullable id<ORKTask>)task taskRunUUID:(nullable NSUUID *)taskRunUUID NS_UNAVAILABLE;
- (_Null_unspecified instancetype)initWithCoder:(NSCoder *_Null_unspecified)aDecoder NS_UNAVAILABLE;
- (_Null_unspecified instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil NS_UNAVAILABLE;
- (_Null_unspecified instancetype)initWithTask:(nullable id<ORKTask>)task restorationData:(nullable NSData *)data delegate:(nullable id<ORKTaskViewControllerDelegate>)delegate NS_UNAVAILABLE;
@end
| Add nullability annotations to the custom login view controller's public interface | Add nullability annotations to the custom login view controller's public interface
| C | mit | cloudmine/CMHealthSDK-iOS,cloudmine/CMHealthSDK-iOS,cloudmine/CMHealthSDK |
5cc6bfb2caca2ecd95d4e152d70fc6c261cd31e1 | ionCore/ionStandardLibrary.h | ionCore/ionStandardLibrary.h |
#pragma once
#include "ionTypes.h"
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <sstream>
using std::move;
using std::ifstream;
template <typename T, typename U>
U * ConditionalMapAccess(map<T, U *> & Map, T const Key)
{
auto Iterator = Map.find(Key);
if (Iterator != Map.end())
return Iterator->second;
return 0;
}
class File
{
public:
static bool Exists(string const & FileName)
{
ifstream ifile(FileName);
return ifile.good();
}
static string && ReadAsString(string const & FileName)
{
std::ifstream t(FileName);
std::string str;
t.seekg(0, std::ios::end);
str.reserve((uint) t.tellg());
t.seekg(0, std::ios::beg);
str.assign((std::istreambuf_iterator<char>(t)), std::istreambuf_iterator<char>());
return move(str);
}
};
|
#pragma once
#include "ionTypes.h"
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <sstream>
using std::move;
using std::ifstream;
template <typename T, typename U>
U * ConditionalMapAccess(map<T, U *> & Map, T const Key)
{
auto Iterator = Map.find(Key);
if (Iterator != Map.end())
return Iterator->second;
return 0;
}
class File
{
public:
static bool Exists(string const & FileName)
{
ifstream ifile(FileName);
return ifile.good();
}
static string ReadAsString(string const & FileName)
{
std::ifstream t(FileName);
std::string str;
t.seekg(0, std::ios::end);
str.reserve((uint) t.tellg());
t.seekg(0, std::ios::beg);
str.assign((std::istreambuf_iterator<char>(t)), std::istreambuf_iterator<char>());
return str;
}
};
| Fix inappropriate move in ReadAsString | Fix inappropriate move in ReadAsString
--HG--
branch : SceneOverhaul
| C | mit | iondune/ionEngine,iondune/ionEngine |
1f62a70bbf4f45f26c04145a5ad25e90b578db9b | lib/Runtime/ByteCode/ByteCodeCacheReleaseFileVersion.h | lib/Runtime/ByteCode/ByteCodeCacheReleaseFileVersion.h | //-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
// NOTE: If there is a merge conflict the correct fix is to make a new GUID.
// This file was generated with tools\update_bytecode_version.ps1
// {81AEEA4B-AE4E-40C0-848F-6DB7C5F49F55}
const GUID byteCodeCacheReleaseFileVersion =
{ 0x81AEEA4B, 0xAE4E, 0x40C0, { 0x84, 0x8F, 0x6D, 0xB7, 0xC5, 0xF4, 0x9F, 0x55 } };
| //-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
// NOTE: If there is a merge conflict the correct fix is to make a new GUID.
// This file was generated with tools\update_bytecode_version.ps1
// {2C341884-72E5-4799-923C-DB8EDAFEEA89}
const GUID byteCodeCacheReleaseFileVersion =
{ 0x2C341884, 0x72E5, 0x4799, { 0x92, 0x3C, 0xDB, 0x8E, 0xDA, 0xFE, 0xEA, 0x89 } };
| Update byte code ID for InitConst change | Update byte code ID for InitConst change
| C | mit | Microsoft/ChakraCore,Microsoft/ChakraCore,Microsoft/ChakraCore,Microsoft/ChakraCore,Microsoft/ChakraCore,Microsoft/ChakraCore |
b3fbc27c7a4130904f3cae41eb161832304b6b9d | src/condor_syscall_lib/syscall_mode.c | src/condor_syscall_lib/syscall_mode.c | /*******************************************************************
**
** Manage system call mode and do remote system calls.
**
*******************************************************************/
#define _POSIX_SOURCE
#include <stdio.h>
#include "condor_syscall_mode.h"
static int SyscallMode = 1; /* LOCAL and UNMAPPED */
int
SetSyscalls( int mode )
{
int answer;
answer = SyscallMode;
SyscallMode = mode;
return answer;
}
BOOL
LocalSysCalls()
{
return SyscallMode & SYS_LOCAL;
}
BOOL
RemoteSysCalls()
{
return (SyscallMode & SYS_LOCAL) == 0;
}
BOOL
MappingFileDescriptors()
{
return (SyscallMode & SYS_MAPPED);
}
#if defined(AIX32) /* Just to test linking */
int syscall( int num, ... )
{
return 0;
}
#endif
| /*******************************************************************
**
** Manage system call mode and do remote system calls.
**
*******************************************************************/
#define _POSIX_SOURCE
#include "condor_common.h"
#include "condor_debug.h"
#include "condor_syscall_mode.h"
static int SyscallMode = 1; /* LOCAL and UNMAPPED */
int
SetSyscalls( int mode )
{
int answer;
answer = SyscallMode;
SyscallMode = mode;
return answer;
}
BOOL
LocalSysCalls()
{
return SyscallMode & SYS_LOCAL;
}
BOOL
RemoteSysCalls()
{
return (SyscallMode & SYS_LOCAL) == 0;
}
BOOL
MappingFileDescriptors()
{
return (SyscallMode & SYS_MAPPED);
}
void
DisplaySyscallMode()
{
dprintf( D_ALWAYS,
"Syscall Mode is: %s %s\n",
RemoteSysCalls() ? "REMOTE" : "LOCAL",
MappingFileDescriptors() ? "MAPPED" : "UNMAPPED"
);
}
#if defined(AIX32) /* Just to test linking */
int syscall( int num, ... )
{
return 0;
}
#endif
| Add DisplaySyscallMode() routine for debugging. | Add DisplaySyscallMode() routine for debugging.
| C | apache-2.0 | zhangzhehust/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,neurodebian/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,clalancette/condor-dcloud,zhangzhehust/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,neurodebian/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,clalancette/condor-dcloud,djw8605/htcondor,zhangzhehust/htcondor,htcondor/htcondor,htcondor/htcondor,zhangzhehust/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/condor,djw8605/condor,djw8605/htcondor,neurodebian/htcondor,htcondor/htcondor,djw8605/condor,neurodebian/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,htcondor/htcondor,zhangzhehust/htcondor,htcondor/htcondor,djw8605/htcondor,djw8605/condor,djw8605/condor,djw8605/htcondor,neurodebian/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/condor,mambelli/osg-bosco-marco,htcondor/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,zhangzhehust/htcondor,djw8605/condor,mambelli/osg-bosco-marco,neurodebian/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,htcondor/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,djw8605/condor,djw8605/htcondor,djw8605/htcondor,clalancette/condor-dcloud,zhangzhehust/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco |
d9041156f999342aab312dfb7ea6dfc21f7cbd08 | SWXMLDateMapping.h | SWXMLDateMapping.h | //
// SWXMLDateMapping.h
// This file is part of the "SWXMLMapping" project, and is distributed under the MIT License.
//
// Created by Samuel Williams on 13/11/05.
// Copyright 2005 Samuel Williams. All rights reserved.
//
#import "SWXMLMemberMapping.h"
@class SWXMLMemberMapping;
@interface SWXMLDateMapping : SWXMLMemberMapping {
}
@end
| //
// SWXMLDateMapping.h
// This file is part of the "SWXMLMapping" project, and is distributed under the MIT License.
//
// Created by Samuel Williams on 13/11/05.
// Copyright 2005 Samuel Williams. All rights reserved.
//
#import "SWXMLMemberMapping.h"
@class SWXMLMemberMapping;
// Formats value attribute according to ISO8601 (http://www.w3.org/TR/NOTE-datetime)
@interface SWXMLDateMapping : SWXMLMemberMapping {
}
@end
| Comment regarding value serialization of date. | Comment regarding value serialization of date.
| C | mit | oriontransfer/SWXMLMapping |
626cf0008f095c5445636fb0b57156d43b715df7 | tests/regression/03-practical/22-nested-infinite-loops.c | tests/regression/03-practical/22-nested-infinite-loops.c | // https://github.com/goblint/analyzer/issues/231#issuecomment-868369123
int main(void) {
int x = 0;
while(1) {
while(1) {
x++;
}
x--;
}
x--;
return x;
} | Add nested infinite loops test | Add nested infinite loops test
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
8d644ff0daeee58cbdf9585817b39354b56461f8 | tests/regression/27-inv_invariants/15-unknown-null-ptr.c | tests/regression/27-inv_invariants/15-unknown-null-ptr.c | #include <stddef.h>
int main() {
int *r; // rand
if (r == NULL)
assert(r == NULL);
else
assert(r != NULL); // TODO
if (r != NULL)
assert(r != NULL);
else
assert(r == NULL); // TODO
return 0;
}
| Add test for NULL pointer invariant refinement | Add test for NULL pointer invariant refinement
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
44ff99d3d8e9bb89f9084fc0d6586f1a7f0e1277 | ann.c | ann.c | #include <stdio.h>
#define INPUTS 3
#define HIDDEN 5
#define OUTPUTS 2
#define ROWS 5
typedef struct {
double input[HIDDEN][INPUTS];
double hidden[ROWS - 3][HIDDEN][HIDDEN];
double output[OUTPUTS][HIDDEN];
} Links;
typedef struct {
Links weights;
} ANN;
int main(void)
{
return 0;
}
| #include <stdio.h>
#define INPUTS 3
#define HIDDEN 5
#define OUTPUTS 2
#define ROWS 5
typedef struct {
double input[HIDDEN][INPUTS];
double hidden[ROWS - 3][HIDDEN][HIDDEN];
double output[OUTPUTS][HIDDEN];
} Links;
typedef struct {
int input[INPUTS];
int hidden[HIDDEN];
int output[OUTPUTS];
} Neurons;
typedef struct {
Links weights;
Neurons values;
} ANN;
int main(void)
{
return 0;
}
| Allow neuron values (outputs) to be stored | Allow neuron values (outputs) to be stored
| C | mit | tysonzero/c-ann |
a998d0fcb5626b90c4b2cc92a25982b5407eba03 | free.h | free.h | /*
* free.h
* Memory usage utility for Darwin & MacOS X (similar to 'free' under Linux)
*
* by: David Cantrell <[email protected]>
* Copyright (C) 2008, David Cantrell, Honolulu, HI, USA.
*
* Licensed under the GNU Lesser General Public License version 2.1 or later.
* See COPYING.LIB for licensing details.
*/
#define FREE_USAGE "Usage: %s [-b|-k|-m] [-s delay] [-V] [-h|-?]\n"
#define COMBINED_UNIT_OPTIONS "You may only use one of the unit options: -b, -k, or -m\n"
enum { BYTES, KILOBYTES, MEGABYTES };
typedef struct mem {
uint64_t total;
uint64_t used;
uint64_t free;
uint64_t active;
uint64_t inactive;
uint64_t wired;
} mem_t;
| /*
* free.h
* Memory usage utility for Darwin & MacOS X (similar to 'free' under Linux)
*
* by: David Cantrell <[email protected]>
* Copyright (C) 2008, David Cantrell, Honolulu, HI, USA.
*
* Licensed under the GNU Lesser General Public License version 2.1 or later.
* See COPYING.LIB for licensing details.
*/
#define FREE_USAGE "Usage: %s [-b|-k|-m] [-s delay] [-V] [-h|-?]\n"
#define COMBINED_UNIT_OPTIONS "You may only use one of the unit options: -b, -k, or -m\n"
enum { UNUSED_UNIT, BYTES, KILOBYTES, MEGABYTES };
typedef struct mem {
uint64_t total;
uint64_t used;
uint64_t free;
uint64_t active;
uint64_t inactive;
uint64_t wired;
} mem_t;
| Make sure used unit constants are non-zero | Make sure used unit constants are non-zero
| C | lgpl-2.1 | dcantrell/darwin-free |
47bf9fbde1fffc46171cdf225dbd685a5e0a7526 | gtksourceview2.h | gtksourceview2.h | #include "gtk2hs_macros.h"
#include <gtksourceview/gtksourcebuffer.h>
#if GTK_MAJOR_VERSION < 3
#include <gtksourceview/gtksourceiter.h>
#endif
#include <gtksourceview/gtksourcelanguage.h>
#include <gtksourceview/gtksourcelanguagemanager.h>
#include <gtksourceview/gtksourcestyle.h>
#include <gtksourceview/gtksourcestylescheme.h>
#include <gtksourceview/gtksourcestyleschememanager.h>
#include <gtksourceview/gtksourceview.h>
#include <gtksourceview/gtksourceview-typebuiltins.h>
#include <gtksourceview/gtksourceundomanager.h>
#include <gtksourceview/gtksourcecompletionitem.h>
#include <gtksourceview/gtksourcegutter.h>
#include <gtksourceview/gtksourcecompletionprovider.h>
#include <gtksourceview/gtksourcecompletionproposal.h>
#include <gtksourceview/gtksourcemark.h>
#include <gtksourceview/gtksourcecompletioninfo.h>
| #ifdef __BLOCKS__
#undef __BLOCKS__
#endif
#include "gtk2hs_macros.h"
#include <gtksourceview/gtksourcebuffer.h>
#if GTK_MAJOR_VERSION < 3
#include <gtksourceview/gtksourceiter.h>
#endif
#include <gtksourceview/gtksourcelanguage.h>
#include <gtksourceview/gtksourcelanguagemanager.h>
#include <gtksourceview/gtksourcestyle.h>
#include <gtksourceview/gtksourcestylescheme.h>
#include <gtksourceview/gtksourcestyleschememanager.h>
#include <gtksourceview/gtksourceview.h>
#include <gtksourceview/gtksourceview-typebuiltins.h>
#include <gtksourceview/gtksourceundomanager.h>
#include <gtksourceview/gtksourcecompletionitem.h>
#include <gtksourceview/gtksourcegutter.h>
#include <gtksourceview/gtksourcecompletionprovider.h>
#include <gtksourceview/gtksourcecompletionproposal.h>
#include <gtksourceview/gtksourcemark.h>
#include <gtksourceview/gtksourcecompletioninfo.h>
| Fix CPP issue on OS X | Fix CPP issue on OS X
| C | lgpl-2.1 | gtk2hs/gtksourceview,gtk2hs/gtksourceview |
504d69fb848c13a69d7747f85f541b3ac3cf8019 | UIforETW/Version.h | UIforETW/Version.h | #pragma once
// const float in a header file can lead to duplication of the storage
// but I don't really care in this case. Just don't do it with a header
// that is included hundreds of times.
const float kCurrentVersion = 1.47f;
// Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version
// increment that won't trigger the new-version checks, handy for minor
// releases that I don't want to bother users about.
//#define VERSION_SUFFIX 'b'
| #pragma once
// const float in a header file can lead to duplication of the storage
// but I don't really care in this case. Just don't do it with a header
// that is included hundreds of times.
const float kCurrentVersion = 1.48f;
// Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version
// increment that won't trigger the new-version checks, handy for minor
// releases that I don't want to bother users about.
//#define VERSION_SUFFIX 'b'
| Increase version to 1.48 in preparation for new release | Increase version to 1.48 in preparation for new release
| C | apache-2.0 | ariccio/UIforETW,google/UIforETW,mwinterb/UIforETW,google/UIforETW,google/UIforETW,mwinterb/UIforETW,ariccio/UIforETW,MikeMarcin/UIforETW,ariccio/UIforETW,MikeMarcin/UIforETW,ariccio/UIforETW,MikeMarcin/UIforETW,mwinterb/UIforETW,google/UIforETW |
e92d5f3a593c656cc6b10f4a3a904a8121efb56e | Binary_Tree_Maximum_Path_Sum.c | Binary_Tree_Maximum_Path_Sum.c | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* struct TreeNode *left;
* struct TreeNode *right;
* };
*/
int max_v(int a, int b) {
return a > b ? a : b;
}
int max_value;
int DFS(struct TreeNode* root) {
int left_sum, right_sum;
int sum;
if (root == NULL)
return 0;
left_sum = max_v(0, DFS(root->left));
right_sum= max_v(0, DFS(root->right));
sum = left_sum + right_sum + root->val;//a path.
max_value = max_v(sum, max_value);
return max_v(left_sum, right_sum) + root->val;//return one max path.
}
int maxPathSum(struct TreeNode* root) {
if (root == NULL)
return 0;
max_value = -999999999;
DFS(root);
return max_value;
} | Create Binary Tree Maximum Path Sum.c | Create Binary Tree Maximum Path Sum.c
| C | mit | fanyingming/leetcode,fanyingming/leetcode |
|
ce2df60e506865768215d05489c5a52cbb6febcb | Classes/JLNRGravityImageView.h | Classes/JLNRGravityImageView.h | //
// JLNRGravityImageView.h
// JLNRGravityImageViewExample
//
// Created by Julian Raschke on 17.02.15.
// Copyright (c) 2015 Julian Raschke. All rights reserved.
//
#import <UIKit/UIKit.h>
IB_DESIGNABLE
@interface JLNRGravityImageView : UIImageView
@property (nonatomic) IBInspectable BOOL alignTop;
@property (nonatomic) IBInspectable BOOL alignBottom;
@property (nonatomic) IBInspectable BOOL alignLeft;
@property (nonatomic) IBInspectable BOOL alignRight;
@end
| //
// JLNRGravityImageView.h
// JLNRGravityImageViewExample
//
// Created by Julian Raschke on 17.02.15.
// Copyright (c) 2015 Julian Raschke. All rights reserved.
//
#import <UIKit/UIKit.h>
// IB_DESIGNABLE does not work by default with CocoaPods:
// https://github.com/CocoaPods/CocoaPods/issues/2792
#ifndef COCOAPODS
IB_DESIGNABLE
#endif
@interface JLNRGravityImageView : UIImageView
@property (nonatomic) IBInspectable BOOL alignTop;
@property (nonatomic) IBInspectable BOOL alignBottom;
@property (nonatomic) IBInspectable BOOL alignLeft;
@property (nonatomic) IBInspectable BOOL alignRight;
@end
| Disable IB_DESIGNABLE when using CocoaPods | Disable IB_DESIGNABLE when using CocoaPods
| C | mit | jlnr/JLNRGravityImageView,lurado/LDOAlignedImageView |
526b09b014c8219cfe3747170c6021fe92fb65d5 | firmware/lm32/config.h | firmware/lm32/config.h | #ifndef __CONFIG_H
#define __CONFIG_H
enum {
CONFIG_KEY_RESOLUTION = 0,
CONFIG_KEY_BLEND_USER1,
CONFIG_KEY_BLEND_USER2,
CONFIG_KEY_BLEND_USER3,
CONFIG_KEY_BLEND_USER4,
CONFIG_KEY_COUNT
};
#define CONFIG_DEFAULTS { 9, 1, 2, 3, 4 }
void config_init(void);
void config_write_all(void);
unsigned char config_get(unsigned char key);
void config_set(unsigned char key, unsigned char value);
#endif /* __CONFIG_H */
| #ifndef __CONFIG_H
#define __CONFIG_H
enum {
CONFIG_KEY_RESOLUTION = 0,
CONFIG_KEY_BLEND_USER1,
CONFIG_KEY_BLEND_USER2,
CONFIG_KEY_BLEND_USER3,
CONFIG_KEY_BLEND_USER4,
CONFIG_KEY_COUNT
};
#ifdef BOARD_MINISPARTAN6
#define CONFIG_DEFAULTS { 5, 1, 2, 3, 4 }
#else
#define CONFIG_DEFAULTS { 9, 1, 2, 3, 4 }
#endif
void config_init(void);
void config_write_all(void);
unsigned char config_get(unsigned char key);
void config_set(unsigned char key, unsigned char value);
#endif /* __CONFIG_H */
| Make 800x600 the default mode for the minispartan6+ | firmware/lm32: Make 800x600 the default mode for the minispartan6+
| C | bsd-2-clause | mithro/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware |
9603de4489d4fb7b057e55402080544db0d75d99 | src/lang-dutch.c | src/lang-dutch.c | #include "num2words.h"
// Language strings for Dutch
const Language LANG_DUTCH = {
.hours = {
"een",
"twee",
"drie",
"vier",
"vijf",
"zes",
"zeven",
"acht",
"negen",
"tien",
"elf",
"twaalf"
},
.phrases = {
"*$1 uur ",
"vijf over *$1 ",
"tien over *$1 ",
"kwart over *$1 ",
"tien voor half *$2 ",
"vijf voor half *$2 ",
"half *$2 ",
"vijf over half *$2 ",
"tien over half *$2 ",
"kwart voor *$2 ",
"tien voor *$2 ",
"vijf voor *$2 "
},
#ifdef PBL_PLATFORM_CHALK
.greetings = {
"Goede- morgen ",
"Goede- middag ",
"Goede- avond ",
"Goede- nacht "
},
#else
.greetings = {
"Goede- mor- gen ",
"Goede- middag ",
"Goede- avond ",
"Goede- nacht "
},
#endif
.connection_lost = "Waar is je tele- foon? "
};
| #include "num2words.h"
// Language strings for Dutch
const Language LANG_DUTCH = {
.hours = {
"een",
"twee",
"drie",
"vier",
"vijf",
"zes",
"zeven",
"acht",
"negen",
"tien",
"elf",
"twaalf"
},
.phrases = {
"*$1 uur ",
"vijf over *$1 ",
"tien over *$1 ",
"kwart over *$1 ",
"tien voor half *$2 ",
"vijf voor half *$2 ",
"half *$2 ",
"vijf over half *$2 ",
"tien over half *$2 ",
"kwart voor *$2 ",
"tien voor *$2 ",
"vijf voor *$2 "
},
#ifdef PBL_PLATFORM_CHALK
.greetings = {
"Goede morgen ",
"Goede middag ",
"Goede avond ",
"Goede nacht "
},
#else
.greetings = {
"Goede mor- gen ",
"Goede middag ",
"Goede avond ",
"Goede nacht "
},
#endif
.connection_lost = "Waar is je tele- foon? "
};
| Remove hyphens from dutch greetings as per recommendation from @eddyh | Remove hyphens from dutch greetings as per recommendation from @eddyh
| C | mit | Sarastro72/Swedish-Fuzzy-Text-watch,Sarastro72/Swedish-Fuzzy-Text-watch,Sarastro72/Swedish-Fuzzy-Text-watch,Sarastro72/Fuzzy-Text-Watch-Plus,Sarastro72/Swedish-Fuzzy-Text-watch,Sarastro72/Fuzzy-Text-Watch-Plus,Sarastro72/Swedish-Fuzzy-Text-watch,Sarastro72/Fuzzy-Text-Watch-Plus,Sarastro72/Fuzzy-Text-Watch-Plus |
d496a2cb613d41095a25d1f8a8cf73fac2dd55b3 | ouzel/Settings.h | ouzel/Settings.h | // Copyright (C) 2016 Elviss Strazdins
// This file is part of the Ouzel engine.
#pragma once
#include "CompileConfig.h"
namespace ouzel
{
struct Settings
{
video::Renderer::Driver driver =
#if defined(OUZEL_PLATFORM_OSX) || defined(OUZEL_PLATFORM_IOS) || defined(OUZEL_PLATFORM_TVOS) || defined(OUZEL_PLATFORM_ANDROID) || defined(OUZEL_PLATFORM_LINUX)
video::Renderer::Driver::OPENGL;
#elif defined(SUPPORTS_DIRECT3D11)
video::Renderer::Driver::DIRECT3D11;
#endif
Size2 size;
bool resizable = false;
bool fullscreen = false;
float targetFPS = 60.0f;
std::string title = "ouzel";
};
}
| // Copyright (C) 2016 Elviss Strazdins
// This file is part of the Ouzel engine.
#pragma once
#include "CompileConfig.h"
namespace ouzel
{
struct Settings
{
video::Renderer::Driver driver =
#if defined(OUZEL_PLATFORM_OSX) || defined(OUZEL_PLATFORM_IOS) || defined(OUZEL_PLATFORM_TVOS) || defined(OUZEL_PLATFORM_ANDROID) || defined(OUZEL_PLATFORM_LINUX)
video::Renderer::Driver::OPENGL;
#elif defined(SUPPORTS_DIRECT3D11)
video::Renderer::Driver::DIRECT3D11;
#endif
Size2 size;
uint32_t sampleCount = 1; // MSAA sample count
bool resizable = false;
bool fullscreen = false;
float targetFPS = 60.0f;
std::string title = "ouzel";
};
}
| Add setting for MSAA sample count | Add setting for MSAA sample count
| C | unlicense | elvman/ouzel,elnormous/ouzel,Hotspotmar/ouzel,elnormous/ouzel,Hotspotmar/ouzel,elnormous/ouzel,Hotspotmar/ouzel,elvman/ouzel |
c03ade8e87b3848bbb1d30d6e8a09633fbe22a7c | thcrap/src/log.h | thcrap/src/log.h | /**
* Touhou Community Reliant Automatic Patcher
* Main DLL
*
* ----
*
* Logging functions.
* Log to both a file and, if requested, an on-screen console.
*
* As of now, we do not enforce char strings to be in UTF-8.
*/
#pragma once
/// ---------------
/// Standard output
/// ---------------
// Basic
void log_print(const char *text);
// Specific length
void log_nprint(const char *text, size_t n);
// Formatted
void log_vprintf(const char *text, va_list va);
void log_printf(const char *text, ...);
#define log_func_printf(text, ...) \
log_printf("["__FUNCTION__"]: "##text, __VA_ARGS__)
/// ---------------
/// -------------
/// Message boxes
// Technically not a "logging function", but hey, it has variable arguments.
/// -------------
// Basic
int log_mbox(const char *caption, const UINT type, const char *text);
// Formatted
int log_vmboxf(const char *caption, const UINT type, const char *text, va_list va);
int log_mboxf(const char *caption, const UINT type, const char *text, ...);
/// -------------
void log_init(int console);
void log_exit(void);
| /**
* Touhou Community Reliant Automatic Patcher
* Main DLL
*
* ----
*
* Logging functions.
* Log to both a file and, if requested, an on-screen console.
*
* As of now, we do not enforce char strings to be in UTF-8.
*/
#pragma once
/// ---------------
/// Standard output
/// ---------------
// Basic
void log_print(const char *text);
// Specific length
void log_nprint(const char *text, size_t n);
// Formatted
void log_vprintf(const char *text, va_list va);
void log_printf(const char *text, ...);
#ifdef _MSC_VER
# define log_func_printf(text, ...) \
log_printf("["__FUNCTION__"]: "text, __VA_ARGS__)
#else
# define log_func_printf(text, ...) \
log_printf("[%s]: "text, __func__, ##__VA_ARGS__)
#endif
/// ---------------
/// -------------
/// Message boxes
// Technically not a "logging function", but hey, it has variable arguments.
/// -------------
// Basic
int log_mbox(const char *caption, const UINT type, const char *text);
// Formatted
int log_vmboxf(const char *caption, const UINT type, const char *text, va_list va);
int log_mboxf(const char *caption, const UINT type, const char *text, ...);
/// -------------
void log_init(int console);
void log_exit(void);
| Use C99 __func__ instead of __FUNCTION__ when not compiling with Visual C++. | Use C99 __func__ instead of __FUNCTION__ when not compiling with Visual C++.
Couldn't they standardize __FUNCTION__ instead? A string literal that can be
concatenated with other string literals is much more flexible than a char[]
variable.
| C | unlicense | thpatch/thcrap,thpatch/thcrap,thpatch/thcrap,thpatch/thcrap,thpatch/thcrap |
c3a6cadc3df8702f1f195f6cda53f023dfe7e6ae | robot_module.h | robot_module.h | /*
* File: robots.h
* Author: m79lol
*
*/
#ifndef ROBOT_MODULE_H
#define ROBOT_MODULE_H
#define ROBOT_COMMAND_FREE 0
#define ROBOT_COMMAND_HAND_CONTROL_BEGIN -1
#define ROBOT_COMMAND_HAND_CONTROL_END -2
class Robot {
protected:
Robot() {}
public:
virtual FunctionResult* executeFunction(regval command_index, regval *args) = 0;
virtual void axisControl(regval axis_index, regval value) = 0;
virtual ~Robot() {}
};
class RobotModule {
protected:
RobotModule() {}
public:
virtual const char *getUID() = 0;
virtual int init() = 0;
virtual FunctionData** getFunctions(int *count_functions) = 0;
virtual AxisData** getAxis(int *count_axis) = 0;
virtual Robot* robotRequire() = 0;
virtual void robotFree(Robot *robot) = 0;
virtual void final() = 0;
virtual void destroy() = 0;
virtual ~RobotModule() {}
};
typedef RobotModule* (*getRobotModuleObject_t)();
extern "C" {
__declspec(dllexport) RobotModule* getRobotModuleObject();
}
#endif /* ROBOT_MODULE_H */
| /*
* File: robots.h
* Author: m79lol
*
*/
#ifndef ROBOT_MODULE_H
#define ROBOT_MODULE_H
#define ROBOT_COMMAND_FREE 0
#define ROBOT_COMMAND_HAND_CONTROL_BEGIN -1
#define ROBOT_COMMAND_HAND_CONTROL_END -2
typedef std::function<void(unsigned short int, const char*, va_list)> t_printf_color_module;
class Robot {
protected:
Robot() {}
public:
virtual FunctionResult* executeFunction(regval command_index, regval *args) = 0;
virtual void axisControl(regval axis_index, regval value) = 0;
virtual ~Robot() {}
};
class RobotModule {
protected:
RobotModule() {}
public:
virtual const char *getUID() = 0;
virtual void prepare(t_printf_color_module f_printf) = 0;
virtual int init() = 0;
virtual FunctionData** getFunctions(int *count_functions) = 0;
virtual AxisData** getAxis(int *count_axis) = 0;
virtual Robot* robotRequire() = 0;
virtual void robotFree(Robot *robot) = 0;
virtual void final() = 0;
virtual void destroy() = 0;
virtual ~RobotModule() {}
};
typedef RobotModule* (*getRobotModuleObject_t)();
extern "C" {
__declspec(dllexport) RobotModule* getRobotModuleObject();
}
#endif /* ROBOT_MODULE_H */
| Prepare function added for Robot modules. | Prepare function added for Robot modules.
| C | apache-2.0 | RobotControlTechnologies/module_headers,iskinmike/module_headers |
01ccbd9b875b0ab9e21e8dca1501be249d13f451 | src/block_header.h | src/block_header.h | // Copyright (c) 2012-2013, the scalloc Project Authors. All rights reserved.
// Please see the AUTHORS file for details. Use of this source code is governed
// by a BSD license that can be found in the LICENSE file.
#ifndef SCALLOC_BLOCK_HEADER_H_
#define SCALLOC_BLOCK_HEADER_H_
#include "common.h"
#include "freelist.h"
enum BlockType {
kSlab,
kLargeObject,
kForward
};
class BlockHeader {
public:
static BlockHeader* GetFromObject(void* p);
BlockType type;
};
class ForwardHeader : public BlockHeader {
public:
BlockHeader* forward;
};
class SlabHeader : public BlockHeader {
public:
// read-only properties
size_t size_class;
size_t remote_flist;
// mostly read properties
bool active;
size_t owner;
// thread-local read/write properties
uint64_t in_use;
Freelist flist;
} cache_aligned;
class LargeObjectHeader : public BlockHeader {
public:
size_t size;
inline void Reset(size_t size) {
this->type = kLargeObject;
this->size = size;
}
} cache_aligned;
always_inline BlockHeader* BlockHeader::GetFromObject(void* p) {
uintptr_t ptr = reinterpret_cast<uintptr_t>(p);
if (UNLIKELY(ptr % kSystemPageSize == 0)) {
BlockHeader* bh = reinterpret_cast<BlockHeader*>(ptr - kSystemPageSize);
if (bh->type == kForward) {
bh = reinterpret_cast<ForwardHeader*>(bh)->forward;
}
}
uintptr_t page_ptr = ptr & ~(kSystemPageSize - 1);
BlockHeader* bh = reinterpret_cast<BlockHeader*>(page_ptr);
switch (bh->type) {
case kForward:
return reinterpret_cast<ForwardHeader*>(bh)->forward;
case kSlab:
case kLargeObject:
return bh;
default:
ErrorOut("unknown block header. type: %d, ptr: %p, page_ptr: %p",
bh->type, p, reinterpret_cast<void*>(page_ptr));
}
// unreachable...
return NULL;
}
#endif // SCALLOC_BLOCK_HEADER_H_
| Add definitions for block headers. | Add definitions for block headers.
Signed-off-by: Michael Lippautz <[email protected]>
| C | bsd-2-clause | cksystemsgroup/scalloc,cksystemsgroup/scalloc,cksystemsgroup/scalloc |
|
dcabda08e5888edca40c1bd03265096fcda1a173 | tests/regression/36-octapron/28-combine-forget-fun-lval-imprecise.c | tests/regression/36-octapron/28-combine-forget-fun-lval-imprecise.c | // SKIP PARAM: --sets ana.activated[+] octApron
#include <assert.h>
int f(int x) {
return x + 1;
}
int main(void) {
int y, z;
z = y;
y = f(y);
// local is: y == z
// fun is: #ret == x' + 1
// fun args subst (x' -> y) is: #ret == y + 1
// local forget y is: top
// fun forget y is: top
// fun subst (#ret -> y) is: top
// unify is: top
// WANT:
// local is: y == z
// fun is: #ret == x' + 1
// fun args subst (x' -> y) is: #ret == y + 1
// unify is: y == z && #ret == y + 1 (&& #ret == z + 1)
// assign (y = #ret) is:
// 1. y == z && #ret == y + 1 && y#new == #ret (&& #ret == z + 1 && y#new == z + 1)
// 2. y#new == #ret && #ret == z + 1 (&& y#new == z + 1)
// 3. y == #ret && #ret == z + 1 (&& y == z + 1)
// forget #ret is: y == z + 1
assert(y == z + 1); // TODO
return 0;
}
| Add test for octApron combine where forgetting lval is too imprecise | Add test for octApron combine where forgetting lval is too imprecise
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
accec546d710228b9b2a5cc84557cde6624d7a89 | include/tiramisu/MainPage.h | include/tiramisu/MainPage.h | /** \file
* This file only exists to contain the front-page of the documentation
*/
/** \mainpage Documentation of the API if the Tiramisu Compiler
*
* Tiramisu provides few classes to enable users to represent their program:
* - The \ref tiramisu::function class: a function in Tiramisu is equivalent to a function in C. It is composed of multiple computations. Each computation is the equivalent of a statement in C.
* - The \ref tiramisu::input class: an input is used to represent inputs passed to Tiramisu. An input can represent a buffer or a scalar.
* - The \ref tiramisu::constant class: a constant is designed to represent constants that are supposed to be declared at the beginning of a Tiramisu function.
* - The \ref tiramisu::computation class: a computation in Tiramisu is the equivalent of a statement in C. It is composed of an expression and an iteration domain.
* - The \ref tiramisu::buffer class: a class to represent memory buffers.
*
*/
| /** \file
* This file only exists to contain the front-page of the documentation
*/
/** \mainpage Documentation of the API if the Tiramisu Compiler
*
* Tiramisu provides few classes to enable users to represent their program:
* - The \ref tiramisu::function class: a function in Tiramisu is equivalent to a function in C. It is composed of multiple computations. Each computation is the equivalent of a statement in C.
* - The \ref tiramisu::input class: an input is used to represent inputs passed to Tiramisu. An input can represent a buffer or a scalar.
* - The \ref tiramisu::constant class: a constant is designed to represent constants that are supposed to be declared at the beginning of a Tiramisu function.
* - The \ref tiramisu::var class: used to represent loop iterators. Usually we declare a var (a loop iterator) and then use it for the declaration of computations. The range of that variable defines the loop range. When use witha buffer it defines the buffer size and when used with an input it defines the input size.
* - The \ref tiramisu::computation class: a computation in Tiramisu is the equivalent of a statement in C. It is composed of an expression and an iteration domain.
* - The \ref tiramisu::buffer class: a class to represent memory buffers.
*/
| Fix the documentation main page | Fix the documentation main page
| C | mit | rbaghdadi/COLi,rbaghdadi/tiramisu,rbaghdadi/tiramisu,rbaghdadi/tiramisu,rbaghdadi/tiramisu,rbaghdadi/ISIR,rbaghdadi/ISIR,rbaghdadi/COLi |
edee7c36a226e74f53d66b57a1907bb148799599 | targets/TARGET_NUVOTON/TARGET_NANO100/device/cmsis_nvic.c | targets/TARGET_NUVOTON/TARGET_NANO100/device/cmsis_nvic.c | /* mbed Microcontroller Library
* Copyright (c) 2015-2017 Nuvoton
*
* 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 "cmsis_nvic.h"
void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
{
//static volatile uint32_t *vectors = (uint32_t *) NVIC_RAM_VECTOR_ADDRESS;
// Put the vectors in SRAM
//vectors[IRQn + 16] = vector;
}
uint32_t NVIC_GetVector(IRQn_Type IRQn)
{
uint32_t *vectors = (uint32_t*) NVIC_FLASH_VECTOR_ADDRESS;
// Return the vector
return vectors[IRQn + 16];
}
| /* mbed Microcontroller Library
* Copyright (c) 2015-2017 Nuvoton
*
* 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 "cmsis_nvic.h"
#include "platform/mbed_error.h"
void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
{
// NOTE: On NANO130, relocating vector table is not supported due to just 16KB small SRAM.
// Add guard code to prevent from unsupported relocating.
uint32_t vector_static = NVIC_GetVector(IRQn);
if (vector_static != vector) {
error("No support for relocating vector table");
}
}
uint32_t NVIC_GetVector(IRQn_Type IRQn)
{
uint32_t *vectors = (uint32_t*) NVIC_FLASH_VECTOR_ADDRESS;
// Return the vector
return vectors[IRQn + 16];
}
| Add guard code to prevent from relocating vector table | [NANO130] Add guard code to prevent from relocating vector table
| C | apache-2.0 | kjbracey-arm/mbed,svogl/mbed-os,karsev/mbed-os,ryankurte/mbed-os,svogl/mbed-os,CalSol/mbed,infinnovation/mbed-os,karsev/mbed-os,betzw/mbed-os,betzw/mbed-os,catiedev/mbed-os,HeadsUpDisplayInc/mbed,andcor02/mbed-os,c1728p9/mbed-os,ryankurte/mbed-os,catiedev/mbed-os,svogl/mbed-os,ryankurte/mbed-os,mbedmicro/mbed,catiedev/mbed-os,nRFMesh/mbed-os,andcor02/mbed-os,karsev/mbed-os,mbedmicro/mbed,catiedev/mbed-os,CalSol/mbed,nRFMesh/mbed-os,nRFMesh/mbed-os,CalSol/mbed,HeadsUpDisplayInc/mbed,kjbracey-arm/mbed,betzw/mbed-os,c1728p9/mbed-os,CalSol/mbed,CalSol/mbed,c1728p9/mbed-os,infinnovation/mbed-os,YarivCol/mbed-os,svogl/mbed-os,ryankurte/mbed-os,Archcady/mbed-os,mbedmicro/mbed,Archcady/mbed-os,nRFMesh/mbed-os,YarivCol/mbed-os,YarivCol/mbed-os,mazimkhan/mbed-os,catiedev/mbed-os,c1728p9/mbed-os,karsev/mbed-os,svogl/mbed-os,infinnovation/mbed-os,mazimkhan/mbed-os,nRFMesh/mbed-os,HeadsUpDisplayInc/mbed,infinnovation/mbed-os,infinnovation/mbed-os,Archcady/mbed-os,HeadsUpDisplayInc/mbed,mbedmicro/mbed,YarivCol/mbed-os,andcor02/mbed-os,betzw/mbed-os,kjbracey-arm/mbed,mazimkhan/mbed-os,mazimkhan/mbed-os,YarivCol/mbed-os,Archcady/mbed-os,betzw/mbed-os,Archcady/mbed-os,andcor02/mbed-os,HeadsUpDisplayInc/mbed,catiedev/mbed-os,svogl/mbed-os,mbedmicro/mbed,mazimkhan/mbed-os,YarivCol/mbed-os,kjbracey-arm/mbed,andcor02/mbed-os,HeadsUpDisplayInc/mbed,Archcady/mbed-os,ryankurte/mbed-os,c1728p9/mbed-os,mazimkhan/mbed-os,andcor02/mbed-os,karsev/mbed-os,ryankurte/mbed-os,betzw/mbed-os,c1728p9/mbed-os,karsev/mbed-os,nRFMesh/mbed-os,CalSol/mbed,infinnovation/mbed-os |
a394a676b804449c2c939a26ee394a025f7c325c | src/cpu/register.h | src/cpu/register.h | #ifndef EMULATOR_REGISTER_H
#define EMULATOR_REGISTER_H
#include <cstdint>
template <typename T>
class Register {
public:
Register() {};
void set(const T new_value) { val = new_value; };
T value() const { return val; };
void increment() { val += 1; };
void decrement() { val -= 1; };
private:
T val;
};
typedef Register<uint8_t> ByteRegister;
typedef Register<uint16_t> WordRegister;
class RegisterPair {
public:
RegisterPair(ByteRegister& low, ByteRegister& high);
void set_low(const uint8_t byte);
void set_high(const uint8_t byte);
void set_low(const ByteRegister& byte);
void set_high(const ByteRegister& byte);
void set(const uint16_t word);
uint8_t low() const;
uint8_t high() const;
uint16_t value() const;
void increment();
void decrement();
private:
ByteRegister& low_byte;
ByteRegister& high_byte;
};
#endif
| #ifndef EMULATOR_REGISTER_H
#define EMULATOR_REGISTER_H
#include <cstdint>
template <typename T>
class Register {
public:
Register() {};
void set(const T new_value) { val = new_value; };
T value() const { return val; };
void increment() { val += 1; };
void decrement() { val -= 1; };
private:
T val;
};
typedef Register<uint8_t> ByteRegister;
typedef Register<uint16_t> WordRegister;
class RegisterPair {
public:
RegisterPair(ByteRegister& low, ByteRegister& high);
void set_low(const uint8_t byte);
void set_high(const uint8_t byte);
void set_low(const ByteRegister& byte);
void set_high(const ByteRegister& byte);
void set(const uint16_t word);
uint8_t low() const;
uint8_t high() const;
uint16_t value() const;
void increment();
void decrement();
private:
ByteRegister& low_byte;
ByteRegister& high_byte;
};
class Offset {
public:
Offset(uint8_t val) : val(val) {};
Offset(ByteRegister& reg) : val(reg.value()) {};
uint8_t value() { return val; }
private:
uint8_t val;
};
#endif
| Add the mini offset utility class | Add the mini offset utility class
| C | bsd-3-clause | jgilchrist/emulator,jgilchrist/emulator,jgilchrist/emulator |
c02cabaab61367862776ad1d612161d4d623f7a0 | src/DynamicMemory.h | src/DynamicMemory.h | //
// Created by James Telfer on 30/07/2017.
//
#ifndef C_11_FEATURE_DEMO_DYNAMICMEMORY_H
#define C_11_FEATURE_DEMO_DYNAMICMEMORY_H
#include "Thing.h"
class DynamicMemory {
public:
DynamicMemory();
void uniquePointers();
void sharedPointers();
void makeShared();
private:
void outputThing(const Thing* thing) const;
void outputSharedPtr(std::shared_ptr<Thing> thing) const;
std::unique_ptr<Thing> uniquePtrMember;
std::shared_ptr<Thing> sharedPtrMember;
};
#endif //C_11_FEATURE_DEMO_DYNAMICMEMORY_H
| //
// Created by James Telfer on 30/07/2017.
//
#ifndef C_11_FEATURE_DEMO_DYNAMICMEMORY_H
#define C_11_FEATURE_DEMO_DYNAMICMEMORY_H
#include <memory>
#include "Thing.h"
class DynamicMemory {
public:
DynamicMemory();
void uniquePointers();
void sharedPointers();
void makeShared();
private:
void outputThing(const Thing* thing) const;
void outputSharedPtr(std::shared_ptr<Thing> thing) const;
std::unique_ptr<Thing> uniquePtrMember;
std::shared_ptr<Thing> sharedPtrMember;
};
#endif //C_11_FEATURE_DEMO_DYNAMICMEMORY_H
| Add header for smart pointers | Add header for smart pointers
| C | apache-2.0 | jameswtelfer/c11_feature_demo |
9217d50f561be24873e88f50b83cdaed111e2840 | wrapper-lib.c | wrapper-lib.c | /*
* Copyright (c) 2013 Thomas Adam <[email protected]>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* Provides some wrappers around various syscalls to handle things like
* memory/error checking, etc.
*/
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include "lswm.h"
/* Wrapper around asprintf() to handle error code returns. */
int
xasprintf(char **out, const char *fmt, ...)
{
va_list ap;
int i;
va_start(ap, fmt);
i = asprintf(out, fmt, ap);
if (i == -1) {
/* Then there were problems allocating memory. */
log_fatal("Couldn't allocate memory for asprintf()");
}
va_end(ap);
return (i);
}
/* Wrapper for malloc() to handle memory */
void *
xmalloc(size_t s)
{
void *mem;
if (s == 0)
log_fatal("Cannot pass zero size to malloc()");
if ((mem = malloc(s)) == NULL)
log_fatal("malloc() returned NULL");
return (mem);
}
| Add a wrapper lib for common functions | Add a wrapper lib for common functions
Certain functions such as malloc/realloc/asprintf need special handling for
their errors, often erroring out or providing the same error message, etc.
This therefore introduces such a wrapper. Not used too much at the moment.
| C | bsd-2-clause | ThomasAdam/lswm |
|
3f627077a9f2a5fd13234c208525aa61f645ae94 | lesson10/app/src/main/jni/GLES2Lesson.h | lesson10/app/src/main/jni/GLES2Lesson.h | //
// Created by monty on 23/11/15.
//
#ifndef LESSON02_GLES2LESSON_H
#define LESSON02_GLES2LESSON_H
namespace odb {
class GLES2Lesson {
void fetchShaderLocations();
void setPerspective();
void prepareShaderProgram();
void clearBuffers();
void resetTransformMatrices();
void printVerboseDriverInformation();
GLuint createProgram(const char *pVertexSource, const char *pFragmentSource);
GLuint loadShader(GLenum shaderType, const char *pSource);
void drawTrig(Trig &trig, const glm::mat4 &transform);
glm::mat4 projectionMatrix;
glm::mat4 viewMatrix;
GLuint vertexAttributePosition;
GLuint modelMatrixAttributePosition;
GLuint viewMatrixAttributePosition;
GLuint samplerUniformPosition;
GLuint textureCoordinatesAttributePosition;
GLuint projectionMatrixAttributePosition;
GLuint gProgram;
GLuint textureId;
int *textureData;
int textureWidth;
int textureHeight;
std::vector<Trig> mTrigs;
glm::vec3 camera;
public:
GLES2Lesson();
~GLES2Lesson();
bool init(float w, float h, const std::string &vertexShader,
const std::string &fragmentShader);
void setTexture(int *bitmapData, int width, int height, int format);
void render();
void shutdown();
void tick();
void reset();
void addTrigs(std::vector<Trig> vector);
};
}
#endif //LESSON02_GLES2LESSON_H
| //
// Created by monty on 23/11/15.
//
#ifndef LESSON02_GLES2LESSON_H
#define LESSON02_GLES2LESSON_H
namespace odb {
class GLES2Lesson {
void fetchShaderLocations();
void setPerspective();
void prepareShaderProgram();
void clearBuffers();
void resetTransformMatrices();
void printVerboseDriverInformation();
GLuint createProgram(const char *pVertexSource, const char *pFragmentSource);
GLuint loadShader(GLenum shaderType, const char *pSource);
void drawTrig(Trig &trig, const glm::mat4 &transform);
glm::mat4 projectionMatrix;
glm::mat4 viewMatrix;
GLuint vertexAttributePosition;
GLuint modelMatrixAttributePosition;
GLuint viewMatrixAttributePosition;
GLuint samplerUniformPosition;
GLuint textureCoordinatesAttributePosition;
GLuint projectionMatrixAttributePosition;
GLuint gProgram;
GLuint textureId;
int *textureData;
int textureWidth;
int textureHeight;
std::vector<Trig> mTrigs;
glm::vec3 camera;
public:
explicit GLES2Lesson();
~GLES2Lesson();
bool init(float w, float h, const std::string &vertexShader,
const std::string &fragmentShader);
void setTexture(int *bitmapData, int width, int height, int format);
void render();
void shutdown();
void tick();
void reset();
void addTrigs(std::vector<Trig> vector);
};
}
#endif //LESSON02_GLES2LESSON_H
| Make the constructor for the Lesson 10 explicit | Make the constructor for the Lesson 10 explicit
While this has little effect here, it's a good practice worth getting
used to. I still have to do the same with all the other classes.
| C | bsd-2-clause | TheFakeMontyOnTheRun/nehe-ndk-gles20,TheFakeMontyOnTheRun/nehe-ndk-gles20,TheFakeMontyOnTheRun/nehe-ndk-gles20 |
346e095d25d70cd81ece89e08a241b4f77ab9582 | src/file/keydb.h | src/file/keydb.h |
/* encrypted keys */
static const uint32_t internal_device_number = 0;
static const uint8_t internal_dk_list[][21] = {
{
},
};
static const uint8_t internal_pk_list[][16] = {
{
},
};
static const uint8_t internal_hc_list[][112] = {
{
},
};
/* customize this function to "hide" the keys in the binary */
static void decrypt_key(uint8_t *out, const uint8_t *in, size_t size)
{
memcpy(out, in, size);
}
|
/* encrypted keys */
static const uint32_t internal_device_number = 0;
static const uint8_t internal_dk_list[][21] = {
{ 0 },
};
static const uint8_t internal_pk_list[][16] = {
{ 0 },
};
static const uint8_t internal_hc_list[][112] = {
{ 0 },
};
/* customize this function to "hide" the keys in the binary */
static void decrypt_key(uint8_t *out, const uint8_t *in, size_t size)
{
memcpy(out, in, size);
}
| Fix MSVC error C2133 : unknown size of multi-dimensional static const arrays (despite supposed support of C99). Have not confirmed if this breaks anything yet. | Fix MSVC error C2133 : unknown size of multi-dimensional static const arrays (despite supposed support of C99). Have not confirmed if this breaks anything yet.
| C | lgpl-2.1 | mwgoldsmith/aacs,mwgoldsmith/aacs |
5d6e6d2e8f0edf69301bddd76ae3e0f651d037f1 | src/native/log.h | src/native/log.h | #include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "const.h"
extern void logop(int32_t, int32_t);
extern void dbg_trace(void);
#define dbg_log(...) { if(DEBUG) { printf(__VA_ARGS__); } }
#define dbg_assert(condition) { if(DEBUG) { if(!(condition)) dbg_log(#condition); assert(condition); } }
#define dbg_assert_message(condition, message) { if(DEBUG && !(condition)) { dbg_log(message); assert(false); } }
| #include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "const.h"
extern void logop(int32_t, int32_t);
extern void dbg_trace(void);
#define dbg_log(...) { if(DEBUG) { printf(__VA_ARGS__); } }
#define dbg_trace(...) { if(DEBUG) { dbg_trace(__VA_ARGS__); } }
#define dbg_assert(condition) { if(DEBUG) { if(!(condition)) dbg_log(#condition); assert(condition); } }
#define dbg_assert_message(condition, message) { if(DEBUG && !(condition)) { dbg_log(message); assert(false); } }
| Remove dbg_trace from non-debug builds | Remove dbg_trace from non-debug builds
| C | bsd-2-clause | copy/v86,copy/v86,copy/v86,copy/v86,copy/v86,copy/v86,copy/v86 |
57f0cb6232cef023a352bd120a328c520da9f211 | test2/inline/static_local.c | test2/inline/static_local.c | // RUN: %check %s
// extern
extern inline int f()
{
static int i;
return i++;
}
// static
static inline int h()
{
static int i;
return i++;
}
// neither
inline int g()
{
static int i; // CHECK: warning: static variable in pure-inline function - may differ per file
return i++;
}
// neither, but const
inline int g2()
{
static const int i = 3; // CHECK: !/warn/
return i;
}
main()
{
return f() + g() + h();
}
| // RUN: %check %s
// extern
extern inline int f()
{
static int i;
return i++;
}
// static
static inline int h()
{
static int i;
return i++;
}
// neither
inline int g()
{
static int i; // CHECK: warning: mutable static variable in pure-inline function - may differ per file
return i++;
}
// neither, but const
inline int g2()
{
static const int i = 3; // CHECK: !/warn/
return i;
}
main()
{
return f() + g() + h();
}
| Fix inline static local warning | Fix inline static local warning
| C | mit | bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler |
b05adaf03b8889da09568b8cf9f1f93d90445f30 | src/shared/log.h | src/shared/log.h | /*
* This file is part of buxton.
*
* Copyright (C) 2013 Intel Corporation
*
* buxton is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*/
#pragma once
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef DEBUG
#define buxton_debug(...) buxton_log(__VA_ARGS__)
#else
#define buxton_debug(...) do {} while(0);
#endif /* DEBUG */
void buxton_log(const char *fmt, ...);
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/
| /*
* This file is part of buxton.
*
* Copyright (C) 2013 Intel Corporation
*
* buxton is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*/
#pragma once
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef DEBUG
#define buxton_debug(...) do { \
buxton_log("%s():[%d]: %s", __func__, __LINE__ , __VA_ARGS__); \
} while(0);
#else
#define buxton_debug(...) do {} while(0);
#endif /* DEBUG */
void buxton_log(const char *fmt, ...);
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/
| Add line and function details to buxton_debug() | Add line and function details to buxton_debug()
| C | lgpl-2.1 | sofar/buxton,sofar/buxton |
40cb4828db633619fe71b721fa6440d26e0347bc | src/configuration.h | src/configuration.h | #ifndef QGC_CONFIGURATION_H
#define QGC_CONFIGURATION_H
#include <QString>
/** @brief Polling interval in ms */
#define SERIAL_POLL_INTERVAL 9
/** @brief Heartbeat emission rate, in Hertz (times per second) */
#define MAVLINK_HEARTBEAT_DEFAULT_RATE 1
#define WITH_TEXT_TO_SPEECH 1
#define QGC_APPLICATION_NAME "APM Planner"
#define QGC_APPLICATION_VERSION "v2.0.0 (beta)"
namespace QGC
{
const QString APPNAME = "APMPLANNER";
const QString COMPANYNAME = "3DROBOTICS";
const int APPLICATIONVERSION = 200; // 1.0.9
}
#endif // QGC_CONFIGURATION_H
| #ifndef QGC_CONFIGURATION_H
#define QGC_CONFIGURATION_H
#include <QString>
/** @brief Polling interval in ms */
#define SERIAL_POLL_INTERVAL 9
/** @brief Heartbeat emission rate, in Hertz (times per second) */
#define MAVLINK_HEARTBEAT_DEFAULT_RATE 1
#define WITH_TEXT_TO_SPEECH 1
#define QGC_APPLICATION_NAME "APM Planner"
#define QGC_APPLICATION_VERSION "v2.0.0 (beta)"
namespace QGC
{
const QString APPNAME = "APMPLANNER2";
const QString COMPANYNAME = "DIYDRONES";
const int APPLICATIONVERSION = 200; // 1.0.9
}
#endif // QGC_CONFIGURATION_H
| Change from 3drobotics to diydrones for COMPANYNAME | Change from 3drobotics to diydrones for COMPANYNAME
| C | agpl-3.0 | hejunbok/apm_planner,sutherlandm/apm_planner,LIKAIMO/apm_planner,sutherlandm/apm_planner,mirkix/apm_planner,abcdelf/apm_planner,xros/apm_planner,kellyschrock/apm_planner,kellyschrock/apm_planner,kellyschrock/apm_planner,kellyschrock/apm_planner,mirkix/apm_planner,diydrones/apm_planner,LittleBun/apm_planner,labtoast/apm_planner,LittleBun/apm_planner,gpaes/apm_planner,381426068/apm_planner,chen0510566/apm_planner,chen0510566/apm_planner,mrpilot2/apm_planner,abcdelf/apm_planner,gpaes/apm_planner,kellyschrock/apm_planner,abcdelf/apm_planner,xros/apm_planner,LittleBun/apm_planner,abcdelf/apm_planner,mirkix/apm_planner,LIKAIMO/apm_planner,xros/apm_planner,labtoast/apm_planner,gpaes/apm_planner,dcarpy/apm_planner,diydrones/apm_planner,mrpilot2/apm_planner,381426068/apm_planner,Icenowy/apm_planner,mirkix/apm_planner,LIKAIMO/apm_planner,WorkerBees/apm_planner,duststorm/apm_planner,abcdelf/apm_planner,duststorm/apm_planner,duststorm/apm_planner,sutherlandm/apm_planner,diydrones/apm_planner,dcarpy/apm_planner,LittleBun/apm_planner,labtoast/apm_planner,381426068/apm_planner,Icenowy/apm_planner,sutherlandm/apm_planner,chen0510566/apm_planner,duststorm/apm_planner,381426068/apm_planner,mrpilot2/apm_planner,hejunbok/apm_planner,LIKAIMO/apm_planner,chen0510566/apm_planner,Icenowy/apm_planner,kellyschrock/apm_planner,hejunbok/apm_planner,Icenowy/apm_planner,dcarpy/apm_planner,LittleBun/apm_planner,diydrones/apm_planner,dcarpy/apm_planner,sutherlandm/apm_planner,labtoast/apm_planner,mrpilot2/apm_planner,chen0510566/apm_planner,WorkerBees/apm_planner,hejunbok/apm_planner,duststorm/apm_planner,gpaes/apm_planner,381426068/apm_planner,xros/apm_planner,mirkix/apm_planner,hejunbok/apm_planner,WorkerBees/apm_planner,diydrones/apm_planner,mirkix/apm_planner,labtoast/apm_planner,mrpilot2/apm_planner,LIKAIMO/apm_planner,chen0510566/apm_planner,gpaes/apm_planner,abcdelf/apm_planner,Icenowy/apm_planner,dcarpy/apm_planner,381426068/apm_planner,hejunbok/apm_planner,sutherlandm/apm_planner,diydrones/apm_planner,mrpilot2/apm_planner,gpaes/apm_planner,LIKAIMO/apm_planner,xros/apm_planner,xros/apm_planner,Icenowy/apm_planner,LittleBun/apm_planner,duststorm/apm_planner,labtoast/apm_planner,dcarpy/apm_planner,WorkerBees/apm_planner |
8c968d0d3bcd83c42b056b290aae5aba9d229c1d | test/periodic/NdbRadioMult.h | test/periodic/NdbRadioMult.h | #ifndef RADIOMULT_H
#define RADIOMULT_H
#include "NdbMF.h"
/* ========= NdbRadioMult ============ */
class NdbRad ioMult : public NdbMF
{
protected:
public:
NdbRadioMult()
: NdbMF(9, "Multiplicities for radioactive nuclide production") {}
~NdbRadioMult() {}
ClassDef(NdbRadioMult,1)
}; // NdbRadioMult
#endif
| #ifndef RADIOMULT_H
#define RADIOMULT_H
#include "NdbMF.h"
/* ========= NdbRadioMult ============ */
class NdbRadioMult : public NdbMF
{
protected:
public:
NdbRadioMult()
: NdbMF(9, "Multiplicities for radioactive nuclide production") {}
~NdbRadioMult() {}
ClassDef(NdbRadioMult,1)
}; // NdbRadioMult
#endif
| Fix typo in tab removal | Fix typo in tab removal
| C | lgpl-2.1 | CristinaCristescu/root,dfunke/root,abhinavmoudgil95/root,beniz/root,abhinavmoudgil95/root,jrtomps/root,zzxuanyuan/root,mhuwiler/rootauto,nilqed/root,0x0all/ROOT,pspe/root,buuck/root,gbitzes/root,esakellari/root,BerserkerTroll/root,abhinavmoudgil95/root,mkret2/root,satyarth934/root,omazapa/root,CristinaCristescu/root,mattkretz/root,zzxuanyuan/root-compressor-dummy,Y--/root,zzxuanyuan/root,pspe/root,bbockelm/root,mkret2/root,pspe/root,pspe/root,olifre/root,buuck/root,Y--/root,bbockelm/root,mhuwiler/rootauto,root-mirror/root,dfunke/root,simonpf/root,CristinaCristescu/root,jrtomps/root,simonpf/root,omazapa/root-old,mattkretz/root,Y--/root,perovic/root,olifre/root,CristinaCristescu/root,pspe/root,esakellari/my_root_for_test,zzxuanyuan/root,pspe/root,mhuwiler/rootauto,zzxuanyuan/root-compressor-dummy,abhinavmoudgil95/root,evgeny-boger/root,jrtomps/root,sbinet/cxx-root,davidlt/root,abhinavmoudgil95/root,zzxuanyuan/root-compressor-dummy,Duraznos/root,root-mirror/root,nilqed/root,satyarth934/root,olifre/root,lgiommi/root,sawenzel/root,mkret2/root,jrtomps/root,karies/root,davidlt/root,evgeny-boger/root,georgtroska/root,karies/root,simonpf/root,karies/root,davidlt/root,jrtomps/root,agarciamontoro/root,veprbl/root,esakellari/root,krafczyk/root,bbockelm/root,Y--/root,gganis/root,krafczyk/root,georgtroska/root,krafczyk/root,vukasinmilosevic/root,smarinac/root,pspe/root,sawenzel/root,lgiommi/root,zzxuanyuan/root,thomaskeck/root,arch1tect0r/root,nilqed/root,satyarth934/root,jrtomps/root,0x0all/ROOT,dfunke/root,vukasinmilosevic/root,veprbl/root,perovic/root,lgiommi/root,omazapa/root-old,satyarth934/root,arch1tect0r/root,evgeny-boger/root,gbitzes/root,sawenzel/root,nilqed/root,simonpf/root,Y--/root,arch1tect0r/root,sawenzel/root,buuck/root,thomaskeck/root,smarinac/root,omazapa/root-old,perovic/root,gganis/root,agarciamontoro/root,bbockelm/root,esakellari/my_root_for_test,beniz/root,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root,georgtroska/root,CristinaCristescu/root,omazapa/root,sbinet/cxx-root,mattkretz/root,esakellari/my_root_for_test,mkret2/root,vukasinmilosevic/root,Y--/root,sawenzel/root,mhuwiler/rootauto,pspe/root,CristinaCristescu/root,karies/root,sirinath/root,jrtomps/root,gbitzes/root,mhuwiler/rootauto,sirinath/root,agarciamontoro/root,georgtroska/root,olifre/root,abhinavmoudgil95/root,zzxuanyuan/root,veprbl/root,abhinavmoudgil95/root,sawenzel/root,gbitzes/root,veprbl/root,evgeny-boger/root,root-mirror/root,sirinath/root,esakellari/my_root_for_test,perovic/root,gganis/root,simonpf/root,omazapa/root,arch1tect0r/root,olifre/root,omazapa/root-old,Duraznos/root,zzxuanyuan/root-compressor-dummy,beniz/root,georgtroska/root,zzxuanyuan/root,Y--/root,veprbl/root,lgiommi/root,satyarth934/root,buuck/root,simonpf/root,davidlt/root,pspe/root,perovic/root,thomaskeck/root,karies/root,omazapa/root,krafczyk/root,mattkretz/root,CristinaCristescu/root,BerserkerTroll/root,olifre/root,beniz/root,olifre/root,Y--/root,smarinac/root,krafczyk/root,jrtomps/root,sbinet/cxx-root,mattkretz/root,davidlt/root,dfunke/root,gganis/root,lgiommi/root,thomaskeck/root,krafczyk/root,mhuwiler/rootauto,Duraznos/root,gbitzes/root,dfunke/root,vukasinmilosevic/root,evgeny-boger/root,satyarth934/root,gganis/root,mhuwiler/rootauto,perovic/root,thomaskeck/root,thomaskeck/root,agarciamontoro/root,esakellari/root,evgeny-boger/root,davidlt/root,karies/root,beniz/root,mattkretz/root,dfunke/root,sirinath/root,vukasinmilosevic/root,0x0all/ROOT,zzxuanyuan/root,evgeny-boger/root,smarinac/root,vukasinmilosevic/root,esakellari/root,Duraznos/root,sbinet/cxx-root,CristinaCristescu/root,dfunke/root,sirinath/root,olifre/root,CristinaCristescu/root,omazapa/root-old,CristinaCristescu/root,mhuwiler/rootauto,smarinac/root,mhuwiler/rootauto,zzxuanyuan/root,abhinavmoudgil95/root,mkret2/root,esakellari/my_root_for_test,arch1tect0r/root,evgeny-boger/root,gbitzes/root,lgiommi/root,evgeny-boger/root,root-mirror/root,Duraznos/root,agarciamontoro/root,mkret2/root,bbockelm/root,agarciamontoro/root,sbinet/cxx-root,Duraznos/root,omazapa/root-old,satyarth934/root,mattkretz/root,0x0all/ROOT,omazapa/root,arch1tect0r/root,gganis/root,vukasinmilosevic/root,esakellari/root,mkret2/root,georgtroska/root,georgtroska/root,olifre/root,satyarth934/root,krafczyk/root,abhinavmoudgil95/root,0x0all/ROOT,buuck/root,Duraznos/root,mattkretz/root,Duraznos/root,krafczyk/root,arch1tect0r/root,agarciamontoro/root,root-mirror/root,omazapa/root-old,krafczyk/root,root-mirror/root,esakellari/root,omazapa/root,simonpf/root,0x0all/ROOT,dfunke/root,esakellari/my_root_for_test,bbockelm/root,esakellari/my_root_for_test,davidlt/root,olifre/root,beniz/root,agarciamontoro/root,esakellari/root,nilqed/root,davidlt/root,georgtroska/root,root-mirror/root,sawenzel/root,Y--/root,omazapa/root,sirinath/root,zzxuanyuan/root,mkret2/root,BerserkerTroll/root,bbockelm/root,beniz/root,perovic/root,evgeny-boger/root,BerserkerTroll/root,sbinet/cxx-root,veprbl/root,karies/root,krafczyk/root,arch1tect0r/root,mkret2/root,krafczyk/root,evgeny-boger/root,zzxuanyuan/root-compressor-dummy,agarciamontoro/root,simonpf/root,lgiommi/root,lgiommi/root,mattkretz/root,mhuwiler/rootauto,BerserkerTroll/root,root-mirror/root,satyarth934/root,davidlt/root,karies/root,sbinet/cxx-root,omazapa/root,vukasinmilosevic/root,sawenzel/root,bbockelm/root,BerserkerTroll/root,0x0all/ROOT,sawenzel/root,mattkretz/root,esakellari/root,satyarth934/root,omazapa/root,buuck/root,bbockelm/root,veprbl/root,gbitzes/root,root-mirror/root,sirinath/root,georgtroska/root,zzxuanyuan/root-compressor-dummy,omazapa/root-old,nilqed/root,esakellari/root,esakellari/my_root_for_test,nilqed/root,BerserkerTroll/root,esakellari/root,smarinac/root,karies/root,gbitzes/root,beniz/root,gganis/root,BerserkerTroll/root,smarinac/root,zzxuanyuan/root,dfunke/root,BerserkerTroll/root,gganis/root,buuck/root,BerserkerTroll/root,Duraznos/root,esakellari/root,sawenzel/root,nilqed/root,agarciamontoro/root,zzxuanyuan/root-compressor-dummy,nilqed/root,Duraznos/root,sirinath/root,mkret2/root,pspe/root,veprbl/root,beniz/root,Y--/root,pspe/root,sirinath/root,sirinath/root,dfunke/root,vukasinmilosevic/root,vukasinmilosevic/root,buuck/root,mattkretz/root,0x0all/ROOT,davidlt/root,karies/root,zzxuanyuan/root,perovic/root,beniz/root,Y--/root,gbitzes/root,gbitzes/root,gganis/root,jrtomps/root,BerserkerTroll/root,abhinavmoudgil95/root,sirinath/root,dfunke/root,thomaskeck/root,nilqed/root,sbinet/cxx-root,sbinet/cxx-root,sbinet/cxx-root,satyarth934/root,veprbl/root,sawenzel/root,mhuwiler/rootauto,davidlt/root,thomaskeck/root,zzxuanyuan/root-compressor-dummy,lgiommi/root,zzxuanyuan/root-compressor-dummy,simonpf/root,arch1tect0r/root,georgtroska/root,esakellari/my_root_for_test,veprbl/root,vukasinmilosevic/root,lgiommi/root,georgtroska/root,0x0all/ROOT,omazapa/root-old,omazapa/root-old,lgiommi/root,karies/root,buuck/root,Duraznos/root,smarinac/root,omazapa/root-old,nilqed/root,sbinet/cxx-root,esakellari/my_root_for_test,omazapa/root,CristinaCristescu/root,thomaskeck/root,gbitzes/root,omazapa/root,simonpf/root,bbockelm/root,veprbl/root,bbockelm/root,smarinac/root,agarciamontoro/root,olifre/root,perovic/root,arch1tect0r/root,beniz/root,jrtomps/root,buuck/root,abhinavmoudgil95/root,smarinac/root,simonpf/root,root-mirror/root,arch1tect0r/root,root-mirror/root,buuck/root,mkret2/root,perovic/root,perovic/root,gganis/root,zzxuanyuan/root-compressor-dummy,thomaskeck/root,gganis/root,jrtomps/root |
428dd80dfb94c20ce6a69138f32c9727b4490a14 | src/qt/modaloverlay.h | src/qt/modaloverlay.h | // Copyright (c) 2017 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_QT_MODALOVERLAY_H
#define BITCOIN_QT_MODALOVERLAY_H
#include <QDateTime>
#include <QWidget>
//! The required delta of headers to the estimated number of available headers until we show the IBD progress
static constexpr int HEADER_HEIGHT_SYNC_DELTA = 24;
namespace Ui
{
class ModalOverlay;
}
/** Modal overlay to display information about the chain-sync state */
class ModalOverlay : public QWidget
{
Q_OBJECT
public:
explicit ModalOverlay(QWidget *parent);
~ModalOverlay();
public Q_SLOTS:
void tipUpdate(int count, const QDateTime &blockDate, double nVerificationProgress);
void setKnownBestHeight(int count, const QDateTime &blockDate);
// will show or hide the modal layer
void showHide(bool hide = false, bool userRequested = false);
void closeClicked();
protected:
bool eventFilter(QObject *obj, QEvent *ev);
bool event(QEvent *ev);
private:
Ui::ModalOverlay *ui;
std::atomic<int> bestBlockHeight{0}; // best known height (based on the headers)
QVector<QPair<qint64, double> > blockProcessTime;
bool layerIsVisible;
bool userClosed;
};
#endif // BITCOIN_QT_MODALOVERLAY_H
| // Copyright (c) 2017 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_QT_MODALOVERLAY_H
#define BITCOIN_QT_MODALOVERLAY_H
#include <QDateTime>
#include <QWidget>
#include <atomic>
//! The required delta of headers to the estimated number of available headers until we show the IBD progress
static constexpr int HEADER_HEIGHT_SYNC_DELTA = 24;
namespace Ui
{
class ModalOverlay;
}
/** Modal overlay to display information about the chain-sync state */
class ModalOverlay : public QWidget
{
Q_OBJECT
public:
explicit ModalOverlay(QWidget *parent);
~ModalOverlay();
public Q_SLOTS:
void tipUpdate(int count, const QDateTime &blockDate, double nVerificationProgress);
void setKnownBestHeight(int count, const QDateTime &blockDate);
// will show or hide the modal layer
void showHide(bool hide = false, bool userRequested = false);
void closeClicked();
protected:
bool eventFilter(QObject *obj, QEvent *ev);
bool event(QEvent *ev);
private:
Ui::ModalOverlay *ui;
std::atomic<int> bestBlockHeight{0}; // best known height (based on the headers)
QVector<QPair<qint64, double> > blockProcessTime;
bool layerIsVisible;
bool userClosed;
};
#endif // BITCOIN_QT_MODALOVERLAY_H
| Add a missing atomic include | Add a missing atomic include
This prevent this error in Ubuntu xenial and trusty while compling bitcoin-qt:
In file included from qt/modaloverlay.cpp:5:0:
qt/modaloverlay.h:42:10: error: ‘atomic’ in namespace ‘std’ does not name a template type
std::atomic<int> bestBlockHeight{0}; // best known height (based on the headers)
^
| C | mit | BitcoinUnlimited/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited,BitcoinUnlimited/BitcoinUnlimited |
85c15fe657b4bc21a1e39f192e03bc06a759f15d | ipcrypt.h | ipcrypt.h |
#ifndef ipcrypt_H
#define ipcrypt_H
#define IPCRYPT_BYTES 4
#define IPCRYPT_KEYBYTES 16
int ipcrypt_encrypt(unsigned char out[IPCRYPT_BYTES],
const unsigned char in[IPCRYPT_BYTES],
const unsigned char key[IPCRYPT_KEYBYTES]);
int ipcrypt_decrypt(unsigned char out[IPCRYPT_BYTES],
const unsigned char in[IPCRYPT_BYTES],
const unsigned char key[IPCRYPT_KEYBYTES]);
#endif
|
#ifndef ipcrypt_H
#define ipcrypt_H
#define IPCRYPT_BYTES 4
#define IPCRYPT_KEYBYTES 16
#ifdef __cplusplus
extern "C" {
#endif
int ipcrypt_encrypt(unsigned char out[IPCRYPT_BYTES],
const unsigned char in[IPCRYPT_BYTES],
const unsigned char key[IPCRYPT_KEYBYTES]);
int ipcrypt_decrypt(unsigned char out[IPCRYPT_BYTES],
const unsigned char in[IPCRYPT_BYTES],
const unsigned char key[IPCRYPT_KEYBYTES]);
#ifdef __cplusplus
} /* End of the 'extern "C"' block */
#endif
#endif
| Make inclusion from C++ projects easier | Make inclusion from C++ projects easier
This code adds a conditional extern "C" statement - which most C libraries do as a courtesy for C++ users. | C | isc | jedisct1/c-ipcrypt |
1a6015e73fbbfef228b0aa91827a0ad2da3deba0 | vm/vm_internal.h | vm/vm_internal.h | #ifndef _INCLUDE_VM_INTERNAL_H
#define _INCLUDE_VM_INTERNAL_H
#include "vm.h"
#include "defs.h"
#include "heap.h"
typedef struct {
vm_value reg[num_regs];
int return_address;
int result_register;
//TODO type for this should be heap_address
int spilled_arguments; // Used for over-saturated calls.
} stack_frame ;
typedef struct {
stack_frame stack[stack_size];
int stack_pointer;
int program_pointer;
vm_value *const_table;
int const_table_length;
} vm_state;
#define current_frame (state->stack[state->stack_pointer])
#define next_frame (state->stack[state->stack_pointer + 1])
vm_value new_heap_string(char *content);
char *read_string(vm_state *state, vm_value string_value);
char *value_to_type_string(vm_value value);
#endif
| #ifndef _INCLUDE_VM_INTERNAL_H
#define _INCLUDE_VM_INTERNAL_H
#include "vm.h"
#include "defs.h"
#include "heap.h"
typedef struct {
vm_value reg[num_regs];
int return_address;
int result_register;
heap_address spilled_arguments; // Used for over-saturated calls.
} stack_frame ;
typedef struct {
stack_frame stack[stack_size];
int stack_pointer;
int program_pointer;
vm_value *const_table;
int const_table_length;
} vm_state;
#define current_frame (state->stack[state->stack_pointer])
#define next_frame (state->stack[state->stack_pointer + 1])
vm_value new_heap_string(char *content);
char *read_string(vm_state *state, vm_value string_value);
char *value_to_type_string(vm_value value);
#endif
| Fix type for spilled arguments | Fix type for spilled arguments
| C | mit | arne-schroppe/dash,arne-schroppe/dash |
ec108eb7dfc27271fe95608a8b8804ff573cb6e0 | src/win32/socket_win.c | src/win32/socket_win.c | /*
*The MIT License (MIT)
*
* Copyright (c) <2017> <Stephan Gatzka>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <stddef.h>
#include "compiler.h"
#include "socket.h"
cjet_ssize_t socket_read(socket_type sock, void *buf, size_t count)
{
return 0;
}
cjet_ssize_t socket_writev_with_prefix(socket_type sock, void *buf, size_t len, struct socket_io_vector *io_vec, unsigned int count)
{
return 0;
}
int socket_close(socket_type sock)
{
return 0;
}
enum cjet_system_error get_socket_error(void)
{
return 0;
}
const char *get_socket_error_msg(enum cjet_system_error err)
{
return "Hello";
} | Add stub for windows socket implementation. | Add stub for windows socket implementation.
| C | mit | gatzka/cjet,gatzka/cjet,mloy/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,mloy/cjet |
|
aaa0a5cd4e401bde4fb3691dd4e6c70a5c61e031 | include/version.h | include/version.h | /*
* Author: Brendan Le Foll <[email protected]>
* Copyright (c) 2014 Intel Corporation.
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
const char* gVERSION;
const char* gVERSION_SHORT;
#ifdef __cplusplus
}
#endif
| /*
* Author: Brendan Le Foll <[email protected]>
* Copyright (c) 2014 Intel Corporation.
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
extern const char* gVERSION;
extern const char* gVERSION_SHORT;
#ifdef __cplusplus
}
#endif
| Declare gVERSION global as 'extern'. | include: Declare gVERSION global as 'extern'.
Fixes build with '-fno-common'.
Signed-off-by: Thomas Ingleby <[email protected]>
| C | mit | g-vidal/mraa,g-vidal/mraa,g-vidal/mraa,g-vidal/mraa,g-vidal/mraa |
13d6d4e18d98f7c2d496f3454216d96a4d8e95d1 | WikipediaUnitTests/Code/FBSnapshotTestCase+WMFConvenience.h | WikipediaUnitTests/Code/FBSnapshotTestCase+WMFConvenience.h | #import <FBSnapshotTestCase/FBSnapshotTestCase.h>
#import "UIApplication+VisualTestUtils.h"
/**
* @function WMFSnapshotVerifyView
*
* Verify correct appearance of a given view.
*
* Search all folder suffixes, use default naming conventions.
*
* @param view The view to verify.
*/
#define WMFSnapshotVerifyView(view) FBSnapshotVerifyView((view), nil)
/**
* @function WMFSnapshotVerifyViewForOSAndWritingDirection
*
* Compares @c view with a reference image matching the current OS version & application writing direction (e.g.
* "[email protected]").
*
* @param view The view to verify.
*/
#define WMFSnapshotVerifyViewForOSAndWritingDirection(view) \
FBSnapshotVerifyView((view), [[UIApplication sharedApplication] wmf_systemVersionAndWritingDirection]);
@interface FBSnapshotTestCase (WMFConvenience)
- (void)wmf_verifyMultilineLabelWithText:(id)stringOrAttributedString width:(CGFloat)width;
- (void)wmf_verifyCellWithIdentifier:(NSString *)identifier
fromTableView:(UITableView *)tableView
width:(CGFloat)width
configuredWithBlock:(void (^)(UITableViewCell *))block;
- (void)wmf_verifyView:(UIView *)view width:(CGFloat)width;
- (void)wmf_verifyViewAtWindowWidth:(UIView *)view;
@end
| #import <FBSnapshotTestCase/FBSnapshotTestCase.h>
#import "UIApplication+VisualTestUtils.h"
/**
* @function WMFSnapshotVerifyView
*
* Verify correct appearance of a given view.
*
* Search all folder suffixes, use default naming conventions.
*
* @param view The view to verify.
*/
#define WMFSnapshotVerifyView(view) FBSnapshotVerifyView((view), nil)
/**
* @function WMFSnapshotVerifyViewForOSAndWritingDirection
*
* Compares @c view with a reference image matching the current OS version & application writing direction (e.g.
* "[email protected]").
*
* @param view The view to verify.
*/
#define WMFSnapshotVerifyViewForOSAndWritingDirection(view) \
FBSnapshotVerifyViewWithOptions((view), [[UIApplication sharedApplication] wmf_systemVersionAndWritingDirection], FBSnapshotTestCaseDefaultSuffixes(), 0.1);
@interface FBSnapshotTestCase (WMFConvenience)
- (void)wmf_verifyMultilineLabelWithText:(id)stringOrAttributedString width:(CGFloat)width;
- (void)wmf_verifyCellWithIdentifier:(NSString *)identifier
fromTableView:(UITableView *)tableView
width:(CGFloat)width
configuredWithBlock:(void (^)(UITableViewCell *))block;
- (void)wmf_verifyView:(UIView *)view width:(CGFloat)width;
- (void)wmf_verifyViewAtWindowWidth:(UIView *)view;
@end
| Add slight tolerance for image differences to visual test macro. | Add slight tolerance for image differences to visual test macro.
| C | mit | wikimedia/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,josve05a/wikipedia-ios,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios |
1b91e278ae59e4f4f1f6a8fe37bd20e527a4975e | Analytics/Integrations/GoogleAnalytics/SEGGoogleAnalyticsIntegration.h | Analytics/Integrations/GoogleAnalytics/SEGGoogleAnalyticsIntegration.h | // GoogleAnalyticsIntegration.h
// Copyright (c) 2014 Segment.io. All rights reserved.
#import <Foundation/Foundation.h>
#import "SEGAnalyticsIntegration.h"
@interface SEGGoogleAnalyticsIntegration : SEGAnalyticsIntegration
@property(nonatomic, copy) NSString *name;
@property(nonatomic, assign) BOOL valid;
@property(nonatomic, assign) BOOL initialized;
@property(nonatomic, copy) NSDictionary *settings;
@end
| // GoogleAnalyticsIntegration.h
// Copyright (c) 2014 Segment.io. All rights reserved.
#import <Foundation/Foundation.h>
#import "SEGAnalyticsIntegration.h"
#import "SEGEcommerce.h"
@interface SEGGoogleAnalyticsIntegration : SEGAnalyticsIntegration <SEGEcommerce>
@property(nonatomic, copy) NSString *name;
@property(nonatomic, assign) BOOL valid;
@property(nonatomic, assign) BOOL initialized;
@property(nonatomic, copy) NSDictionary *settings;
@end
| Add ecommerce protocol to ga | Add ecommerce protocol to ga
| C | mit | jtomson-mdsol/analytics-ios,jtomson-mdsol/analytics-ios,rudywen/analytics-ios,dbachrach/analytics-ios,graingert/analytics-ios,jonathannorris/analytics-ios,orta/analytics-ios,segmentio/analytics-ios,operator/analytics-ios,graingert/analytics-ios,djfink-carglass/analytics-ios,jonathannorris/analytics-ios,jlandon/analytics-ios,orta/analytics-ios,operator/analytics-ios,orta/analytics-ios,string-team/analytics-ios,segmentio/analytics-ios,operator/analytics-ios,lumoslabs/analytics-ios,lumoslabs/analytics-ios,jtomson-mdsol/analytics-ios,dcaunt/analytics-ios,graingert/analytics-ios,cfraz89/analytics-ios,jlandon/analytics-ios,abodo-dev/analytics-ios,abodo-dev/analytics-ios,hzalaz/analytics-ios,ldiqual/analytics-ios,cfraz89/analytics-ios,dbachrach/analytics-ios,rudywen/analytics-ios,jlandon/analytics-ios,djfink-carglass/analytics-ios,hzalaz/analytics-ios,abodo-dev/analytics-ios,vinod1988/analytics-ios,lumoslabs/analytics-ios,dbachrach/analytics-ios,dcaunt/analytics-ios,djfink-carglass/analytics-ios,cfraz89/analytics-ios,string-team/analytics-ios,vinod1988/analytics-ios,dcaunt/analytics-ios,jonathannorris/analytics-ios,segmentio/analytics-ios,ldiqual/analytics-ios,string-team/analytics-ios,hzalaz/analytics-ios,vinod1988/analytics-ios,ldiqual/analytics-ios,segmentio/analytics-ios,rudywen/analytics-ios |
bafe09faaffee154ccc9225bacb526517e555882 | process.h | process.h | //
// process.h
// Project3
//
// Created by Stratton Aguilar on 7/3/14.
// Copyright (c) 2014 Stratton Aguilar. All rights reserved.
//
#ifndef Project3_process_h
#define Project3_process_h
typedef struct {
int processNum;
int arrivalTime;
int lifeTime;
int memReq;
} PROCESS;
#endif
| //
// process.h
// Project3
//
// Created by Stratton Aguilar on 7/3/14.
// Copyright (c) 2014 Stratton Aguilar. All rights reserved.
//
#ifndef Project3_process_h
#define Project3_process_h
typedef struct {
int processNum;
int arrivalTime;
int lifeTime;
int memReq;
int time_left;
int is_active;
} PROCESS;
#endif
| Add time_left and is_active to the proc struct | Add time_left and is_active to the proc struct
| C | mit | ciarand/operating-systems-memory-management-assignment |
f0daba127006281d2ff843f88a7e93928e336350 | src/greuh_liberation.Default/meta/classnames/support/ammobox_nato_pacific.h | src/greuh_liberation.Default/meta/classnames/support/ammobox_nato_pacific.h | ["Box_T_NATO_Wps_F",5,0,0],
["Box_T_NATO_WpsSpecial_F",5,0,0], | ["Box_T_NATO_Wps_F",0,0,0],
["Box_T_NATO_WpsSpecial_F",0,0,0], | Remove cost from empty ammoboxes till they can be recycled | Remove cost from empty ammoboxes till they can be recycled
| C | mit | fparma/liberation,fparma/liberation,fparma/liberation |
1776b4704a26b3cf388e66e2e9f945dde1ba57cb | src/clock_posix.c | src/clock_posix.c | #include <time.h>
#include "clock.h"
#include "clock_type.h"
extern int clock_init(struct SPDR_Clock **clockp, struct SPDR_Allocator *allocator)
{
struct timespec res;
if (clock_getres(CLOCK_MONOTONIC, &res) != 0 || res.tv_nsec > 1000) {
/* unknown clock or insufficient resolution */
return -1;
}
return clock_init_base(clockp, allocator, 1, 1000);
}
extern uint64_t clock_ticks(struct SPDR_Clock const *const clock)
{
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
(void)clock;
return ts.tv_sec * 1000000000LL + ts.tv_nsec;
}
| #include <time.h>
#include "clock.h"
#include "clock_type.h"
extern int clock_init(struct SPDR_Clock **clockp,
struct SPDR_Allocator *allocator)
{
struct timespec res;
if (clock_getres(CLOCK_MONOTONIC, &res) != 0 || res.tv_nsec > 1000) {
/* unknown clock or insufficient resolution */
return -1;
}
return clock_init_base(clockp, allocator, 1, 1000);
}
extern uint64_t clock_ticks(struct SPDR_Clock const *const clock)
{
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
(void)clock;
return ts.tv_sec * 1000000000LL + ts.tv_nsec;
}
| Fix signature of clock_init for posix | Fix signature of clock_init for posix
| C | mit | uucidl/uu.spdr,uucidl/uu.spdr,uucidl/uu.spdr |
0f4982691eaf60f6b23e9f7d02c63ee3b9cb0460 | xlat.h | xlat.h | #ifndef STRACE_XLAT_H
struct xlat {
unsigned int val;
const char *str;
};
# define XLAT(val) { (unsigned)(val), #val }
# define XLAT_PAIR(val, str) { (unsigned)(val), str }
# define XLAT_END { 0, 0 }
#endif
| #ifndef STRACE_XLAT_H
struct xlat {
unsigned int val;
const char *str;
};
# define XLAT(val) { (unsigned)(val), #val }
# define XLAT_PAIR(val, str) { (unsigned)(val), str }
# define XLAT_TYPE(type, val) { (type)(val), #val }
# define XLAT_TYPE_PAIR(val, str) { (type)(val), str }
# define XLAT_END { 0, 0 }
#endif
| Introduce XLAT_TYPE and XLAT_TYPE_PAIR macros | Introduce XLAT_TYPE and XLAT_TYPE_PAIR macros
* xlat.h (XLAT_TYPE): New macro, similar to XLAT but casts
to the specified type instead of unsigned int.
(XLAT_TYPE_PAIR): New macro, similar to XLAT_PAIR but casts
to the specified type instead of unsigned int.
| C | bsd-3-clause | Saruta/strace,Saruta/strace,cuviper/strace,Saruta/strace,Saruta/strace,cuviper/strace,Saruta/strace,cuviper/strace,cuviper/strace,cuviper/strace |
37656881f6360da03ecf7c4cbcc51f7a0eae883c | Sensorama/Sensorama/SRDataModel.h | Sensorama/Sensorama/SRDataModel.h | //
// SRDataModel.h
// Sensorama
//
// Created by Wojciech Adam Koszek (h) on 19/04/2016.
// Copyright © 2016 Wojciech Adam Koszek. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Realm/Realm.h"
@interface SRDataPoint : RLMObject
@property NSNumber<RLMInt> *accX;
@property NSNumber<RLMInt> *accY;
@property NSNumber<RLMInt> *accZ;
@property NSNumber<RLMInt> *magX;
@property NSNumber<RLMInt> *magY;
@property NSNumber<RLMInt> *magZ;
@property NSNumber<RLMInt> *gyroX;
@property NSNumber<RLMInt> *gyroY;
@property NSNumber<RLMInt> *gyroZ;
@property NSInteger fileId;
@property NSInteger curTime;
@end
@interface SRDataFile : RLMObject
@property NSString *username;
@property NSString *desc;
@property NSString *timezone;
/* need to do something about device_info */
@property NSInteger sampleInterval;
@property BOOL accEnabled;
@property BOOL magEnabled;
@property BOOL gyroEnabled;
@property NSDate *dateStart;
@property NSDate *dateEnd;
@property NSInteger fileId;
@end | //
// SRDataModel.h
// Sensorama
//
// Created by Wojciech Adam Koszek (h) on 19/04/2016.
// Copyright © 2016 Wojciech Adam Koszek. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Realm/Realm.h"
@interface SRDataPoint : RLMObject
@property NSNumber<RLMInt> *accX;
@property NSNumber<RLMInt> *accY;
@property NSNumber<RLMInt> *accZ;
@property NSNumber<RLMInt> *magX;
@property NSNumber<RLMInt> *magY;
@property NSNumber<RLMInt> *magZ;
@property NSNumber<RLMInt> *gyroX;
@property NSNumber<RLMInt> *gyroY;
@property NSNumber<RLMInt> *gyroZ;
@property NSInteger fileId;
@property NSInteger curTime;
@end
RLM_ARRAY_TYPE(SRDataPoint)
@interface SRDataFile : RLMObject
@property NSString *username;
@property NSString *desc;
@property NSString *timezone;
/* need to do something about device_info */
@property NSInteger sampleInterval;
@property BOOL accEnabled;
@property BOOL magEnabled;
@property BOOL gyroEnabled;
@property NSDate *dateStart;
@property NSDate *dateEnd;
@property NSInteger fileId;
@property RLMArray<SRDataPoint> *dataPoints;
@end
RLM_ARRAY_TYPE(SRDataFile) | Add arrays to the data model. | Add arrays to the data model.
| C | bsd-2-clause | wkoszek/sensorama-ios,wkoszek/sensorama-ios,wkoszek/sensorama-ios,wkoszek/sensorama-ios |
fa8de09edc9ec4e6d171df80f746174a0ec58afb | src/util/result.h | src/util/result.h | // Copyright (c) 2022 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or https://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_UTIL_RESULT_H
#define BITCOIN_UTIL_RESULT_H
#include <util/translation.h>
#include <variant>
/*
* 'BResult' is a generic class useful for wrapping a return object
* (in case of success) or propagating the error cause.
*/
template<class T>
class BResult {
private:
std::variant<bilingual_str, T> m_variant;
public:
BResult() : m_variant(Untranslated("")) {}
BResult(const T& _obj) : m_variant(_obj) {}
BResult(const bilingual_str& error) : m_variant(error) {}
/* Whether the function succeeded or not */
bool HasRes() const { return std::holds_alternative<T>(m_variant); }
/* In case of success, the result object */
const T& GetObj() const {
assert(HasRes());
return std::get<T>(m_variant);
}
/* In case of failure, the error cause */
const bilingual_str& GetError() const {
assert(!HasRes());
return std::get<bilingual_str>(m_variant);
}
explicit operator bool() const { return HasRes(); }
};
#endif // BITCOIN_UTIL_RESULT_H
| // Copyright (c) 2022 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or https://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_UTIL_RESULT_H
#define BITCOIN_UTIL_RESULT_H
#include <util/translation.h>
#include <variant>
/*
* 'BResult' is a generic class useful for wrapping a return object
* (in case of success) or propagating the error cause.
*/
template<class T>
class BResult {
private:
std::variant<bilingual_str, T> m_variant;
public:
BResult() : m_variant{Untranslated("")} {}
BResult(T obj) : m_variant{std::move(obj)} {}
BResult(bilingual_str error) : m_variant{std::move(error)} {}
/* Whether the function succeeded or not */
bool HasRes() const { return std::holds_alternative<T>(m_variant); }
/* In case of success, the result object */
const T& GetObj() const {
assert(HasRes());
return std::get<T>(m_variant);
}
T ReleaseObj()
{
assert(HasRes());
return std::move(std::get<T>(m_variant));
}
/* In case of failure, the error cause */
const bilingual_str& GetError() const {
assert(!HasRes());
return std::get<bilingual_str>(m_variant);
}
explicit operator bool() const { return HasRes(); }
};
#endif // BITCOIN_UTIL_RESULT_H
| Prepare BResult for non-copyable types | Prepare BResult for non-copyable types
| C | mit | fujicoin/fujicoin,lateminer/bitcoin,lateminer/bitcoin,jamesob/bitcoin,namecoin/namecore,lateminer/bitcoin,kallewoof/bitcoin,fujicoin/fujicoin,AkioNak/bitcoin,mruddy/bitcoin,jamesob/bitcoin,ajtowns/bitcoin,bitcoin/bitcoin,fanquake/bitcoin,sipsorcery/bitcoin,ajtowns/bitcoin,namecoin/namecoin-core,fujicoin/fujicoin,particl/particl-core,tecnovert/particl-core,tecnovert/particl-core,mruddy/bitcoin,jambolo/bitcoin,kallewoof/bitcoin,tecnovert/particl-core,kallewoof/bitcoin,fanquake/bitcoin,jamesob/bitcoin,bitcoin/bitcoin,ajtowns/bitcoin,bitcoinsSG/bitcoin,mruddy/bitcoin,jamesob/bitcoin,fujicoin/fujicoin,sipsorcery/bitcoin,bitcoinsSG/bitcoin,particl/particl-core,bitcoin/bitcoin,sstone/bitcoin,fanquake/bitcoin,Xekyo/bitcoin,AkioNak/bitcoin,sstone/bitcoin,namecoin/namecoin-core,Xekyo/bitcoin,fanquake/bitcoin,namecoin/namecoin-core,jambolo/bitcoin,bitcoinsSG/bitcoin,mruddy/bitcoin,mruddy/bitcoin,tecnovert/particl-core,AkioNak/bitcoin,lateminer/bitcoin,AkioNak/bitcoin,sipsorcery/bitcoin,namecoin/namecore,bitcoinsSG/bitcoin,kallewoof/bitcoin,sstone/bitcoin,namecoin/namecore,fanquake/bitcoin,namecoin/namecoin-core,namecoin/namecoin-core,sipsorcery/bitcoin,fujicoin/fujicoin,kallewoof/bitcoin,ajtowns/bitcoin,sipsorcery/bitcoin,fanquake/bitcoin,particl/particl-core,Xekyo/bitcoin,Xekyo/bitcoin,sipsorcery/bitcoin,namecoin/namecore,particl/particl-core,lateminer/bitcoin,sstone/bitcoin,namecoin/namecore,jambolo/bitcoin,bitcoin/bitcoin,bitcoinsSG/bitcoin,jamesob/bitcoin,sstone/bitcoin,namecoin/namecoin-core,namecoin/namecore,Xekyo/bitcoin,bitcoinsSG/bitcoin,kallewoof/bitcoin,jambolo/bitcoin,jambolo/bitcoin,jamesob/bitcoin,mruddy/bitcoin,fujicoin/fujicoin,jambolo/bitcoin,ajtowns/bitcoin,tecnovert/particl-core,lateminer/bitcoin,particl/particl-core,AkioNak/bitcoin,AkioNak/bitcoin,tecnovert/particl-core,bitcoin/bitcoin,bitcoin/bitcoin,sstone/bitcoin,particl/particl-core,ajtowns/bitcoin,Xekyo/bitcoin |
2788f282bbd2e945c1e77c94bc45b8ece5f9b4db | src/Subtitles/paletteinfo.h | src/Subtitles/paletteinfo.h | /*
* BDSup2Sub++ (C) 2012 Adam T.
* Based on code from BDSup2Sub by Copyright 2009 Volker Oth (0xdeadbeef)
* and Copyright 2012 Miklos Juhasz (mjuhasz)
*
*
* 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 PALETTEINFO_H
#define PALETTEINFO_H
class PaletteInfo
{
public:
PaletteInfo();
PaletteInfo(const PaletteInfo* other);
PaletteInfo(const PaletteInfo& other);
int paletteOffset() { return offset; }
void setPaletteOffset(int paletteOffset) { offset = paletteOffset; }
int paletteSize() { return size; }
void setPaletteSize(int paletteSize) { size = paletteSize; }
private:
int offset = 0;
int size = 0;
};
#endif // PALETTEINFO_H
| /*
* BDSup2Sub++ (C) 2012 Adam T.
* Based on code from BDSup2Sub by Copyright 2009 Volker Oth (0xdeadbeef)
* and Copyright 2012 Miklos Juhasz (mjuhasz)
*
*
* 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 PALETTEINFO_H
#define PALETTEINFO_H
class PaletteInfo
{
public:
PaletteInfo();
PaletteInfo(const PaletteInfo* other);
PaletteInfo(const PaletteInfo& other);
int paletteOffset() { return offset; }
void setPaletteOffset(int paletteOffset) { offset = paletteOffset; }
int paletteSize() { return size; }
void setPaletteSize(int paletteSize) { size = paletteSize; }
private:
int offset = -1;
int size = -1;
};
#endif // PALETTEINFO_H
| Change default values to -1. | Change default values to -1.
| C | apache-2.0 | darealshinji/BDSup2SubPlusPlus,amichaelt/BDSup2SubPlusPlus,amichaelt/BDSup2SubPlusPlus,darealshinji/BDSup2SubPlusPlus |
261c3596a30b92539109894541f17d5f6b7c985a | IntelFrameworkModulePkg/Include/Guid/IntelFrameworkModulePkgTokenSpace.h | IntelFrameworkModulePkg/Include/Guid/IntelFrameworkModulePkgTokenSpace.h | /** @file
GUID for IntelFrameworkModulePkg PCD Token Space
Copyright (c) 2009, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _INTEL_FRAMEWOKR_MODULEPKG_TOKEN_SPACE_GUID_H_
#define _INTEL_FRAMEWOKR_MODULEPKG_TOKEN_SPACE_GUID_H_
#define INTEL_FRAMEWORK_MODULEPKG_TOKEN_SPACE_GUID \
{ \
0x914AEBE7, 0x4635, 0x459b, { 0xAA, 0x1C, 0x11, 0xE2, 0x19, 0xB0, 0x3A, 0x10 } \
}
extern EFI_GUID gEfiIntelFrameworkModulePkgTokenSpaceGuid;
#endif
| Add the missing Token Space Guid | Add the missing Token Space Guid
git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@8500 6f19259b-4bc3-4df7-8a09-765794883524
| C | bsd-2-clause | MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2 |
|
f94c619e73b934b8f32edf303cc8998670f7cc64 | chrome/common/all_messages.h | chrome/common/all_messages.h | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Multiply-included file, hence no include guard.
// Inclusion of all message files present in the system. Keep this file
// up-to-date when adding a new value to enum IPCMessageStart in
// ipc/ipc_message_utils.h to include the corresponding message file.
#include "chrome/browser/importer/profile_import_process_messages.h"
#include "chrome/common/automation_messages.h"
#include "chrome/common/common_message_generator.h"
#include "chrome/common/nacl_messages.h"
#include "content/common/content_message_generator.h"
#include "ppapi/proxy/ppapi_messages.h"
| // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Multiply-included file, hence no include guard.
// Inclusion of all message files present in the system. Keep this file
// up-to-date when adding a new value to enum IPCMessageStart in
// ipc/ipc_message_utils.h to include the corresponding message file.
#include "chrome/browser/importer/profile_import_process_messages.h"
#include "chrome/common/common_message_generator.h"
#include "chrome/common/nacl_messages.h"
#include "content/common/content_message_generator.h"
#include "content/common/pepper_messages.h"
#include "ppapi/proxy/ppapi_messages.h"
| Fix build break from bad merge | Fix build break from bad merge
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@106741 0039d316-1c4b-4281-b951-d872f2087c98
| C | bsd-3-clause | hujiajie/pa-chromium,timopulkkinen/BubbleFish,dushu1203/chromium.src,dushu1203/chromium.src,robclark/chromium,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,keishi/chromium,littlstar/chromium.src,ondra-novak/chromium.src,junmin-zhu/chromium-rivertrail,bright-sparks/chromium-spacewalk,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,dushu1203/chromium.src,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,Fireblend/chromium-crosswalk,hujiajie/pa-chromium,anirudhSK/chromium,Chilledheart/chromium,timopulkkinen/BubbleFish,Chilledheart/chromium,dednal/chromium.src,ondra-novak/chromium.src,keishi/chromium,markYoungH/chromium.src,dushu1203/chromium.src,crosswalk-project/chromium-crosswalk-efl,Jonekee/chromium.src,nacl-webkit/chrome_deps,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,ChromiumWebApps/chromium,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ltilve/chromium,nacl-webkit/chrome_deps,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,zcbenz/cefode-chromium,markYoungH/chromium.src,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,zcbenz/cefode-chromium,Pluto-tv/chromium-crosswalk,junmin-zhu/chromium-rivertrail,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,fujunwei/chromium-crosswalk,ondra-novak/chromium.src,nacl-webkit/chrome_deps,littlstar/chromium.src,mogoweb/chromium-crosswalk,dednal/chromium.src,chuan9/chromium-crosswalk,ltilve/chromium,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,pozdnyakov/chromium-crosswalk,keishi/chromium,Fireblend/chromium-crosswalk,ltilve/chromium,markYoungH/chromium.src,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,Jonekee/chromium.src,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,nacl-webkit/chrome_deps,patrickm/chromium.src,anirudhSK/chromium,dushu1203/chromium.src,anirudhSK/chromium,ondra-novak/chromium.src,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,anirudhSK/chromium,chuan9/chromium-crosswalk,zcbenz/cefode-chromium,keishi/chromium,ChromiumWebApps/chromium,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,zcbenz/cefode-chromium,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,hujiajie/pa-chromium,markYoungH/chromium.src,keishi/chromium,junmin-zhu/chromium-rivertrail,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,patrickm/chromium.src,junmin-zhu/chromium-rivertrail,mogoweb/chromium-crosswalk,dednal/chromium.src,robclark/chromium,Just-D/chromium-1,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,zcbenz/cefode-chromium,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,keishi/chromium,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,TheTypoMaster/chromium-crosswalk,keishi/chromium,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,M4sse/chromium.src,dednal/chromium.src,M4sse/chromium.src,chuan9/chromium-crosswalk,robclark/chromium,anirudhSK/chromium,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,hgl888/chromium-crosswalk,dushu1203/chromium.src,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,junmin-zhu/chromium-rivertrail,Just-D/chromium-1,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,timopulkkinen/BubbleFish,zcbenz/cefode-chromium,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,dednal/chromium.src,dednal/chromium.src,Fireblend/chromium-crosswalk,timopulkkinen/BubbleFish,keishi/chromium,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,chuan9/chromium-crosswalk,M4sse/chromium.src,bright-sparks/chromium-spacewalk,robclark/chromium,timopulkkinen/BubbleFish,dednal/chromium.src,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,Fireblend/chromium-crosswalk,hujiajie/pa-chromium,rogerwang/chromium,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,nacl-webkit/chrome_deps,markYoungH/chromium.src,dednal/chromium.src,zcbenz/cefode-chromium,anirudhSK/chromium,hujiajie/pa-chromium,Jonekee/chromium.src,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,ondra-novak/chromium.src,nacl-webkit/chrome_deps,robclark/chromium,ChromiumWebApps/chromium,ondra-novak/chromium.src,hujiajie/pa-chromium,keishi/chromium,pozdnyakov/chromium-crosswalk,axinging/chromium-crosswalk,rogerwang/chromium,junmin-zhu/chromium-rivertrail,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,rogerwang/chromium,zcbenz/cefode-chromium,littlstar/chromium.src,pozdnyakov/chromium-crosswalk,pozdnyakov/chromium-crosswalk,anirudhSK/chromium,littlstar/chromium.src,jaruba/chromium.src,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,patrickm/chromium.src,rogerwang/chromium,robclark/chromium,M4sse/chromium.src,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,ChromiumWebApps/chromium,keishi/chromium,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,jaruba/chromium.src,bright-sparks/chromium-spacewalk,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,ltilve/chromium,markYoungH/chromium.src,anirudhSK/chromium,ChromiumWebApps/chromium,ltilve/chromium,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,robclark/chromium,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,mogoweb/chromium-crosswalk,markYoungH/chromium.src,zcbenz/cefode-chromium,hujiajie/pa-chromium,jaruba/chromium.src,hujiajie/pa-chromium,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,ltilve/chromium,Just-D/chromium-1,axinging/chromium-crosswalk,ltilve/chromium,pozdnyakov/chromium-crosswalk,krieger-od/nwjs_chromium.src,mogoweb/chromium-crosswalk,Fireblend/chromium-crosswalk,patrickm/chromium.src,Jonekee/chromium.src,rogerwang/chromium,hujiajie/pa-chromium,jaruba/chromium.src,M4sse/chromium.src,Fireblend/chromium-crosswalk,keishi/chromium,ChromiumWebApps/chromium,ltilve/chromium,anirudhSK/chromium,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,patrickm/chromium.src,rogerwang/chromium,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,Chilledheart/chromium,Just-D/chromium-1,dednal/chromium.src,patrickm/chromium.src,Chilledheart/chromium,littlstar/chromium.src,chuan9/chromium-crosswalk,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,Just-D/chromium-1,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,jaruba/chromium.src,bright-sparks/chromium-spacewalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,rogerwang/chromium,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,junmin-zhu/chromium-rivertrail,markYoungH/chromium.src,M4sse/chromium.src,jaruba/chromium.src,chuan9/chromium-crosswalk,rogerwang/chromium,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,dushu1203/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk,robclark/chromium,Chilledheart/chromium,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,rogerwang/chromium,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,robclark/chromium,crosswalk-project/chromium-crosswalk-efl,rogerwang/chromium,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,mogoweb/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,nacl-webkit/chrome_deps,PeterWangIntel/chromium-crosswalk,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,junmin-zhu/chromium-rivertrail,robclark/chromium,M4sse/chromium.src,dushu1203/chromium.src,mogoweb/chromium-crosswalk,mogoweb/chromium-crosswalk,markYoungH/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,patrickm/chromium.src,Jonekee/chromium.src,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,littlstar/chromium.src,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src |
2c5ea3c7a451cf4c0e4612be05ed67bdf6ae86e6 | src/main/c/src/DeviceList.c | src/main/c/src/DeviceList.c | /*
* Copyright (C) 2013 Klaus Reimer ([email protected])
* See COPYING file for copying conditions
*/
#include "DeviceList.h"
#include "Device.h"
void setDeviceList(JNIEnv* env, libusb_device** list, int size, jobject object)
{
SET_POINTER(env, list, object, "deviceListPointer");
jclass cls = (*env)->GetObjectClass(env, object);
jfieldID field = (*env)->GetFieldID(env, cls, "size", "I");
(*env)->SetIntField(env, object, field, size);
}
libusb_device** unwrapDeviceList(JNIEnv* env, jobject list)
{
UNWRAP_POINTER(env, list, libusb_device**, "deviceListPointer");
}
void resetDeviceList(JNIEnv* env, jobject obj)
{
RESET_POINTER(env, obj, "deviceListPointer");
}
/**
* Device get(index)
*/
JNIEXPORT jobject JNICALL METHOD_NAME(DeviceList, get)
(
JNIEnv *env, jobject this, jint index
)
{
jclass cls = (*env)->GetObjectClass(env, this);
jfieldID field = (*env)->GetFieldID(env, cls, "size", "I");
int size = (*env)->GetIntField(env, this, field);
if (index < 0 || index >= size) return NULL;
return wrapDevice(env, unwrapDeviceList(env, this)[index]);
}
| /*
* Copyright (C) 2013 Klaus Reimer ([email protected])
* See COPYING file for copying conditions
*/
#include "DeviceList.h"
#include "Device.h"
void setDeviceList(JNIEnv* env, libusb_device** list, int size, jobject object)
{
SET_POINTER(env, list, object, "deviceListPointer");
jclass cls = (*env)->GetObjectClass(env, object);
jfieldID field = (*env)->GetFieldID(env, cls, "size", "I");
(*env)->SetIntField(env, object, field, size);
}
libusb_device** unwrapDeviceList(JNIEnv* env, jobject list)
{
UNWRAP_POINTER(env, list, libusb_device**, "deviceListPointer");
}
void resetDeviceList(JNIEnv* env, jobject obj)
{
RESET_POINTER(env, obj, "deviceListPointer");
// Reset size to zero too.
jclass cls = (*env)->GetObjectClass(env, obj);
jfieldID field = (*env)->GetFieldID(env, cls, "size", "I");
(*env)->SetIntField(env, object, field, 0);
}
/**
* Device get(index)
*/
JNIEXPORT jobject JNICALL METHOD_NAME(DeviceList, get)
(
JNIEnv *env, jobject this, jint index
)
{
jclass cls = (*env)->GetObjectClass(env, this);
jfieldID field = (*env)->GetFieldID(env, cls, "size", "I");
int size = (*env)->GetIntField(env, this, field);
if (index < 0 || index >= size) return NULL;
return wrapDevice(env, unwrapDeviceList(env, this)[index]);
}
| Set size to zero on reset. Else getting the size is incorrect, and later when checking in get() it would pass the check and you'd access a NULL ptr. | Set size to zero on reset. Else getting the size is incorrect, and later when checking in get() it would pass the check and you'd access a NULL ptr.
| C | mit | zodsoft/usb4java,usb4java/usb4java |
5b6d5b3f4b105ca4a7229e76895304e038457dcb | sys/dev/advansys/advmcode.h | sys/dev/advansys/advmcode.h | /*
* Exported interface to downloadable microcode for AdvanSys SCSI Adapters
*
* $FreeBSD$
*
* Obtained from:
*
* Copyright (c) 1995-1999 Advanced System Products, Inc.
* All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that redistributions of source
* code retain the above copyright notice and this comment without
* modification.
*/
extern u_int16_t adv_mcode[];
extern u_int16_t adv_mcode_size;
extern u_int32_t adv_mcode_chksum;
| /*
* Exported interface to downloadable microcode for AdvanSys SCSI Adapters
*
* $FreeBSD$
*
* Obtained from:
*
* Copyright (c) 1995-1999 Advanced System Products, Inc.
* All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that redistributions of source
* code retain the above copyright notice and this comment without
* modification.
*/
extern u_int8_t adv_mcode[];
extern u_int16_t adv_mcode_size;
extern u_int32_t adv_mcode_chksum;
| Make the extern for adv_mcode match the reality: it's u_int8_t, but probably unendiansafely used as u_int16_t. | Make the extern for adv_mcode match the reality: it's u_int8_t, but
probably unendiansafely used as u_int16_t.
| 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 |
7abb940384e7d5f7a30188d5b227cb6b1727800d | tests/regression/04-mutex/59-td3-self-abort.c | tests/regression/04-mutex/59-td3-self-abort.c | #include <pthread.h>
int myglobal;
void *t_fun(void *arg) {
myglobal=1; // RACE!
return NULL;
}
int main(void) {
pthread_t id;
pthread_create(&id, NULL, t_fun, NULL);
myglobal = myglobal+1; // RACE!
return 0;
}
| Add regression test where TD3 aborting with self-dependency and fixed switch to Narrow is unsound | Add regression test where TD3 aborting with self-dependency and fixed switch to Narrow is unsound
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
715c5e6ae0e5c693c168c8f65eb375c85b682887 | append_seek_write.c | append_seek_write.c | /* Exercise 5-2 */
#include <unistd.h>
#include <fcntl.h>
#include "tlpi_hdr.h"
int main (int argc, char *argv[]) {
if (argc != 2) {
usageErr("%s filename", argv[0]);
}
int fd = open(argv[1], O_WRONLY | O_APPEND | O_CREAT | O_TRUNC, S_IWUSR | S_IRUSR);
if (fd == -1) { errExit("open"); }
char s[] = "abcdefghi";
char t[] = "jklmnopqr";
if (write(fd, s, strlen(s)) != strlen(s)) { errExit("write 1"); }
if (lseek(fd, 0, SEEK_SET) == -1) { errExit("seeking"); }
if (write(fd, t, strlen(t)) != strlen(t)) { errExit("write 2"); }
exit(EXIT_SUCCESS);
}
| /* Exercise 5-2 */
#include <unistd.h>
#include <fcntl.h>
#include "tlpi_hdr.h"
int main (int argc, char *argv[]) {
if (argc != 2) {
usageErr("%s filename", argv[0]);
}
int fd = open(argv[1], O_WRONLY | O_APPEND | O_CREAT | O_TRUNC, S_IWUSR | S_IRUSR);
if (fd == -1) { errExit("open"); }
char s[] = "abcdefghi";
char t[] = "jklmnopqr";
if (write(fd, s, strlen(s)) != strlen(s)) { errExit("write 1"); }
if (lseek(fd, 0, SEEK_SET) == -1) { errExit("seeking"); }
if (write(fd, t, strlen(t)) != strlen(t)) { errExit("write 2"); }
if (close(fd) == -1) { errExit("close output"); }
exit(EXIT_SUCCESS);
}
| Add missing close for file descriptor | Add missing close for file descriptor
| C | mit | timjb/tlpi-exercises,timjb/tlpi-exercises,dalleng/tlpi-exercises,dalleng/tlpi-exercises |
b14ece116ed3e4b18d59b645e77b3449fac51137 | tests/unit/test-unit-main.c | tests/unit/test-unit-main.c | #include <config.h>
#include <dlfcn.h>
#include <test-fixtures/test-unit.h>
int
main (int argc, char **argv)
{
const CoglUnitTest *unit_test;
int i;
if (argc != 2)
{
g_printerr ("usage %s UNIT_TEST\n", argv[0]);
exit (1);
}
/* Just for convenience in case people try passing the wrapper
* filenames for the UNIT_TEST argument we normalize '-' characters
* to '_' characters... */
for (i = 0; argv[1][i]; i++)
{
if (argv[1][i] == '-')
argv[1][i] = '_';
}
unit_test = dlsym (RTLD_DEFAULT, argv[1]);
if (!unit_test)
{
g_printerr ("Unknown test name \"%s\"\n", argv[1]);
return 1;
}
test_utils_init (unit_test->requirement_flags,
unit_test->known_failure_flags);
unit_test->run ();
test_utils_fini ();
return 0;
}
| #include <config.h>
#include <gmodule.h>
#include <test-fixtures/test-unit.h>
int
main (int argc, char **argv)
{
GModule *main_module;
const CoglUnitTest *unit_test;
int i;
if (argc != 2)
{
g_printerr ("usage %s UNIT_TEST\n", argv[0]);
exit (1);
}
/* Just for convenience in case people try passing the wrapper
* filenames for the UNIT_TEST argument we normalize '-' characters
* to '_' characters... */
for (i = 0; argv[1][i]; i++)
{
if (argv[1][i] == '-')
argv[1][i] = '_';
}
main_module = g_module_open (NULL, /* use main module */
0 /* flags */);
if (!g_module_symbol (main_module, argv[1], (void **) &unit_test))
{
g_printerr ("Unknown test name \"%s\"\n", argv[1]);
return 1;
}
test_utils_init (unit_test->requirement_flags,
unit_test->known_failure_flags);
unit_test->run ();
test_utils_fini ();
return 0;
}
| Use GModule instead of libdl to load unit test symbols | Use GModule instead of libdl to load unit test symbols
Previously the unit tests were using libdl without directly linking to
it. It looks like this ends up working because one of Cogl's
dependencies ends up pulling adding -ldl via libtool. However in some
configurations it looks like this wasn't happening.
To avoid this problem we can just use GModule to resolve the symbols.
g_module_open is documented to return a handle to the ‘main program’
when NULL is passed as the filename and looking at the code it seems
that this ends up using RTLD_DEFAULT so it will have the same effect.
The in-tree copy of glib already has the code for gmodule so this
shouldn't cause problems for --disable-glib.
Reviewed-by: Robert Bragg <[email protected]>
| C | lgpl-2.1 | gcampax/cogl,gcampax/cogl,djdeath/cogl,gcampax/cogl,djdeath/cogl,djdeath/cogl,gcampax/cogl |
2354e794031cec8bcb654e676338bc0ddcbb71d6 | storageapi/src/vespa/storageapi/mbusprot/protobuf_includes.h | storageapi/src/vespa/storageapi/mbusprot/protobuf_includes.h | // Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Disable warnings emitted by protoc generated files
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsuggest-override"
#include "feed.pb.h"
#include "visiting.pb.h"
#include "maintenance.pb.h"
#pragma GCC diagnostic pop
| // Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
// Disable warnings emitted by protoc generated files
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsuggest-override"
#include "feed.pb.h"
#include "visiting.pb.h"
#include "maintenance.pb.h"
#pragma GCC diagnostic pop
| Add missing header pragma directive | Add missing header pragma directive
| C | apache-2.0 | vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa |
ca35f85329122c44b55c97ffb99caac7fcff818d | chrome/app/scoped_ole_initializer.h | chrome/app/scoped_ole_initializer.h | // Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_APP_SCOPED_OLE_INITIALIZER_H_
#define CHROME_APP_SCOPED_OLE_INITIALIZER_H_
// Wraps OLE initialization in a cross-platform class meant to be used on the
// stack so init/uninit is done with scoping. This class is ok for use by
// non-windows platforms; it just doesn't do anything.
#if defined(OS_WIN)
#include <ole2.h>
class ScopedOleInitializer {
public:
ScopedOleInitializer() {
int ole_result = OleInitialize(NULL);
DCHECK(ole_result == S_OK);
}
~ScopedOleInitializer() {
OleUninitialize();
}
};
#else
class ScopedOleInitializer {
public:
// Empty, this class does nothing on non-win32 systems. Empty ctor is
// necessary to avoid "unused variable" warning on gcc.
ScopedOleInitializer() { }
};
#endif
#endif // CHROME_APP_SCOPED_OLE_INITIALIZER_H_
| // Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_APP_SCOPED_OLE_INITIALIZER_H_
#define CHROME_APP_SCOPED_OLE_INITIALIZER_H_
#include "base/logging.h"
#include "build/build_config.h"
// Wraps OLE initialization in a cross-platform class meant to be used on the
// stack so init/uninit is done with scoping. This class is ok for use by
// non-windows platforms; it just doesn't do anything.
#if defined(OS_WIN)
#include <ole2.h>
class ScopedOleInitializer {
public:
ScopedOleInitializer() {
int ole_result = OleInitialize(NULL);
DCHECK(ole_result == S_OK);
}
~ScopedOleInitializer() {
OleUninitialize();
}
};
#else
class ScopedOleInitializer {
public:
// Empty, this class does nothing on non-win32 systems. Empty ctor is
// necessary to avoid "unused variable" warning on gcc.
ScopedOleInitializer() { }
};
#endif
#endif // CHROME_APP_SCOPED_OLE_INITIALIZER_H_
| Make ScopedOleInitializer work on windows if you aren't including build_config already. | Make ScopedOleInitializer work on windows if you aren't including
build_config already.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/19640
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@8835 0039d316-1c4b-4281-b951-d872f2087c98
| C | bsd-3-clause | ChromiumWebApps/chromium,rogerwang/chromium,M4sse/chromium.src,rogerwang/chromium,ondra-novak/chromium.src,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,chuan9/chromium-crosswalk,ltilve/chromium,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,littlstar/chromium.src,robclark/chromium,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,patrickm/chromium.src,chuan9/chromium-crosswalk,nacl-webkit/chrome_deps,dednal/chromium.src,ltilve/chromium,Jonekee/chromium.src,dednal/chromium.src,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,dednal/chromium.src,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,rogerwang/chromium,fujunwei/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,hujiajie/pa-chromium,robclark/chromium,Chilledheart/chromium,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,keishi/chromium,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,hujiajie/pa-chromium,robclark/chromium,ltilve/chromium,anirudhSK/chromium,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,robclark/chromium,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,markYoungH/chromium.src,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,timopulkkinen/BubbleFish,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk,ltilve/chromium,dednal/chromium.src,Jonekee/chromium.src,bright-sparks/chromium-spacewalk,patrickm/chromium.src,ondra-novak/chromium.src,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,ltilve/chromium,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,zcbenz/cefode-chromium,rogerwang/chromium,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,zcbenz/cefode-chromium,junmin-zhu/chromium-rivertrail,mohamed--abdel-maksoud/chromium.src,zcbenz/cefode-chromium,mogoweb/chromium-crosswalk,littlstar/chromium.src,patrickm/chromium.src,junmin-zhu/chromium-rivertrail,chuan9/chromium-crosswalk,dednal/chromium.src,ChromiumWebApps/chromium,keishi/chromium,Just-D/chromium-1,ondra-novak/chromium.src,axinging/chromium-crosswalk,hujiajie/pa-chromium,Just-D/chromium-1,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,anirudhSK/chromium,junmin-zhu/chromium-rivertrail,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,M4sse/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,markYoungH/chromium.src,ondra-novak/chromium.src,bright-sparks/chromium-spacewalk,Fireblend/chromium-crosswalk,jaruba/chromium.src,M4sse/chromium.src,hujiajie/pa-chromium,pozdnyakov/chromium-crosswalk,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,Just-D/chromium-1,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,jaruba/chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk-efl,nacl-webkit/chrome_deps,axinging/chromium-crosswalk,zcbenz/cefode-chromium,nacl-webkit/chrome_deps,axinging/chromium-crosswalk,anirudhSK/chromium,anirudhSK/chromium,mogoweb/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,rogerwang/chromium,ondra-novak/chromium.src,junmin-zhu/chromium-rivertrail,zcbenz/cefode-chromium,anirudhSK/chromium,timopulkkinen/BubbleFish,keishi/chromium,pozdnyakov/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,jaruba/chromium.src,junmin-zhu/chromium-rivertrail,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,Just-D/chromium-1,dushu1203/chromium.src,littlstar/chromium.src,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,Chilledheart/chromium,rogerwang/chromium,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,junmin-zhu/chromium-rivertrail,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,zcbenz/cefode-chromium,jaruba/chromium.src,axinging/chromium-crosswalk,robclark/chromium,pozdnyakov/chromium-crosswalk,patrickm/chromium.src,Jonekee/chromium.src,robclark/chromium,markYoungH/chromium.src,hgl888/chromium-crosswalk,markYoungH/chromium.src,mogoweb/chromium-crosswalk,jaruba/chromium.src,dushu1203/chromium.src,jaruba/chromium.src,keishi/chromium,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,jaruba/chromium.src,robclark/chromium,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,keishi/chromium,zcbenz/cefode-chromium,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,mogoweb/chromium-crosswalk,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,chuan9/chromium-crosswalk,timopulkkinen/BubbleFish,timopulkkinen/BubbleFish,markYoungH/chromium.src,nacl-webkit/chrome_deps,nacl-webkit/chrome_deps,Just-D/chromium-1,robclark/chromium,markYoungH/chromium.src,rogerwang/chromium,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,Chilledheart/chromium,ltilve/chromium,patrickm/chromium.src,Just-D/chromium-1,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,robclark/chromium,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,Just-D/chromium-1,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,Chilledheart/chromium,rogerwang/chromium,nacl-webkit/chrome_deps,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,hujiajie/pa-chromium,junmin-zhu/chromium-rivertrail,anirudhSK/chromium,markYoungH/chromium.src,keishi/chromium,ChromiumWebApps/chromium,patrickm/chromium.src,rogerwang/chromium,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,patrickm/chromium.src,hgl888/chromium-crosswalk,dushu1203/chromium.src,patrickm/chromium.src,dushu1203/chromium.src,keishi/chromium,PeterWangIntel/chromium-crosswalk,nacl-webkit/chrome_deps,M4sse/chromium.src,Fireblend/chromium-crosswalk,junmin-zhu/chromium-rivertrail,dushu1203/chromium.src,junmin-zhu/chromium-rivertrail,markYoungH/chromium.src,pozdnyakov/chromium-crosswalk,dednal/chromium.src,fujunwei/chromium-crosswalk,M4sse/chromium.src,M4sse/chromium.src,hujiajie/pa-chromium,TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,ltilve/chromium,dednal/chromium.src,bright-sparks/chromium-spacewalk,Fireblend/chromium-crosswalk,anirudhSK/chromium,Just-D/chromium-1,dednal/chromium.src,anirudhSK/chromium,zcbenz/cefode-chromium,littlstar/chromium.src,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,mogoweb/chromium-crosswalk,ltilve/chromium,timopulkkinen/BubbleFish,littlstar/chromium.src,chuan9/chromium-crosswalk,keishi/chromium,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,Pluto-tv/chromium-crosswalk,pozdnyakov/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,zcbenz/cefode-chromium,robclark/chromium,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,dushu1203/chromium.src,markYoungH/chromium.src,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,hgl888/chromium-crosswalk,ChromiumWebApps/chromium,markYoungH/chromium.src,fujunwei/chromium-crosswalk,Jonekee/chromium.src,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,Jonekee/chromium.src,jaruba/chromium.src,zcbenz/cefode-chromium,ondra-novak/chromium.src,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk,anirudhSK/chromium,Chilledheart/chromium,keishi/chromium,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,littlstar/chromium.src,rogerwang/chromium,timopulkkinen/BubbleFish,Jonekee/chromium.src,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,M4sse/chromium.src,littlstar/chromium.src,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,keishi/chromium,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,nacl-webkit/chrome_deps,timopulkkinen/BubbleFish,jaruba/chromium.src,ondra-novak/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,keishi/chromium,hgl888/chromium-crosswalk |
57fcc6c037a9cde10f80e3bc1b36175a3aa0ac5d | libgpmat/src/gp-proc.h | libgpmat/src/gp-proc.h | /* gp-proc.c -- Information extracted from /proc
-- Copyright (C) 2014 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- 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 _GP_PROC_H
#define _GP_PROC_H
#define MAP_R_OK 0x01
#define MAP_W_OK 0x02
#define MAP_X_OK 0x04
#define MAP_PRIV 0x08
typedef struct map_info
{
void* start;
void* end;
int flags;
char* name;
} map_info_t;
typedef void (* gp_extract_map_callback) (map_info_t* map, void* data);
/**
* @brief Read the process /proc/<pid>/maps file.
*
* @param pid the process id.
* @param callback the callback execute for each map entry.
* @param data the callback data.
*/
extern void
gp_read_proc_maps (int pid, gp_extract_map_callback callback, void *data);
#endif
| Support to read and extract information from /proc/<pid>/maps | Support to read and extract information from /proc/<pid>/maps
| C | apache-2.0 | stcarrez/mat,stcarrez/mat,stcarrez/mat |
|
b311550d076fae4341d8ea73cd6227f1c37c3732 | Headers/breakout.h | Headers/breakout.h | /*
The Breakout class holds all of the game logic. It is derived from the QWidget class to allow it to display in a Qt window.
It handles all input events, game updates, and painting events. It also handles the current game state.
*/
#ifndef BREAKOUT_H
#define BREAKOUT_H
#include "ball.h"
#include "brick.h"
#include "paddle.h"
#include <QWidget>
#include <QKeyEvent>
class Breakout : public QWidget
{
Q_OBJECT
public:
//Constructor and Destructor
Breakout(QWidget *parent = 0);
~Breakout();
protected:
//Events
void paintEvent(QPaintEvent* event);
void timerEvent(QTimerEvent* event);
void keyPressEvent(QKeyEvent* event);
//Functions dependent on the current game state
void startGame();
void pauseGame();
void stopGame();
void victory();
//Function to check for collision of GameObjects
void checkCollision();
private:
//Variable to keep track of QTimerId
int timerId;
//The GameObjects
Ball* ball;
Paddle* paddle;
Brick* bricks[30];
//The game states
bool gameOver, gameWon, gameStarted, paused;
};
#endif // BREAKOUT_H
| /*
The Breakout class holds all of the game logic. It is derived from the QWidget class to allow it to display in a Qt window.
It handles all input events, game updates, and painting events. It also handles the current game state.
*/
#ifndef BREAKOUT_H
#define BREAKOUT_H
#include "ball.h"
#include "brick.h"
#include "paddle.h"
#include <QWidget>
#include <QKeyEvent>
class Breakout : public QWidget
{
Q_OBJECT
public:
//Constructor and Destructor
Breakout(QWidget *parent = 0);
~Breakout();
protected:
//Events
void paintEvent(QPaintEvent* event);
void timerEvent(QTimerEvent* event);
void keyPressEvent(QKeyEvent* event);
//Functions dependent on the current game state
void startGame();
void pauseGame();
void stopGame();
void victory();
//Function to check for collision of GameObjects
void checkCollision();
private:
//Variable to keep track of QTimerId
int timerId;
//The GameObjects
Ball* ball;
Paddle* paddle;
std::vector<Brick*> bricks;
//The game states
bool gameOver, gameWon, gameStarted, paused;
};
#endif // BREAKOUT_H
| Convert bricks to a std::vector | Convert bricks to a std::vector | C | mit | maytim/Basic-Qt-Collision-Example |
272ae9518abe3815f1651a730f14b8c1316f96f3 | C/header.h | C/header.h | /*!
* @brief Template C-header file
*
* This is a template C-header file
* @author <+AUTHOR+>
* @date <+DATE+>
* @file <+FILE+>
* @version 0.1
*/
#ifndef <+FILE_CAPITAL+>_H
#define <+FILE_CAPITAL+>_H
#if defined(_MSC_VER)
# define <+FILE_CAPITAL+>_DLLEXPORT __declspec(dllexport)
#elif defined(__GNUC__)
# define <+FILE_CAPITAL+>_DLLEXPORT __attribute__((dllexport))
#else
# define DLLEXPORT
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
<+CURSOR+>
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#endif /* <+FILE_CAPITAL+>_H */
| /*!
* @brief Template C-header file
*
* This is a template C-header file
* @author <+AUTHOR+>
* @date <+DATE+>
* @file <+FILE+>
* @version 0.1
*/
#ifndef <+FILE_CAPITAL+>_H
#define <+FILE_CAPITAL+>_H
#if defined(_MSC_VER)
# define <+FILE_CAPITAL+>_DLLEXPORT __declspec(dllexport)
#elif defined(__GNUC__)
# define <+FILE_CAPITAL+>_DLLEXPORT __attribute__((dllexport))
#else
# define <+FILE_CAPITAL+>_DLLEXPORT
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
<+CURSOR+>
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#undef <+FILE_CAPITAL+>_DLLEXPORT
#endif /* <+FILE_CAPITAL+>_H */
| Add macro for DLL exportation | Add macro for DLL exportation
| C | mit | koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate |
713c8327fadf0ea96a82a9f0216042e8b88609c0 | eval/src/vespa/eval/instruction/simple_join_count.h | eval/src/vespa/eval/instruction/simple_join_count.h | // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/eval/eval/tensor_function.h>
namespace vespalib::eval {
/**
* Tensor function that will count the number of cells in the result
* of a join between two tensors with full mapped overlap consisting
* of a single dimension.
**/
class SimpleJoinCount : public tensor_function::Op2
{
private:
uint64_t _dense_factor;
public:
SimpleJoinCount(const TensorFunction &lhs_in, const TensorFunction &rhs_in, size_t dense_factor_in);
InterpretedFunction::Instruction compile_self(const ValueBuilderFactory &factory, Stash &stash) const override;
bool result_is_mutable() const override { return true; }
uint64_t dense_factor() const { return _dense_factor; }
static const TensorFunction &optimize(const TensorFunction &expr, Stash &stash);
};
} // namespace
| // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/eval/eval/tensor_function.h>
namespace vespalib::eval {
/**
* Tensor function that will count the number of cells in the result
* of a join between two tensors with full mapped overlap consisting
* of a single dimension.
**/
class SimpleJoinCount : public tensor_function::Op2
{
private:
uint64_t _dense_factor;
public:
SimpleJoinCount(const TensorFunction &lhs_in, const TensorFunction &rhs_in, uint64_t dense_factor_in);
InterpretedFunction::Instruction compile_self(const ValueBuilderFactory &factory, Stash &stash) const override;
bool result_is_mutable() const override { return true; }
uint64_t dense_factor() const { return _dense_factor; }
static const TensorFunction &optimize(const TensorFunction &expr, Stash &stash);
};
} // namespace
| Adjust SimpleJoinCount constructor argument type. | Adjust SimpleJoinCount constructor argument type.
| C | apache-2.0 | vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa |
eaac4a2d7dd7663451775f0eeb72a800ad1f99f5 | include/config/SkUserConfigManual.h | include/config/SkUserConfigManual.h | /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)
#define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)
#define SK_USE_FREETYPE_EMBOLDEN
// Disable these Ganesh features
#define SK_DISABLE_REDUCE_OPLIST_SPLITTING
// Check error is expensive. HWUI historically also doesn't check its allocations
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0
// Legacy flags
#define SK_IGNORE_GPU_DITHER
#define SK_SUPPORT_DEPRECATED_CLIPOPS
// Staging flags
#define SK_LEGACY_PATH_ARCTO_ENDPOINT
// Needed until we fix https://bug.skia.org/2440
#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
#define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
#define SK_SUPPORT_LEGACY_AA_CHOICE
#define SK_SUPPORT_LEGACY_AAA_CHOICE
#define SK_DISABLE_DAA // skbug.com/6886
#endif // SkUserConfigManual_DEFINED
| /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)
#define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)
#define SK_USE_FREETYPE_EMBOLDEN
// Disable these Ganesh features
#define SK_DISABLE_REDUCE_OPLIST_SPLITTING
// Check error is expensive. HWUI historically also doesn't check its allocations
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0
// Legacy flags
#define SK_IGNORE_GPU_DITHER
#define SK_SUPPORT_DEPRECATED_CLIPOPS
// Staging flags
#define SK_LEGACY_PATH_ARCTO_ENDPOINT
#define SK_SUPPORT_LEGACY_MATRIX_IMAGEFILTER
// Needed until we fix https://bug.skia.org/2440
#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
#define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
#define SK_SUPPORT_LEGACY_AA_CHOICE
#define SK_SUPPORT_LEGACY_AAA_CHOICE
#define SK_DISABLE_DAA // skbug.com/6886
#endif // SkUserConfigManual_DEFINED
| Add flag to stage api change am: f83df73740 | Add flag to stage api change am: f83df73740
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/skia/+/13451544
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I2856cdd8b51312e17468c6b5c5cdd98798d72f60
| C | bsd-3-clause | aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia |
af37feed18a95f15ca5ec798ab29e4351c8b335c | k-means/main.c | k-means/main.c | //
// main.c
// k-means
//
// Created by Jamie Bullock on 24/08/2014.
// Copyright (c) 2014 Jamie Bullock. All rights reserved.
//
#include "km.h"
#include <stdio.h>
int main(int argc, const char * argv[])
{
km_textfile textfile = km_textfile_new();
RETURN_ON_ERROR(km_textfile_init(textfile));
RETURN_ON_ERROR(km_textfile_read(textfile, "input-2.csv"));
km_pointlist pointlist = km_pointlist_new(km_textfile_num_lines(textfile));
RETURN_ON_ERROR(km_pointlist_fill(pointlist, textfile));
km_pointlist_delete(pointlist);
km_textfile_delete(textfile);
return 0;
}
| //
// main.c
// k-means
//
// Created by Jamie Bullock on 24/08/2014.
// Copyright (c) 2014 Jamie Bullock. All rights reserved.
//
#include "km.h"
#include <stdio.h>
enum cluster_id {
Adam,
Bob,
Charley,
David,
Edward,
km_num_cluster_ids_
};
void set_initial_cluster_centroids(km_pointlist pointlist)
{
km_pointlist_update(pointlist, 0, Adam, -0.357, -0.253);
km_pointlist_update(pointlist, 1, Bob, -0.055, 4.392);
km_pointlist_update(pointlist, 2, Charley, 2.674, -0.001);
km_pointlist_update(pointlist, 3, David, 1.044, -1.251);
km_pointlist_update(pointlist, 3, Edward, -1.495, -0.090);
}
int main(int argc, const char * argv[])
{
km_textfile textfile = km_textfile_new();
RETURN_ON_ERROR(km_textfile_init(textfile));
RETURN_ON_ERROR(km_textfile_read(textfile, "input-2.csv"));
km_pointlist pointlist = km_pointlist_new(km_textfile_num_lines(textfile));
km_pointlist centroids = km_pointlist_new(km_num_cluster_ids_);
RETURN_ON_ERROR(km_pointlist_fill(pointlist, textfile));
set_initial_cluster_centroids(centroids);
km_pointlist_delete(pointlist);
km_textfile_delete(textfile);
return 0;
}
| Add setup code for initial centroids | Add setup code for initial centroids
| C | mit | jamiebullock/k-means,jamiebullock/k-means |
5251cdd753a244ce7e1b55d397831d31ad75934c | Matrix2D.h | Matrix2D.h | /*
Copyright 2011 Michael Fortin
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 MATRIX2D
#define MATRIX2D
#include "Coord2D.h"
#include "Angle.h"
//! Basic 2D matrix
class Matrix2D
{
public:
//! First row
Coord2D row1;
//! Second row
Coord2D row2;
//! Initialize as rotation matrix
Matrix2D(const Angle &in_angle)
: row1(cosf(in_angle.radians()), -sinf(in_angle.radians()))
, row2(sinf(in_angle.radians()), cosf(in_angle.radians()))
{}
};
//! Basic multiplication
Coord2D operator*(const Matrix2D &in_mat, const Coord2D &in_c2d)
{
return Coord2D(dot(in_mat.row1, in_c2d), dot(in_mat.row2, in_c2d));
}
#endif
| /*
Copyright 2011 Michael Fortin
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 MATRIX2D
#define MATRIX2D
#include "Coord2D.h"
#include "Angle.h"
//! Basic 2D matrix
class Matrix2D
{
public:
//! First row
Coord2D row1;
//! Second row
Coord2D row2;
//! Initialize as rotation matrix
Matrix2D(const Angle &in_angle)
: row1(cosf(in_angle.radians()), -sinf(in_angle.radians()))
, row2(sinf(in_angle.radians()), cosf(in_angle.radians()))
{}
//! Basic multiplication
Coord2D operator*(const Coord2D &in_c2d) const
{
return Coord2D(dot(row1, in_c2d), dot(row2, in_c2d));
}
};
#endif
| Multiply now member of class - link errors when included in multiple cpp files | Multiply now member of class - link errors when included in multiple cpp files
| C | apache-2.0 | mifortin/AgilePod,mifortin/AgilePod |
cedac29b3cb33833bb96f723661f0af0cc638ecc | chrome/common/notification_observer.h | chrome/common/notification_observer.h | // Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_COMMON_NOTIFICATION_OBSERVER_H_
#define CHROME_COMMON_NOTIFICATION_OBSERVER_H_
class NotificationDetails;
class NotificationSource;
class NotificationType;
// This is the base class for notification observers. When a matching
// notification is posted to the notification service, Observe is called.
class NotificationObserver {
public:
virtual ~NotificationObserver();
virtual void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) = 0;
};
#endif // CHROME_COMMON_NOTIFICATION_OBSERVER_H_
| Add forgotted notification observer header. | Add forgotted notification observer header.
git-svn-id: http://src.chromium.org/svn/trunk/src@9021 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Former-commit-id: b3590333382a99d18cc057bc509052629f21e87a | C | bsd-3-clause | meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser |
|
31f6b273a304341c71bbae34ba4b665d59b3ab72 | include/platform/time_mach.h | include/platform/time_mach.h | #ifndef __TIME_MACH_H__
#define __TIME_MACH_H__
#include "config.h" // macros, bool, uint[XX]_t
#include <mach/clock.h> // clock_serv_t, mach_timespec_t, etc.
#include <mach/mach.h> // mach_port_deallocate
static inline uint64_t get_time(void)
{
static float adj_const = 0.0F;
// Cache the value (it doesn't change)
if(adj_const == 0.0F)
{
mach_timebase_info_data_t ti;
mach_timebase_info(&ti);
adj_const = ti.numer / ti.denom;
}
return (uint64_t)mach_absolute_time() * adj_const;
}
#endif /*__TIME_MACH_H__*/
| #ifndef __TIME_MACH_H__
#define __TIME_MACH_H__
#include "config.h" // macros, bool, uint[XX]_t
#include <mach/clock.h> // clock_serv_t, mach_timespec_t, etc.
#include <mach/mach.h> // mach_port_deallocate
#include <mach/mach_time.h>
static inline uint64_t get_time(void)
{
static float adj_const = 0.0F;
// Cache the value (it doesn't change)
if(adj_const == 0.0F)
{
mach_timebase_info_data_t ti;
mach_timebase_info(&ti);
adj_const = ti.numer / ti.denom;
}
return (uint64_t)mach_absolute_time() * adj_const;
}
#endif /*__TIME_MACH_H__*/
| Fix build on OS X. | Fix build on OS X.
| C | bsd-3-clause | foxkit-us/supergameherm,supergameherm/supergameherm |
905628048f5306cb5cc96e24eda40e86c6b44c62 | src/dialogwindow.h | src/dialogwindow.h | #pragma once
#include <nanogui/screen.h>
#include <nanogui/window.h>
#include <nanogui/theme.h>
class EditorGUI;
class Structure;
class DialogWindow : public nanogui::Window {
public:
DialogWindow(EditorGUI *screen, nanogui::Theme *theme);
nanogui::Window *getWindow() { return this; }
Structure *structure() { return current_structure; }
void setStructure( Structure *s);
void loadStructure( Structure *s);
void clear();
private:
EditorGUI *gui;
Structure *current_structure;
};
| #pragma once
#include <nanogui/screen.h>
#include <nanogui/window.h>
#include <nanogui/theme.h>
class EditorGUI;
class Structure;
class DialogWindow : public nanogui::Window {
public:
DialogWindow(EditorGUI *screen, nanogui::Theme *theme);
nanogui::Window *getWindow() { return this; }
Structure *structure() { return current_structure; }
void setStructure( Structure *s);
void loadStructure( Structure *s);
void clear();
private:
EditorGUI *gui = nullptr;
Structure *current_structure = nullptr;
};
| Fix crash due to uninitialised pointer when displaying a dialog | Fix crash due to uninitialised pointer when displaying a dialog
| C | bsd-3-clause | latproc/humid,latproc/humid |
576dcaaa52ba9ca3550d887e358faa0e31c8cf6b | OrbitCaptureGgpClient/include/OrbitCaptureGgpClient/OrbitCaptureGgpClient.h | OrbitCaptureGgpClient/include/OrbitCaptureGgpClient/OrbitCaptureGgpClient.h | // Copyright (c) 2020 The Orbit 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 ORBIT_CAPTURE_GGP_CLIENT_ORBIT_CAPTURE_GGP_CLIENT_H_
#define ORBIT_CAPTURE_GGP_CLIENT_ORBIT_CAPTURE_GGP_CLIENT_H_
#include <string>
#include <vector>
class CaptureClientGgpClient {
public:
CaptureClientGgpClient(std::string grpc_server_address);
~CaptureClientGgpClient();
CaptureClientGgpClient(CaptureClientGgpClient&&);
CaptureClientGgpClient& operator=(CaptureClientGgpClient&&);
int StartCapture();
int StopAndSaveCapture();
int UpdateSelectedFunctions(std::vector<std::string> capture_functions);
void ShutdownService();
private:
class CaptureClientGgpClientImpl;
std::unique_ptr<CaptureClientGgpClientImpl> pimpl;
};
#endif // ORBIT_CAPTURE_GGP_CLIENT_ORBIT_CAPTURE_GGP_CLIENT_H_ | // Copyright (c) 2020 The Orbit 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 ORBIT_CAPTURE_GGP_CLIENT_ORBIT_CAPTURE_GGP_CLIENT_H_
#define ORBIT_CAPTURE_GGP_CLIENT_ORBIT_CAPTURE_GGP_CLIENT_H_
#include <memory>
#include <string>
#include <vector>
class CaptureClientGgpClient {
public:
CaptureClientGgpClient(std::string grpc_server_address);
~CaptureClientGgpClient();
CaptureClientGgpClient(CaptureClientGgpClient&&);
CaptureClientGgpClient& operator=(CaptureClientGgpClient&&);
int StartCapture();
int StopAndSaveCapture();
int UpdateSelectedFunctions(std::vector<std::string> capture_functions);
void ShutdownService();
private:
class CaptureClientGgpClientImpl;
std::unique_ptr<CaptureClientGgpClientImpl> pimpl;
};
#endif // ORBIT_CAPTURE_GGP_CLIENT_ORBIT_CAPTURE_GGP_CLIENT_H_ | Solve build error in presubmit | Solve build error in presubmit
Missing include in file.
| C | bsd-2-clause | google/orbit,google/orbit,google/orbit,google/orbit |
b08be4f10886231672844974d8671ddd47276dc7 | generic/include/clc/clcfunc.h | generic/include/clc/clcfunc.h | #define _CLC_OVERLOAD __attribute__((overloadable))
#define _CLC_DECL
#define _CLC_DEF __attribute__((always_inline))
#define _CLC_INLINE __attribute__((always_inline)) static inline
| #define _CLC_OVERLOAD __attribute__((overloadable))
#define _CLC_DECL
#define _CLC_DEF __attribute__((always_inline))
#define _CLC_INLINE __attribute__((always_inline)) inline
| Remove the static keyword from the _CLC_INLINE macro | Remove the static keyword from the _CLC_INLINE macro
static functions are not allowed in OpenCL C
git-svn-id: e7f1ab7c2a259259587475a3e7520e757882f167@184986 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc,llvm-mirror/libclc |
686d82dc92be619255669c99ad2d67eb3f8850b0 | src/math/p_sinh.c | src/math/p_sinh.c | #include <pal.h>
/*
* sinh z = (exp z - exp(-z)) / 2
*/
static inline float _p_sinh(const float z)
{
float exp_z;
p_exp_f32(&z, &exp_z, 1);
return 0.5f * (exp_z - 1.f / exp_z);
}
/**
*
* Calculates the hyperbolic sine of the vector 'a'. Angles are specified
* in radians.
*
* @param a Pointer to input vector
*
* @param c Pointer to output vector
*
* @param n Size of 'a' and 'c' vector.
*
* @return None
*
*/
void p_sinh_f32(const float *a, float *c, int n)
{
int i;
for (i = 0; i < n; i++) {
c[i] = _p_sinh(a[i]);
}
}
| #include <pal.h>
#include "p_exp.h"
/*
* sinh z = (exp z - exp(-z)) / 2
*/
static inline float _p_sinh(const float z)
{
float exp_z = _p_exp(z);
return 0.5f * (exp_z - 1.f / exp_z);
}
/**
*
* Calculates the hyperbolic sine of the vector 'a'. Angles are specified
* in radians.
*
* @param a Pointer to input vector
*
* @param c Pointer to output vector
*
* @param n Size of 'a' and 'c' vector.
*
* @return None
*
*/
void p_sinh_f32(const float *a, float *c, int n)
{
int i;
for (i = 0; i < n; i++) {
c[i] = _p_sinh(a[i]);
}
}
| Use the inline exponential function. | math:sinh: Use the inline exponential function.
Signed-off-by: Mansour Moufid <[email protected]>
| C | apache-2.0 | debug-de-su-ka/pal,mateunho/pal,Adamszk/pal3,olajep/pal,Adamszk/pal3,eliteraspberries/pal,aolofsson/pal,8l/pal,parallella/pal,eliteraspberries/pal,8l/pal,aolofsson/pal,aolofsson/pal,8l/pal,Adamszk/pal3,parallella/pal,aolofsson/pal,Adamszk/pal3,mateunho/pal,olajep/pal,olajep/pal,debug-de-su-ka/pal,olajep/pal,debug-de-su-ka/pal,eliteraspberries/pal,debug-de-su-ka/pal,parallella/pal,eliteraspberries/pal,eliteraspberries/pal,mateunho/pal,parallella/pal,8l/pal,mateunho/pal,parallella/pal,debug-de-su-ka/pal,mateunho/pal |
f3f4b0e1ab4904f6a1d9011d9abc7735e65b458c | nbdump.c | nbdump.c | #include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/ethernet.h>
#include <unistd.h>
#include <arpa/inet.h>
// The default size is enought to hold a whole ethernet frame (< 1524 bytes)
#ifndef PACKET_BUFFER_SIZE
#define PACKET_BUFFER_SIZE 2048
#endif
static void print_packet(const unsigned char *pkt, size_t pktlen)
{
while (pktlen--) {
printf("%02x", *pkt++);
}
putchar('\n');
}
int main(int argc, char *argv[])
{
unsigned char pktbuf[PACKET_BUFFER_SIZE];
int sockfd, res = 0;
sockfd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
if (-1 == sockfd) {
perror("socket");
goto error;
}
while (1) {
ssize_t pktlen = read(sockfd, pktbuf, sizeof(pktbuf));
if (pktlen < 0) {
perror("read");
continue;
}
if (pktlen > 0) {
print_packet(pktbuf, pktlen);
}
}
close(sockfd);
out:
return res;
error:
res = 1;
goto out;
}
| #include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/ethernet.h>
#include <unistd.h>
#include <arpa/inet.h>
// The default size is enought to hold a whole ethernet frame (< 1524 bytes)
#ifndef PACKET_BUFFER_SIZE
#define PACKET_BUFFER_SIZE 2048
#endif
static void print_packet(const unsigned char *pkt, size_t pktlen)
{
while (pktlen--) {
printf("%02x", *pkt++);
}
putchar('\n');
}
int main(int argc, char *argv[])
{
unsigned char pktbuf[PACKET_BUFFER_SIZE];
int sockfd, res = 0;
sockfd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
if (-1 == sockfd) {
perror("socket");
goto error;
}
while (1) {
ssize_t pktlen = read(sockfd, pktbuf, sizeof(pktbuf));
if (pktlen < 0) {
perror("read");
continue;
}
if (pktlen > 0) {
print_packet(pktbuf, pktlen);
}
}
close(sockfd);
out:
return res;
error:
res = 1;
goto out;
}
| Fix indentation by using tabs only | Fix indentation by using tabs only
| C | mit | grn/netbox,grn/netbox |
497c4be23046de14c1a0c64a39abbbb0a0c19259 | firmware/2016/headers/pins.h | firmware/2016/headers/pins.h | #ifndef Pins_h
#define Pins_h
/*Motor pins*/
int PWMA = 9;
int AIN1 = 8;
int AIN2 = 7;
int PWMB = 10;
int BIN1 = 4;
int BIN2 = 5;
int STDBY = 6;
/*Encoder pins*/
int channelA = 3; //TX = 3
int channelB = 2; //RX = 2
/*Radio pins*/
int CE = A1; //pro micro
int CS = A0; //pro micro
//int CE = 3; //nano
//int CS = 2; //nano
#endif | Put all pin information in a single header. | Put all pin information in a single header.
| C | mit | unball/ieee-very-small,unball/ieee-very-small,unball/ieee-very-small,unball/ieee-very-small |
|
d4441a0e7d10767b97776fd3046382492132f407 | src/Article.h | src/Article.h | #ifndef _ARTICLE_H
#define _ARTICLE_H
#include <string>
#include <vector>
/*!
* represents a Wikipedia (Mediawiki) and its links
*/
class Article
{
public:
typedef std::vector<Article*> ArticleLinkStorage;
typedef std::vector<Article*>::const_iterator ArticleLinkIterator;
/*! Create a new article from a title
* \param title The title of the article
*/
Article(std::string title)
: title(title) {};
//! Get the title of the article
std::string getTitle() const
{
return title;
}
//! get the number of links the article has
size_t getNumLinks() const;
/*! Add a link to another article
* \param[in] article Pointer to the article this article links
* to
*/
void addLink(Article* article)
{
links.push_back(article);
}
/*! Get const_iterator to first linked article */
ArticleLinkIterator linkBegin() const
{
return links.cbegin();
}
/*! Get const_iterator to last linked article */
ArticleLinkIterator linkEnd() const
{
return links.cend();
}
private:
std::string title;
ArticleLinkStorage links;
};
#endif //_ARTICLE_H
| #ifndef _ARTICLE_H
#define _ARTICLE_H
#include <string>
#include <vector>
/*!
* represents a Wikipedia (Mediawiki) and its links
*/
class Article
{
public:
//! representation of links to other articles
typedef std::vector<Article*> ArticleLinkStorage;
//! representation of iterator over links
typedef std::vector<Article*>::iterator ArticleLinkIterator;
//! representation of const iterator over links
typedef std::vector<Article*>::const_iterator ArticleLinkConstIterator;
/*! Create a new article from a title
* \param title The title of the article
*/
Article(std::string title)
: title(title) {};
//! Get the title of the article
std::string getTitle() const
{
return title;
}
//! get the number of links the article has
size_t getNumLinks() const;
/*! Add a link to another article
* \param[in] article Pointer to the article this article links
* to
*/
void addLink(Article* article)
{
links.push_back(article);
}
/*! Get const_iterator to first linked article */
ArticleLinkConstIterator linkBegin() const
{
return links.cbegin();
}
/*! Get const_iterator to last linked article */
ArticleLinkConstIterator linkEnd() const
{
return links.cend();
}
private:
std::string title;
ArticleLinkStorage links;
};
#endif //_ARTICLE_H
| Add modifying article link iterator typedef | Add modifying article link iterator typedef
| C | mit | dueringa/WikiWalker |
6b3e11bc4cf463b18cd091b5e083d80ec8458e78 | src/logging.c | src/logging.c | #include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
void rsp_log(char* format, ...)
{
char without_ms[64];
char with_ms[64];
struct timeval tv;
struct tm *tm;
gettimeofday(&tv, NULL);
if ((tm = localtime(&tv.tv_sec)) != NULL)
{
strftime(without_ms, sizeof(without_ms), "%Y-%m-%d %H:%M:%S.%%06u %z", tm);
snprintf(with_ms, sizeof(with_ms), without_ms, tv.tv_usec);
fprintf(stdout, "[%s] ", with_ms);
}
va_list argptr;
va_start(argptr, format);
vfprintf(stdout, format, argptr);
va_end(argptr);
fflush(stdout);
}
void rsp_log_error(char* message)
{
char* error = strerror(errno);
char* full_message = malloc(strlen(message) + 3 + strlen(error));
sprintf(full_message, "%s: %s", message, error);
rsp_log(full_message);
free(full_message);
}
| #include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
void rsp_log(char* format, ...)
{
char without_ms[64];
char with_ms[64];
struct timeval tv;
struct tm *tm;
gettimeofday(&tv, NULL);
if ((tm = localtime(&tv.tv_sec)) != NULL)
{
strftime(without_ms, sizeof(without_ms), "%Y-%m-%d %H:%M:%S.%%06u %z", tm);
snprintf(with_ms, sizeof(with_ms), without_ms, tv.tv_usec);
fprintf(stdout, "[%s] ", with_ms);
}
va_list argptr;
va_start(argptr, format);
vfprintf(stdout, format, argptr);
va_end(argptr);
fprintf(stdout, "\n");
fflush(stdout);
}
void rsp_log_error(char* message)
{
char* error = strerror(errno);
char* full_message = malloc(strlen(message) + 3 + strlen(error));
sprintf(full_message, "%s: %s", message, error);
rsp_log(full_message);
free(full_message);
}
| Add a newline to the end of our log messages | Add a newline to the end of our log messages
| C | mit | gpjt/rsp,gpjt/rsp,gpjt/rsp |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.