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
|
---|---|---|---|---|---|---|---|---|---|
bfe1120d49851c8f52e088a8dd31ac41694275ed | libslax/jsonwriter.h | libslax/jsonwriter.h | /*
* $Id$
*
* Copyright (c) 2013, Juniper Networks, Inc.
* All rights reserved.
* This SOFTWARE is licensed under the LICENSE provided in the
* ../Copyright file. By downloading, installing, copying, or otherwise
* using the SOFTWARE, you agree to be bound by the terms of that
* LICENSE.
*
* jsonwriter.h -- turn json-oriented XML into json text
*/
int
slaxJsonWriteNode (slaxWriterFunc_t func, void *data, xmlNodePtr nodep,
unsigned flags);
int
slaxJsonWriteDoc (slaxWriterFunc_t func, void *data, xmlDocPtr docp,
unsigned flags);
#define JWF_ROOT (1<<0) /* Root node */
#define JWF_ARRAY (1<<1) /* Inside array */
#define JWF_NODESET (1<<2) /* Top of a nodeset */
#define JWF_PRETTY (1<<3) /* Pretty print (newlines) */
#define JWF_OPTIONAL_QUOTES (1<<4) /* Don't use quotes unless needed */
| Move JSON parser into libslax | Move JSON parser into libslax
| C | bsd-3-clause | Juniper/libslax,Juniper/libslax,Juniper/libslax |
|
a5091550c09ca51c39ea0f51fc3bc519ca45afac | test/test_c_bindings/test_c_bindings.c | test/test_c_bindings/test_c_bindings.c | /*
** Author(s):
** - Cedric GESTES <[email protected]>
**
** Copyright (C) 2010 Aldebaran Robotics
*/
#include <qi/qi.h>
#include <stdio.h>
int main(int argc, char **argv)
{
qi_client_t *client = qi_client_create("simplecli", argv[1]);
qi_message_t *message = qi_message_create();
qi_message_t *ret = qi_message_create();
qi_message_write_string(message, "master.locateService::s:s");
qi_message_write_string(message, "master.listServices::{ss}:");
qi_client_call(client, "master.locateService::s:s", message, ret);
char *result = qi_message_read_string(ret);
printf("locate returned: %s\n", result);
return 0;
}
| /*
** Author(s):
** - Cedric GESTES <[email protected]>
**
** Copyright (C) 2010 Aldebaran Robotics
*/
#include <qi/qi.h>
#include <stdio.h>
int main(int argc, char **argv)
{
char *result;
qi_client_t *client = qi_client_create("simplecli", argv[1]);
qi_message_t *message = qi_message_create();
qi_message_t *ret = qi_message_create();
qi_message_write_string(message, "master.locateService::s:s");
qi_message_write_string(message, "master.listServices::{ss}:");
qi_client_call(client, "master.locateService::s:s", message, ret);
result = qi_message_read_string(ret);
printf("locate returned: %s\n", result);
return 0;
}
| Make c bindings compile on strict compilers | Make c bindings compile on strict compilers
| C | bsd-3-clause | aldebaran/libqi,aldebaran/libqi,aldebaran/libqi-java,vbarbaresi/libqi,bsautron/libqi,aldebaran/libqi-java,aldebaran/libqi,aldebaran/libqi-java |
f3cfdda7d9e7e0421189713262283d8bc379695f | Classes/SloppySwiperViewControllerProtocol.h | Classes/SloppySwiperViewControllerProtocol.h | //
// SloppySwiperViewControllerProtocol.h
// Pods
//
// Created by Yu Sugawara on 7/8/15.
//
//
#import <UIKit/UIKit.h>
@protocol SloppySwiperViewControllerProtocol <NSObject>
- (UIBarStyle)ssw_navigationBarStyle;
- (UIColor *)ssw_navigationBarColor;
- (UIColor *)ssw_navigationBarItemColor;
- (UIImage *)ssw_navigationBarShadowImage;
@end
| //
// SloppySwiperViewControllerProtocol.h
// Pods
//
// Created by Yu Sugawara on 7/8/15.
//
//
#import <UIKit/UIKit.h>
@protocol SloppySwiperViewControllerProtocol <NSObject>
- (UIBarStyle)ssw_navigationBarStyle;
- (UIColor *)ssw_navigationBarColor;
- (UIColor *)ssw_navigationBarItemColor;
@optional
- (UIImage *)ssw_navigationBarShadowImage;
@end
| Change the ssw_navigationBarShadowImage to the @optional | Change the ssw_navigationBarShadowImage to the @optional
| C | mit | yusuga/SloppySwiper |
050be884232cb5f96248ff753b5b4e321f5a8e94 | lib/Common/ChakraCoreVersion.h | lib/Common/ChakraCoreVersion.h | //-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#pragma once
#define CHAKRA_CORE_MAJOR_VERSION 1
#define CHAKRA_CORE_MINOR_VERSION 2
#define CHAKRA_CORE_VERSION_RELEASE 0
#define CHAKRA_CORE_VERSION_PRERELEASE 0
#define CHAKRA_CORE_VERSION_RELEASE_QFE 0
#define CHAKRA_VERSION_RELEASE 0
// NOTE: need to update the GUID in ByteCodeCacheReleaseFileVersion.h as well
| //-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#pragma once
#define CHAKRA_CORE_MAJOR_VERSION 1
#define CHAKRA_CORE_MINOR_VERSION 3
#define CHAKRA_CORE_VERSION_RELEASE 0
#define CHAKRA_CORE_VERSION_PRERELEASE 0
#define CHAKRA_CORE_VERSION_RELEASE_QFE 0
#define CHAKRA_VERSION_RELEASE 0
// NOTE: need to update the GUID in ByteCodeCacheReleaseFileVersion.h as well
| Update master branch version to 1.3 | Update master branch version to 1.3
| C | mit | Microsoft/ChakraCore,mrkmarron/ChakraCore,mrkmarron/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore,mrkmarron/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore,Microsoft/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore |
8a6df7d010257ba0d15e621a2c675ac882523320 | mud/home/Geometry/lwo/coordinates/xyz.c | mud/home/Geometry/lwo/coordinates/xyz.c | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2021 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
| Add stub for XYZ coordinates. | Add stub for XYZ coordinates.
| C | agpl-3.0 | shentino/kotaka,shentino/kotaka,shentino/kotaka |
|
b662250670d69e6b1a45aae8de67f6eb48d37b61 | src/worker/windows/subscription.h | src/worker/windows/subscription.h | #ifndef SUBSCRIPTION_H
#define SUBSCRIPTION_H
#include <memory>
#include <sstream>
#include <string>
#include "../../message.h"
#include "../../result.h"
class WindowsWorkerPlatform;
class Subscription
{
public:
Subscription(ChannelID channel,
HANDLE root,
const std::wstring &path,
bool recursive,
WindowsWorkerPlatform *platform);
~Subscription();
Result<bool> schedule(LPOVERLAPPED_COMPLETION_ROUTINE fn);
Result<> use_network_size();
BYTE *get_written(DWORD written_size);
Result<std::string> get_root_path();
std::wstring make_absolute(const std::wstring &sub_path);
Result<> stop(const CommandID command);
CommandID get_command_id() const { return command; }
ChannelID get_channel() const { return channel; }
WindowsWorkerPlatform *get_platform() const { return platform; }
bool is_terminating() const { return terminating; }
private:
CommandID command;
ChannelID channel;
WindowsWorkerPlatform *platform;
std::wstring path;
HANDLE root;
OVERLAPPED overlapped;
bool recursive;
bool terminating;
DWORD buffer_size;
std::unique_ptr<BYTE[]> buffer;
std::unique_ptr<BYTE[]> written;
};
#endif
| #ifndef SUBSCRIPTION_H
#define SUBSCRIPTION_H
#include <memory>
#include <sstream>
#include <string>
#include "../../message.h"
#include "../../result.h"
class WindowsWorkerPlatform;
class Subscription
{
public:
Subscription(ChannelID channel,
HANDLE root,
const std::wstring &path,
bool recursive,
WindowsWorkerPlatform *platform);
~Subscription();
Result<bool> schedule(LPOVERLAPPED_COMPLETION_ROUTINE fn);
Result<> use_network_size();
BYTE *get_written(DWORD written_size);
Result<std::string> get_root_path();
std::wstring make_absolute(const std::wstring &sub_path);
Result<> stop(const CommandID command);
const CommandID &get_command_id() const { return command; }
const ChannelID &get_channel() const { return channel; }
WindowsWorkerPlatform *get_platform() const { return platform; }
const bool &is_recursive() const { return recursive; }
const bool &is_terminating() const { return terminating; }
private:
CommandID command;
ChannelID channel;
WindowsWorkerPlatform *platform;
std::wstring path;
HANDLE root;
OVERLAPPED overlapped;
bool recursive;
bool terminating;
DWORD buffer_size;
std::unique_ptr<BYTE[]> buffer;
std::unique_ptr<BYTE[]> written;
};
#endif
| Return const & from getters | Return const & from getters
| C | mit | atom/watcher,atom/watcher,atom/watcher,atom/watcher,atom/watcher |
622c8f06325d89bdda593499323b4c056c699914 | 7segments.c | 7segments.c | #define L for(char*c=a[1],y;*c;)printf("%c%c%c%c",(y="w$]m.k{%\177o"[*c++-48])&u/4?33:32,y&u?95:32,y&u/2?33:32,*c?32:10);u*=8;
main(int u,char**a){u=1;L;L;L} | #define L for(char*c=a[1],y;*c;)printf("%c%c%c%c",(y="w$]m.k{%o"[*c++-48])&u/4?33:32,y&u?95:32,y&u/2?33:32,*c?32:10);u*=8;
main(int u,char**a){u=1;L;L;L} | Use version with replaced \177 | Use version with replaced \177
| C | mit | McZonk/7segements,McZonk/7segements |
ecefcf452f3941ca117f52da61f8a8cc79a1b573 | 7segments.c | 7segments.c | main(int u,char**a){for(;u<129;u*=8){for(char*c=a[1],y;*c;)printf("%c%c%c ",(y="$ֶ<&"[*c++-48])&u/2?33:32,y&u?95:32,y&u/4?33:32);puts("");}} | main(int u,char**a){for(;u<129;u*=8)for(char*c=a[1],y;*c;)printf("%c%c%c%c",(y="$ֶ<&"[*c++-48])&u/2?33:32,y&u?95:32,y&u/4?33:32,*c?32:10);} | Use printf without puts again to save one more byte | Use printf without puts again to save one more byte
| C | mit | McZonk/7segements,McZonk/7segements |
741f580007e33149b117cff4c46588b9b6d36451 | problem_006.c | problem_006.c | #include <stdio.h>
#include <math.h>
#include "euler.h"
#define PROBLEM 6
#define ANSWER 25164150
int
main(int argc, char **argv)
{
double sum = 0, square = 0;
for(double x = 0; x <= 100; x++) {
sum += pow(x, 2.0);
square += x;
}
square = pow(square, 2.0);
double result = square - sum;
return check(PROBLEM, ANSWER, result);
}
| Add solution for problem 6 | Add solution for problem 6
| C | bsd-2-clause | skreuzer/euler |
|
637bbbc2d7b0d47458ab10763865a119fea163a7 | test/profile/Linux/instrprof-cs.c | test/profile/Linux/instrprof-cs.c | // RUN: rm -fr %t.prof
// RUN: %clang_pgogen=%t.prof/ -o %t.gen.cs -O2 %s
// RUN: %t.gen.cs
// RUN: llvm-profdata merge -o %t.cs.profdata %t.prof/
// Check context sensitive profile
// RUN: %clang_profuse=%t.cs.profdata -O2 -emit-llvm -S %s -o - | FileCheck %s --check-prefix=CS
//
// RUN: %clang_profgen=%t.profraw -o %t.gen.cis -O2 %s
// RUN: %t.gen.cis
// RUN: llvm-profdata merge -o %t.cis.profdata %t.profraw
// Check context insenstive profile
// RUN: %clang_profuse=%t.cis.profdata -O2 -emit-llvm -S %s -o - | FileCheck %s --check-prefix=CIS
int g1 = 1;
int g2 = 2;
static void toggle(int t) {
if (t & 1)
g1 *= t;
else
g2 *= t;
}
int main() {
int i;
// CS: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]]
// CIS: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD:[0-9]+]]
toggle(g1);
// CS: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD2:[0-9]+]]
// CIS: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD:[0-9]+]]
toggle(g2);
return 0;
}
// CS: ![[PD1]] = !{!"branch_weights", i32 0, i32 1}
// CS: ![[PD2]] = !{!"branch_weights", i32 1, i32 0}
// CIS: ![[PD]] = !{!"branch_weights", i32 2, i32 2}
| Add a new test case | [Profile] Add a new test case
The end-end test checks that cs-profile counter update
is obtained as expected.
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@277276 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt |
|
af63433f531926143f4dfce63f25ee3b09e81cc3 | FreshAir/RZFReleaseNotes.h | FreshAir/RZFReleaseNotes.h | //
// RZFReleaseNotes.h
// FreshAir
//
// Created by Brian King on 1/26/16.
// Copyright © 2016 Raizlabs. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class RZFRelease, RZFFeature;
@interface RZFReleaseNotes : NSObject
+ (instancetype)releaseNotesWithURL:(NSURL *)URL error:(NSError **)error;
+ (instancetype)releaseNotesWithData:(NSData *)data error:(NSError **)error;
@property (strong, nonatomic) NSArray<RZFRelease *> *releases;
@property (strong, nonatomic) NSURL *upgradeURL;
@property (strong, nonatomic) NSString * __nullable minimumVersion;
@property (strong, nonatomic, readonly) NSArray<RZFFeature *> *features;
- (BOOL)isUpgradeRequiredForVersion:(NSString *)version;
- (NSArray<RZFRelease *> *)releasesSupportingSystemVersion:(NSString *)systemVersion;
- (NSArray<RZFFeature *> *)featuresFromVersion:(NSString *)lastVersion toVersion:(NSString *)currentVersion;
@end
NS_ASSUME_NONNULL_END | //
// RZFReleaseNotes.h
// FreshAir
//
// Created by Brian King on 1/26/16.
// Copyright © 2016 Raizlabs. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class RZFRelease, RZFFeature;
@interface RZFReleaseNotes : NSObject
+ (instancetype)releaseNotesWithURL:(NSURL *)URL error:(NSError **)error;
+ (instancetype)releaseNotesWithData:(NSData *)data error:(NSError **)error;
@property (strong, nonatomic) NSArray<RZFRelease *> *releases;
@property (strong, nonatomic) NSURL *upgradeURL;
@property (strong, nonatomic, nullable) NSString *minimumVersion;
@property (strong, nonatomic, readonly) NSArray<RZFFeature *> *features;
- (BOOL)isUpgradeRequiredForVersion:(NSString *)version;
- (NSArray<RZFRelease *> *)releasesSupportingSystemVersion:(NSString *)systemVersion;
- (NSArray<RZFFeature *> *)featuresFromVersion:(NSString *)lastVersion toVersion:(NSString *)currentVersion;
@end
NS_ASSUME_NONNULL_END | Move nullable to the property attributes | Move nullable to the property attributes
| C | mit | Raizlabs/FreshAir,Raizlabs/FreshAir |
b35873a38c56dad6c5ff2d982e5ad0ad3532253b | pt_error.c | pt_error.c |
#include <assert.h>
#include <string.h>
#include <errno.h>
#include "pt_error.h"
static struct {
const enum pt_error err;
const char* const str;
} pt_error_map[PT_LAST] = {
{ PT_SUCCESS, "Success" },
};
static char* pt_strncpy(char* dst, const char* src, size_t n)
{
if(n > 0) {
int len = strnlen(src, n);
(void) memcpy(dst, src, len - 1);
dst[len] = '\0';
}
return dst;
}
int pt_strerror_r(enum pt_error err, char* buf, size_t len)
{
int ret = 0;
if(len > 0) {
if(err < PT_LAST && err >= PT_SUCCESS) {
assert(err == pt_error_map[err].err);
(void) pt_strncpy(buf, pt_error_map[err].str, len);
if(strlen(pt_error_map[err].str) >= len) {
errno = EOVERFLOW;
ret = 1;
}
} else {
errno = EINVAL;
ret = 1;
}
}
return ret;
}
|
#include <assert.h>
#include <string.h>
#include <errno.h>
#include "pt_error.h"
static struct {
const enum pt_error err;
const char* const str;
} pt_error_map[PT_LAST] = {
{ PT_SUCCESS, "Success" },
};
static char*
pt_strncpy(char* dst, const char* src, size_t n)
{
if(n > 0) {
int len = strnlen(src, n);
(void) memcpy(dst, src, len - 1);
dst[len] = '\0';
}
return dst;
}
int
pt_strerror_r(enum pt_error err, char* buf, size_t len)
{
int ret = 0;
if(len > 0) {
if(err < PT_LAST && err >= PT_SUCCESS) {
assert(err == pt_error_map[err].err);
(void) pt_strncpy(buf, pt_error_map[err].str, len);
if(strlen(pt_error_map[err].str) >= len) {
errno = ERANGE;
ret = 1;
}
} else {
errno = EINVAL;
ret = 1;
}
}
return ret;
}
| Change to a more standard errno in pt_strerror_r() | Change to a more standard errno in pt_strerror_r()
Reformat pt_error.c
| C | apache-2.0 | byannoni/qthreads |
fcd9aac9e7dff92751c7e17b2845e2748260bc2e | include/dynamicsJRLJapan/dynamicJRLJapan_API.h | include/dynamicsJRLJapan/dynamicJRLJapan_API.h | /* Computation of the dynamic aspect for a humanoid robot.
Copyright (c) 2008
@author Olivier Stasse.
JRL-Japan, CNRS/AIST
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* 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.
* Neither the name of the CNRS and AIST nor the names of its contributors
may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _DYN_JRL_JAPAN_CONFIG_H_IN_
#define _DYN_JRL_JAPAN_CONFIG_H_IN_
#if defined (WIN32)
# ifdef dynamicsJRLJapan_EXPORTS
# define DYN_JRL_JAPAN_EXPORT __declspec(dllexport)
# else
# define DYN_JRL_JAPAN_EXPORT __declspec(dllimport)
# endif
#else
# define DYN_JRL_JAPAN_EXPORT
#endif
#endif
| Add an API for Windows | Add an API for Windows
| C | isc | jrl-umi3218/jrl-dynamics,jrl-umi3218/jrl-dynamics |
|
a2620cb6d12c43535149bf2976c3d6c54f1c7e38 | file4.c | file4.c | file4.c - r1
Test checkin in master1-updated
Test checkin in master2
| file4.c - r1
Test checkin in master1-updated - updated2
Test checkin in master2
Test checkin in master3
| Test commit in feature branch | Test commit in feature branch
| C | apache-2.0 | shahedmolla/test |
35947b1d45a735b3fc4ed110302ea31e7850e625 | Pod/Classes/BFTaskCenter.h | Pod/Classes/BFTaskCenter.h | //
// BFTaskCenter.h
// Pods
//
// Created by Superbil on 2015/8/22.
//
//
#import "Bolts.h"
@interface BFTaskCenter : NSObject
/*!
A block that can act as a continuation for a task.
*/
typedef void (^BFTaskCenterBlock)(BFTask * _Nonnull task);
+ (nonnull instancetype)defaultCenter;
- (instancetype)initWithExecutor:(BFExecutor *)executor;
- (nullable id)addTaskBlockToCallbacks:(nonnull BFTaskCenterBlock)taskBlock forKey:(nonnull NSString *)key;
- (void)removeTaskBlock:(nonnull id)taskBlock forKey:(nonnull NSString *)key;
- (void)clearAllCallbacksForKey:(nonnull NSString *)key;
- (void)sendToCallbacksWithKey:(nonnull NSString *)key result:(nullable id)result;
- (void)sendToCallbacksWithKey:(nonnull NSString *)key error:(nonnull NSError *)error;
- (nullable BFTaskCompletionSource *)sourceOfSendToCallbacksForKey:(nonnull NSString *)key
executor:(nonnull BFExecutor *)executor
cancellationToken:(nullable BFCancellationToken *)cancellationToken;
@end
| //
// BFTaskCenter.h
// Pods
//
// Created by Superbil on 2015/8/22.
//
//
#import "Bolts.h"
@interface BFTaskCenter : NSObject
/*!
A block that can act as a continuation for a task.
*/
typedef void (^BFTaskCenterBlock)(BFTask * _Nonnull task);
+ (nullable instancetype)defaultCenter;
- (nullable instancetype)initWithExecutor:(nonnull BFExecutor *)executor;
- (nullable id)addTaskBlockToCallbacks:(nonnull BFTaskCenterBlock)taskBlock forKey:(nonnull NSString *)key;
- (void)removeTaskBlock:(nonnull id)taskBlock forKey:(nonnull NSString *)key;
- (void)clearAllCallbacksForKey:(nonnull NSString *)key;
- (void)sendToCallbacksWithKey:(nonnull NSString *)key result:(nullable id)result;
- (void)sendToCallbacksWithKey:(nonnull NSString *)key error:(nonnull NSError *)error;
- (nullable BFTaskCompletionSource *)sourceOfSendToCallbacksForKey:(nonnull NSString *)key
executor:(nonnull BFExecutor *)executor
cancellationToken:(nullable BFCancellationToken *)cancellationToken;
@end
| Fix compiler warning for nullable check | Fix compiler warning for nullable check
| C | mit | Superbil/BFTaskCenter,Superbil/BFTaskCenter |
59db2153ef50567586bee132643226fb32996fa1 | projects/com.oracle.truffle.llvm.test/tests/c/attributes/visibility/hidden-alias.c | projects/com.oracle.truffle.llvm.test/tests/c/attributes/visibility/hidden-alias.c | #include <stdlib.h>
volatile int func() {
return 4;
}
volatile int func2() __attribute__ ((visibility ("hidden"), alias ("func")));
int main() {
if (func2() != 4) {
abort();
}
}
| Add test case for hidden alias | Add test case for hidden alias
| C | bsd-3-clause | grimmerm/sulong,crbb/sulong,grimmerm/sulong,crbb/sulong,grimmerm/sulong,lxp/sulong,lxp/sulong,PrinzKatharina/sulong,lxp/sulong,lxp/sulong,PrinzKatharina/sulong,PrinzKatharina/sulong,PrinzKatharina/sulong,grimmerm/sulong,crbb/sulong,crbb/sulong |
|
3df46ce3e3b10cd37565184b8c78de882194da56 | cpp/turbodbc/Library/turbodbc/type_code.h | cpp/turbodbc/Library/turbodbc/type_code.h | #pragma once
namespace turbodbc {
/**
* This enumeration assigns integer values to certain database types
*/
enum class type_code : int {
boolean = 0, ///< boolean type
integer = 10, ///< integer types
floating_point = 20, ///< floating point types
string = 30, ///< string types
timestamp = 40, ///< timestamp types
date = 41 ///< date type
};
}
| #pragma once
namespace turbodbc {
/**
* This enumeration assigns integer values to certain database types
*/
enum class type_code : int {
boolean = 0, ///< boolean type
integer = 10, ///< integer types
floating_point = 20, ///< floating point types
string = 30, ///< string types
unicode = 31, ///< unicode types
timestamp = 40, ///< timestamp types
date = 41 ///< date type
};
}
| Add unicode to supported type codes | Add unicode to supported type codes
| C | mit | blue-yonder/turbodbc,blue-yonder/turbodbc,blue-yonder/turbodbc,blue-yonder/turbodbc |
d82bf2d86f3e4185b3815e56f23ca0e07c15541d | test/CodeGen/stdcall-fastcall.c | test/CodeGen/stdcall-fastcall.c | // RUN: %clang_cc1 -emit-llvm < %s | grep 'fastcallcc' | count 6
// RUN: %clang_cc1 -emit-llvm < %s | grep 'stdcallcc' | count 6
void __attribute__((fastcall)) f1(void);
void __attribute__((stdcall)) f2(void);
void __attribute__((fastcall)) f3(void) {
f1();
}
void __attribute__((stdcall)) f4(void) {
f2();
}
// PR5280
void (__attribute__((fastcall)) *pf1)(void) = f1;
void (__attribute__((stdcall)) *pf2)(void) = f2;
void (__attribute__((fastcall)) *pf3)(void) = f3;
void (__attribute__((stdcall)) *pf4)(void) = f4;
int main(void) {
f3(); f4();
pf1(); pf2(); pf3(); pf4();
return 0;
}
| // RUN: %clang_cc1 -emit-llvm < %s | FileCheck %s
void __attribute__((fastcall)) f1(void);
void __attribute__((stdcall)) f2(void);
void __attribute__((fastcall)) f3(void) {
// CHECK: define x86_fastcallcc void @f3()
f1();
// CHECK: call x86_fastcallcc void @f1()
}
void __attribute__((stdcall)) f4(void) {
// CHECK: define x86_stdcallcc void @f4()
f2();
// CHECK: call x86_stdcallcc void @f2()
}
// PR5280
void (__attribute__((fastcall)) *pf1)(void) = f1;
void (__attribute__((stdcall)) *pf2)(void) = f2;
void (__attribute__((fastcall)) *pf3)(void) = f3;
void (__attribute__((stdcall)) *pf4)(void) = f4;
int main(void) {
f3(); f4();
// CHECK: call x86_fastcallcc void @f3()
// CHECK: call x86_stdcallcc void @f4()
pf1(); pf2(); pf3(); pf4();
// CHECK: call x86_fastcallcc void %tmp()
// CHECK: call x86_stdcallcc void %tmp1()
// CHECK: call x86_fastcallcc void %tmp2()
// CHECK: call x86_stdcallcc void %tmp3()
return 0;
}
| Convert this test to FileCheck instead of grepping LLVM IR. | Convert this test to FileCheck instead of grepping LLVM IR.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@95428 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang |
738a7cc75fe112630f29ed08ce68546ac1939728 | server/packet/packet_entity_equipment.c | server/packet/packet_entity_equipment.c | #include "server/client.h"
#include "server/packet.h"
#include "blocks/items.h"
void packet_send_entity_equipment(struct client *client, struct client *c, uint16_t slot, struct item *item, uint16_t damage)
{
bedrock_packet packet;
struct item_stack stack;
stack.id = item->id;
stack.count = 1;
stack.metadata = damage;
packet_init(&packet, SERVER_ENTITY_EQUIPMENT);
packet_pack_int(&packet, &c->id, sizeof(c->id));
packet_pack_int(&packet, &slot, sizeof(slot));
packet_pack_slot(&packet, &stack);
client_send_packet(client, &packet);
}
| #include "server/client.h"
#include "server/packet.h"
#include "blocks/items.h"
void packet_send_entity_equipment(struct client *client, struct client *c, uint16_t slot, struct item *item, uint16_t damage)
{
bedrock_packet packet;
struct item_stack stack;
stack.id = item->id ? item->id : -1;
stack.count = 1;
stack.metadata = damage;
packet_init(&packet, SERVER_ENTITY_EQUIPMENT);
packet_pack_int(&packet, &c->id, sizeof(c->id));
packet_pack_int(&packet, &slot, sizeof(slot));
packet_pack_slot(&packet, &stack);
client_send_packet(client, &packet);
}
| Fix client crash from changing item to nothing | Fix client crash from changing item to nothing
| C | bsd-2-clause | Adam-/bedrock,Adam-/bedrock |
b28077d75ac2c1d016ed0be4be02d9dd3ea05fda | Apptentive/Apptentive/Misc/ApptentiveJSONSerialization.h | Apptentive/Apptentive/Misc/ApptentiveJSONSerialization.h | //
// ApptentiveJSONSerialization.h
// Apptentive
//
// Created by Andrew Wooster on 6/22/13.
// Copyright (c) 2013 Apptentive, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
extern NSInteger ApptentiveJSONDeserializationErrorCode;
@interface ApptentiveJSONSerialization : NSObject
+ (NSData *)dataWithJSONObject:(id)obj options:(NSJSONWritingOptions)opt error:(NSError **)error;
+ (id)JSONObjectWithData:(NSData *)data error:(NSError **)error;
@end
| //
// ApptentiveJSONSerialization.h
// Apptentive
//
// Created by Andrew Wooster on 6/22/13.
// Copyright (c) 2013 Apptentive, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
extern NSInteger ApptentiveJSONDeserializationErrorCode;
extern NSInteger ApptentiveJSONSerializationErrorCode;
@interface ApptentiveJSONSerialization : NSObject
+ (NSData *)dataWithJSONObject:(id)obj options:(NSJSONWritingOptions)opt error:(NSError **)error;
+ (id)JSONObjectWithData:(NSData *)data error:(NSError **)error;
@end
| Add serialization error code extern | Add serialization error code extern
| C | bsd-3-clause | apptentive/apptentive-ios,apptentive/apptentive-ios,apptentive/apptentive-ios |
6991c2dd84060f8e7375966d4e488a359b42d43a | src/AllocationPool.h | src/AllocationPool.h |
#pragma once
template<class T, size_t BufferSize, class StarvationCallbacks>
class AllocationPool {
public:
~AllocationPool()
{
while (!m_FreeList.empty())
{
delete m_FreeList.front();
m_FreeList.pop_front();
}
}
T* Allocate()
{
if (m_FreeList.Size() <= BufferSize)
{
try
{
return new T;
}
catch (std::bad_alloc& ex)
{
if (m_FreeList.size() == BufferSize)
{
StarvationCallbacks.OnStartingUsingBuffer();
}
else if (m_FreeList.empty())
{
StarvationCallbacks.OnBufferEmpty();
// Try again until the memory is avalable
return Allocate();
}
}
}
T* ret = m_FreeList.front();
m_FreeList.pop_front();
return ret;
}
void Free(T* ptr)
{
m_FreeList.push_front(ptr);
if (m_FreeList.size() == BufferSize)
{
StarvationCallbacks.OnStopUsingBuffer();
}
}
private:
std::list<T*> m_FreeList;
}
|
#pragma once
template<class T, size_t BufferSize, class StarvationCallbacks>
class AllocationPool {
public:
~AllocationPool()
{
while (!m_FreeList.empty())
{
delete m_FreeList.front();
m_FreeList.pop_front();
}
}
T* Allocate()
{
if (m_FreeList.Size() <= BufferSize)
{
try
{
return new T;
}
catch (std::bad_alloc& ex)
{
if (m_FreeList.size() == BufferSize)
{
StarvationCallbacks.OnStartingUsingBuffer();
}
else if (m_FreeList.empty())
{
StarvationCallbacks.OnBufferEmpty();
// Try again until the memory is avalable
return Allocate();
}
}
}
// placement new, used to initalize the object
T* ret = new (m_FreeList.front()) T;
m_FreeList.pop_front();
return ret;
}
void Free(T* ptr)
{
// placement destruct.
ptr->~T();
m_FreeList.push_front(ptr);
if (m_FreeList.size() == BufferSize)
{
StarvationCallbacks.OnStopUsingBuffer();
}
}
private:
std::list<void *> m_FreeList;
}
| Use placement new to initalise objects | Use placement new to initalise objects
| C | apache-2.0 | Tri125/MCServer,kevinr/cuberite,bendl/cuberite,Fighter19/cuberite,Fighter19/cuberite,Altenius/cuberite,electromatter/cuberite,Altenius/cuberite,zackp30/cuberite,birkett/MCServer,Howaner/MCServer,SamOatesPlugins/cuberite,ionux/MCServer,zackp30/cuberite,johnsoch/cuberite,zackp30/cuberite,nounoursheureux/MCServer,birkett/cuberite,birkett/MCServer,thetaeo/cuberite,thetaeo/cuberite,johnsoch/cuberite,nicodinh/cuberite,mmdk95/cuberite,mjssw/cuberite,Haxi52/cuberite,ionux/MCServer,QUSpilPrgm/cuberite,mjssw/cuberite,birkett/cuberite,Fighter19/cuberite,mmdk95/cuberite,linnemannr/MCServer,linnemannr/MCServer,tonibm19/cuberite,SamOatesPlugins/cuberite,nichwall/cuberite,guijun/MCServer,thetaeo/cuberite,Schwertspize/cuberite,Tri125/MCServer,guijun/MCServer,Haxi52/cuberite,mmdk95/cuberite,Howaner/MCServer,bendl/cuberite,Tri125/MCServer,guijun/MCServer,bendl/cuberite,nounoursheureux/MCServer,ionux/MCServer,HelenaKitty/EbooMC,HelenaKitty/EbooMC,SamOatesPlugins/cuberite,ionux/MCServer,Altenius/cuberite,marvinkopf/cuberite,QUSpilPrgm/cuberite,thetaeo/cuberite,nichwall/cuberite,nevercast/cuberite,tonibm19/cuberite,linnemannr/MCServer,kevinr/cuberite,Tri125/MCServer,Tri125/MCServer,zackp30/cuberite,nichwall/cuberite,electromatter/cuberite,mc-server/MCServer,birkett/MCServer,electromatter/cuberite,jammet/MCServer,HelenaKitty/EbooMC,nicodinh/cuberite,linnemannr/MCServer,mmdk95/cuberite,Altenius/cuberite,nicodinh/cuberite,Haxi52/cuberite,tonibm19/cuberite,birkett/MCServer,guijun/MCServer,Haxi52/cuberite,nichwall/cuberite,thetaeo/cuberite,thetaeo/cuberite,bendl/cuberite,marvinkopf/cuberite,jammet/MCServer,mc-server/MCServer,mjssw/cuberite,QUSpilPrgm/cuberite,nicodinh/cuberite,HelenaKitty/EbooMC,Fighter19/cuberite,Schwertspize/cuberite,Schwertspize/cuberite,birkett/cuberite,Haxi52/cuberite,tonibm19/cuberite,QUSpilPrgm/cuberite,tonibm19/cuberite,Howaner/MCServer,guijun/MCServer,Frownigami1/cuberite,mjssw/cuberite,marvinkopf/cuberite,tonibm19/cuberite,nichwall/cuberite,jammet/MCServer,mc-server/MCServer,johnsoch/cuberite,Howaner/MCServer,ionux/MCServer,nicodinh/cuberite,SamOatesPlugins/cuberite,mjssw/cuberite,Altenius/cuberite,marvinkopf/cuberite,mc-server/MCServer,kevinr/cuberite,kevinr/cuberite,zackp30/cuberite,mmdk95/cuberite,electromatter/cuberite,nounoursheureux/MCServer,nounoursheureux/MCServer,Tri125/MCServer,mjssw/cuberite,jammet/MCServer,bendl/cuberite,Frownigami1/cuberite,kevinr/cuberite,nicodinh/cuberite,birkett/cuberite,marvinkopf/cuberite,nichwall/cuberite,Howaner/MCServer,mc-server/MCServer,Schwertspize/cuberite,johnsoch/cuberite,nevercast/cuberite,birkett/MCServer,jammet/MCServer,johnsoch/cuberite,QUSpilPrgm/cuberite,birkett/cuberite,HelenaKitty/EbooMC,ionux/MCServer,linnemannr/MCServer,kevinr/cuberite,birkett/cuberite,nounoursheureux/MCServer,Howaner/MCServer,mmdk95/cuberite,QUSpilPrgm/cuberite,nevercast/cuberite,electromatter/cuberite,birkett/MCServer,Fighter19/cuberite,jammet/MCServer,Schwertspize/cuberite,nevercast/cuberite,guijun/MCServer,linnemannr/MCServer,Frownigami1/cuberite,Frownigami1/cuberite,Haxi52/cuberite,nounoursheureux/MCServer,zackp30/cuberite,nevercast/cuberite,electromatter/cuberite,marvinkopf/cuberite,nevercast/cuberite,Frownigami1/cuberite,SamOatesPlugins/cuberite,mc-server/MCServer,Fighter19/cuberite |
3c3a26b636db7c29db9746b34493bc8f389583d3 | corrcheck.h | corrcheck.h | #ifndef CORRCHECK_H
#define CORRCHECK_H
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <dirent.h>
#include <iostream>
#include <map>
#include <openssl/ssl.h>
#include <string>
#include <sys/stat.h>
#include <vector>
#include "corrcheck_defines.h"
#include "File.h"
int create_database(const std::string& directory);
int update_database();
int verify_database(const std::string& directory);
int write_database(const std::string& directory, const File* file_list);
#endif
| #ifndef CORRCHECK_H
#define CORRCHECK_H
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <dirent.h>
#include <iostream>
#include <map>
#include <openssl/ssl.h>
#include <string>
#include <sys/stat.h>
#include <vector>
#include "corrcheck_defines.h"
#include "File.h"
/*
Create a .corrcheckdb of the files in a directory given by 'directory'.
Returns SUCCESS (0) if no errors occur; returns FAILURE (1) otherwise.
*/
int create_database(const std::string& directory);
/*
---NOT IMPLEMENTED---
Rewrite the .corrcheckdb of the files in a directory while notifying of
apparent changes since creation or last update.
*/
int update_database();
/*
Check the .corrcheckdb of the files in a directory given by 'directory' and
notify of apparent changes since creation or last update. This function does not
modify the .corrcheckdb file.
*/
int verify_database(const std::string& directory);
/*
Write a .corrcheckdb in the directory given by 'directory' based on the list of
files given as 'file_list', overwriting any that may already be present.
*/
int write_database(const std::string& directory, const File* file_list);
#endif
| Write more brief function descriptions. | Write more brief function descriptions.
| C | mit | mdclyburn/corrcheck,mdclyburn/corrcheck |
d537d6c355be1a51bbb808e9da214f5595d75f3d | ios/web/public/browser_state.h | ios/web/public/browser_state.h | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_WEB_PUBLIC_BROWSER_STATE_H_
#define IOS_WEB_PUBLIC_BROWSER_STATE_H_
#include "base/supports_user_data.h"
namespace net {
class URLRequestContextGetter;
}
namespace web {
// This class holds the context needed for a browsing session.
// It lives on the UI thread. All these methods must only be called on the UI
// thread.
class BrowserState : public base::SupportsUserData {
public:
~BrowserState() override;
// Return whether this BrowserState is incognito. Default is false.
virtual bool IsOffTheRecord() const = 0;
// Returns the request context information associated with this
// BrowserState.
virtual net::URLRequestContextGetter* GetRequestContext() = 0;
protected:
BrowserState();
};
} // namespace web
#endif // IOS_WEB_PUBLIC_BROWSER_STATE_H_
| // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_WEB_PUBLIC_BROWSER_STATE_H_
#define IOS_WEB_PUBLIC_BROWSER_STATE_H_
#include "base/supports_user_data.h"
namespace base {
class FilePath;
}
namespace net {
class URLRequestContextGetter;
}
namespace web {
// This class holds the context needed for a browsing session.
// It lives on the UI thread. All these methods must only be called on the UI
// thread.
class BrowserState : public base::SupportsUserData {
public:
~BrowserState() override;
// Return whether this BrowserState is incognito. Default is false.
virtual bool IsOffTheRecord() const = 0;
// Retrieves the path where the BrowserState data is stored.
virtual base::FilePath GetPath() const = 0;
// Returns the request context information associated with this
// BrowserState.
virtual net::URLRequestContextGetter* GetRequestContext() = 0;
protected:
BrowserState();
};
} // namespace web
#endif // IOS_WEB_PUBLIC_BROWSER_STATE_H_
| Expand web::BrowserState to add GetPath() method | Expand web::BrowserState to add GetPath() method
Add a method to web::BrowserState returning the path where the
BrowserState data is stored.
BUG=429756
Review URL: https://codereview.chromium.org/740353002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#305191}
| C | bsd-3-clause | krieger-od/nwjs_chromium.src,dednal/chromium.src,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ltilve/chromium,krieger-od/nwjs_chromium.src,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,Fireblend/chromium-crosswalk,dushu1203/chromium.src,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,dednal/chromium.src,fujunwei/chromium-crosswalk,ltilve/chromium,Chilledheart/chromium,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,ltilve/chromium,M4sse/chromium.src,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,dednal/chromium.src,Fireblend/chromium-crosswalk,markYoungH/chromium.src,M4sse/chromium.src,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,ltilve/chromium,dushu1203/chromium.src,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,M4sse/chromium.src,Just-D/chromium-1,Jonekee/chromium.src,dednal/chromium.src,Chilledheart/chromium,ltilve/chromium,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,Just-D/chromium-1,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,ltilve/chromium,krieger-od/nwjs_chromium.src,dednal/chromium.src,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,Jonekee/chromium.src,Just-D/chromium-1,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,Just-D/chromium-1,Just-D/chromium-1,M4sse/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,dushu1203/chromium.src,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,ltilve/chromium,dushu1203/chromium.src,jaruba/chromium.src,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk,dednal/chromium.src,M4sse/chromium.src,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,Just-D/chromium-1,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,fujunwei/chromium-crosswalk,Chilledheart/chromium,markYoungH/chromium.src,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,M4sse/chromium.src,M4sse/chromium.src,markYoungH/chromium.src,Jonekee/chromium.src,jaruba/chromium.src,axinging/chromium-crosswalk,ltilve/chromium,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk,Just-D/chromium-1,dushu1203/chromium.src,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,chuan9/chromium-crosswalk,Chilledheart/chromium,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,fujunwei/chromium-crosswalk,Jonekee/chromium.src,Jonekee/chromium.src,jaruba/chromium.src,krieger-od/nwjs_chromium.src,jaruba/chromium.src,jaruba/chromium.src,markYoungH/chromium.src,M4sse/chromium.src,chuan9/chromium-crosswalk,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,hgl888/chromium-crosswalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,chuan9/chromium-crosswalk,ltilve/chromium,krieger-od/nwjs_chromium.src,dednal/chromium.src,Just-D/chromium-1,dednal/chromium.src,krieger-od/nwjs_chromium.src,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,Just-D/chromium-1,Pluto-tv/chromium-crosswalk |
410ca053a96733f7ce48010c50c91f7104967f57 | includes/score.h | includes/score.h | #ifndef SCORE_H_INCLUDED
#define SCORE_H_INCLUDED
#define FOOD1_SCORE 15 //Titik
#define FOOD2_SCORE 100 //Sedap Malam
#define FOOD3_SCORE 300 //Menyan
#define FOOD4_SCORE 500 //Melati
#define FOOD5_SCORE 700 //Kopi Hitam
typedef struct{
char *name;
int score;
int lives;
int foodCount;
pacmanController peciman;
ghostController ghost1;
ghostController ghost2;
ghostController ghost3;
ghostController ghost4;
} playerControl;
void initScore(playerControl *player);
void initLives(playerControl *player);
void incScore(int food, playerControl *player);
void eatFood(playerControl *player);
void incLives(playerControl *player, int *liveGiven);
int randomise(int min, int max);
int foodType(int x);
void spawnFood(MapController *map, int posX, int posY);
void despawnFood(MapController *map, int posX, int posY);
void randFoodPos();
void drawNumber(int x, int posX, int posY, int posisi);
void printScore(int score, int posX, int posY);
void printLives(int lives, int posX, int posY);
#endif // SCORE_H_INCLUDED
| #ifndef SCORE_H_INCLUDED
#define SCORE_H_INCLUDED
#define FOOD1_SCORE 15 //Titik
#define FOOD2_SCORE 100 //Sedap Malam
#define FOOD3_SCORE 300 //Menyan
#define FOOD4_SCORE 500 //Melati
#define FOOD5_SCORE 700 //Kopi Hitam
typedef struct{
char *name;
int score;
int lives;
int foodCount;
int level;
pacmanController peciman;
ghostController ghost1;
ghostController ghost2;
ghostController ghost3;
ghostController ghost4;
} playerControl;
void initScore(playerControl *player);
void initLives(playerControl *player);
void incScore(int food, playerControl *player);
void eatFood(playerControl *player);
void incLives(playerControl *player, int *liveGiven);
int randomise(int min, int max);
int foodType(int x);
void spawnFood(MapController *map, int posX, int posY);
void despawnFood(MapController *map, int posX, int posY);
void randFoodPos();
void drawNumber(int x, int posX, int posY, int posisi);
void printScore(int score, int posX, int posY);
void printLives(int lives, int posX, int posY);
#endif // SCORE_H_INCLUDED
| Add level field in playercontroller | Add level field in playercontroller
| C | mit | syamcode/PecimenGame,syamcode/PecimenGame |
0ae863aa45b829a1030a0917e7e4f8dc8274aac6 | src/bitwise.h | src/bitwise.h | #pragma once
#include <cstdint>
inline uint16_t compose_bytes(const uint8_t low, const uint8_t high) {
return (high << 8) + low;
};
inline bool check_bit(const uint8_t value, int bit) {
return (value & (1 << bit)) != 0;
};
inline uint8_t set_bit(const uint8_t value, int bit) {
return static_cast<uint8_t>(value | (1 << bit));
}
| #pragma once
#include <cstdint>
inline uint16_t compose_bytes(const uint8_t low, const uint8_t high) {
return (high << 8) + low;
}
inline bool check_bit(const uint8_t value, int bit) {
return (value & (1 << bit)) != 0;
}
inline uint8_t set_bit(const uint8_t value, int bit) {
return static_cast<uint8_t>(value | (1 << bit));
}
| Remove extraneous ; on function definition | Remove extraneous ; on function definition
| C | bsd-3-clause | jgilchrist/emulator,jgilchrist/emulator,jgilchrist/emulator |
a64aac47da8b3bf66b2fd3cf973508a8ce7d23a8 | test/CodeGen/ms-inline-asm-EVEN.c | test/CodeGen/ms-inline-asm-EVEN.c | // RUN: %clang_cc1 %s -triple i386-unknown-unknown -fasm-blocks -emit-llvm -o - | FileCheck %s
// CHECK: .byte 64
// CHECK: .byte 64
// CHECK: .byte 64
// CHECK: .even
void t1() {
__asm {
.byte 64
.byte 64
.byte 64
EVEN
mov eax, ebx
}
}
| // REQUIRES: x86-registered-target
// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -fasm-blocks -emit-llvm -o - | FileCheck %s
// CHECK: .byte 64
// CHECK: .byte 64
// CHECK: .byte 64
// CHECK: .even
void t1() {
__asm {
.byte 64
.byte 64
.byte 64
EVEN
mov eax, ebx
}
}
| Add support for MS 'EVEN' directive | [fixup][X86][inline-asm] Add support for MS 'EVEN' directive
refining tested targets resolution, to amend failures caused by rL299454
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@299459 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang |
a126e4a44a567136b83b21e436b6b8cf27c81472 | chapter27/chapter27_ex14.c | chapter27/chapter27_ex14.c | /* Chapter 27, exercise 14: write a function that takes an array of int as input
and finds the smallest and the largest elements as well as the median and
mean; return the result in a struct holding the values */
#include<stddef.h>
#include<string.h>
#include<stdlib.h>
#include<assert.h>
#include<stdio.h>
struct Result {
int min;
int max;
double median;
double mean;
};
int cmpint(const void* a, const void* b)
{
int aa = *(int*)a;
int bb = *(int*)b;
if (aa<bb)
return -1;
else if (bb<aa)
return 1;
else
return 0;
}
int array_sum(int* int_array, size_t size)
{
int sum = 0;
int i;
for (i = 0; i<size; ++i)
sum += int_array[i];
return sum;
}
struct Result* array_data(int* int_array, size_t size)
{
assert(int_array);
assert(size > 0);
{
int* array_cpy = (int*)malloc(size*sizeof(int)); /* copy to play with */
struct Result* res = (struct Result*)malloc(sizeof(struct Result));
memcpy(array_cpy,int_array,size*sizeof(int));
qsort(array_cpy,size,sizeof(int),cmpint);
res->min = array_cpy[0];
res->max = array_cpy[size-1];
if (size % 2) /* odd number of elements */
res->median = array_cpy[size/2];
else /* even number - median is mean of two elements */
res->median = (array_cpy[size/2-1] + array_cpy[size/2]) / 2.0;
res->mean = (double)array_sum(int_array,size) / size;
free(array_cpy);
return res;
}
}
void print_result(struct Result* res)
{
printf("min: %d\nmax: %d\nmean: %f\nmedian: %f\n",
res->min,res->max,res->mean,res->median);
}
int main()
{
int arr1[] = { 3, 2, 5, 4, 1 };
int arr2[] = { 5, 1, 7, 4, 8, 4 };
struct Result* res1 = array_data(arr1,sizeof(arr1)/sizeof(int));
struct Result* res2 = array_data(arr2,sizeof(arr2)/sizeof(int));
printf("arr1:\n");
print_result(res1);
printf("\narr2:\n");
print_result(res2);
free(res1);
free(res2);
}
| Add Chapter 27, exercise 14 | Add Chapter 27, exercise 14
| C | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp |
|
5db7606fc0cc7b83c145f4d861efb0ba0ad4c2d0 | src/gethost.c | src/gethost.c | #include <stdio.h>
#ifdef WIN32
#include <io.h>
#include <fcntl.h>
#endif
int
gethost_main()
{
extern char *sccs_gethost();
char *host;
#ifdef WIN32
setmode(1, _O_BINARY);
#endif
host = sccs_gethost();
if ((host == NULL) || (*host == '\0')) return (1);
printf("%s\n", host);
return (0);
}
| #include <stdio.h>
#ifdef WIN32
#include <io.h>
#include <fcntl.h>
#endif
int
gethost_main()
{
extern char *sccs_gethost();
char *host;
#ifdef WIN32
setmode(1, _O_BINARY);
#endif
host = sccs_gethost();
if ((host == NULL) || (*host == '\0')) return (1);
printf("%s\n", host);
/* make isure we have a good domain name */
if (strchr(host, '.') == NULL) return (1);
return (0);
}
| Add two more check to x.chk_env a) make sure host name have at least one dot b) add a http test | Add two more check to x.chk_env
a) make sure host name have at least one dot
b) add a http test
bk: 39466063LfKperUt13MbGKJrzx5juA | C | apache-2.0 | bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper |
f0e79447ff7242b7da56bb5c1322c83c6abce641 | include/shmlog_tags.h | include/shmlog_tags.h | /*
* $Id$
*
* Define the tags in the shared memory in a reusable format.
* Whoever includes this get to define what the SLTM macro does.
*
*/
SLTM(Debug)
SLTM(Error)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionReuse)
SLTM(SessionClose)
SLTM(BackendOpen)
SLTM(BackendXID)
SLTM(BackendReuse)
SLTM(BackendClose)
SLTM(HttpError)
SLTM(ClientAddr)
SLTM(Backend)
SLTM(Request)
SLTM(Response)
SLTM(Length)
SLTM(Status)
SLTM(URL)
SLTM(Protocol)
SLTM(Header)
SLTM(BldHdr)
SLTM(LostHeader)
SLTM(VCL_call)
SLTM(VCL_trace)
SLTM(VCL_return)
SLTM(XID)
SLTM(ExpBan)
SLTM(ExpPick)
SLTM(ExpKill)
| /*
* $Id$
*
* Define the tags in the shared memory in a reusable format.
* Whoever includes this get to define what the SLTM macro does.
*
*/
SLTM(Debug)
SLTM(Error)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionReuse)
SLTM(SessionClose)
SLTM(BackendOpen)
SLTM(BackendXID)
SLTM(BackendReuse)
SLTM(BackendClose)
SLTM(HttpError)
SLTM(ClientAddr)
SLTM(Backend)
SLTM(Request)
SLTM(Response)
SLTM(Length)
SLTM(Status)
SLTM(URL)
SLTM(Protocol)
SLTM(Header)
SLTM(BldHdr)
SLTM(LostHeader)
SLTM(VCL_call)
SLTM(VCL_trace)
SLTM(VCL_return)
SLTM(XID)
SLTM(Hit)
SLTM(ExpBan)
SLTM(ExpPick)
SLTM(ExpKill)
| Add shmem tag for Hits | Add shmem tag for Hits
git-svn-id: 2c9807fa3ff65b17195bd55dc8a6c4261e10127b@361 d4fa192b-c00b-0410-8231-f00ffab90ce4
| C | bsd-2-clause | alarky/varnish-cache-doc-ja,ajasty-cavium/Varnish-Cache,chrismoulton/Varnish-Cache,alarky/varnish-cache-doc-ja,chrismoulton/Varnish-Cache,mrhmouse/Varnish-Cache,ssm/pkg-varnish,franciscovg/Varnish-Cache,franciscovg/Varnish-Cache,1HLtd/Varnish-Cache,1HLtd/Varnish-Cache,drwilco/varnish-cache-drwilco,ambernetas/varnish-cache,ajasty-cavium/Varnish-Cache,alarky/varnish-cache-doc-ja,feld/Varnish-Cache,ajasty-cavium/Varnish-Cache,alarky/varnish-cache-doc-ja,gquintard/Varnish-Cache,mrhmouse/Varnish-Cache,gauthier-delacroix/Varnish-Cache,wikimedia/operations-debs-varnish,chrismoulton/Varnish-Cache,gauthier-delacroix/Varnish-Cache,varnish/Varnish-Cache,wikimedia/operations-debs-varnish,zhoualbeart/Varnish-Cache,gauthier-delacroix/Varnish-Cache,mrhmouse/Varnish-Cache,drwilco/varnish-cache-old,zhoualbeart/Varnish-Cache,drwilco/varnish-cache-old,ambernetas/varnish-cache,drwilco/varnish-cache-drwilco,varnish/Varnish-Cache,ambernetas/varnish-cache,zhoualbeart/Varnish-Cache,gquintard/Varnish-Cache,wikimedia/operations-debs-varnish,1HLtd/Varnish-Cache,gauthier-delacroix/Varnish-Cache,ssm/pkg-varnish,wikimedia/operations-debs-varnish,franciscovg/Varnish-Cache,alarky/varnish-cache-doc-ja,gquintard/Varnish-Cache,franciscovg/Varnish-Cache,ajasty-cavium/Varnish-Cache,ssm/pkg-varnish,zhoualbeart/Varnish-Cache,feld/Varnish-Cache,ssm/pkg-varnish,gquintard/Varnish-Cache,feld/Varnish-Cache,mrhmouse/Varnish-Cache,feld/Varnish-Cache,franciscovg/Varnish-Cache,feld/Varnish-Cache,ssm/pkg-varnish,mrhmouse/Varnish-Cache,ajasty-cavium/Varnish-Cache,gauthier-delacroix/Varnish-Cache,wikimedia/operations-debs-varnish,zhoualbeart/Varnish-Cache,1HLtd/Varnish-Cache,chrismoulton/Varnish-Cache,varnish/Varnish-Cache,varnish/Varnish-Cache,drwilco/varnish-cache-old,drwilco/varnish-cache-drwilco,chrismoulton/Varnish-Cache,varnish/Varnish-Cache |
bf737e99dd9fb759499919236142eb1da80cabab | includes/Rasterizer.h | includes/Rasterizer.h | #ifndef RASTERIZER_H
#define RASTERIZER_H
#include <string>
#include "Renderer.h"
class Rasterizer : public Renderer {
private:
const float k_a = 0.1;
const RGBColor AMBIENT_COLOR = RGBColor(1.0f, 1.0f, 1.0f);
public:
Rasterizer();
Rasterizer(World* world, const uint16_t image_width, const uint16_t image_height);
~Rasterizer();
const RGBColor shade(const GeometryObject& object, const Triangle3D& triangle, const Point3D point_in_triangle) const override;
void render(const std::string output_path) override;
private:
const RGBColor phongShading(const Material& material, const RGBColor& base_color, const Triangle3D& triangle, const Point3D& point_in_triangle) const;
const RGBColor blinnPhongShading(const Material& material, const RGBColor& base_color, const Triangle3D& triangle, const Point3D& point_in_triangle) const;
};
#endif /* RASTERIZER_H */
| #ifndef RASTERIZER_H
#define RASTERIZER_H
#include <string>
#include "Renderer.h"
class Rasterizer : public Renderer {
private:
const float k_a = 0.1;
const RGBColor AMBIENT_COLOR = RGBColor(1.0f, 1.0f, 1.0f);
public:
Rasterizer();
Rasterizer(World* world, const uint16_t image_width, const uint16_t image_height);
~Rasterizer();
const RGBColor shade(const GeometryObject& object, const Triangle3D& triangle, const Point3D point_in_triangle) const override;
void render(const std::string output_path) override;
private:
const Triangle2D toRaster(const Triangle3D& triangle_world) const;
const float getDepth(const Triangle3D& triangle_world, const Triangle2D& triangle_raster, const Point2D& pixel_raster) const;
const RGBColor phongShading(const Material& material, const RGBColor& base_color, const Triangle3D& triangle, const Point3D& point_in_triangle) const;
const RGBColor blinnPhongShading(const Material& material, const RGBColor& base_color, const Triangle3D& triangle, const Point3D& point_in_triangle) const;
};
#endif /* RASTERIZER_H */
| Refactor render method to make it simpler | Refactor render method to make it simpler
| C | mit | mtrebi/Rasterizer,mtrebi/Rasterizer |
b1fbb1ab644467a5b2f1eb96697a5fd17ee49c59 | ykbzero.h | ykbzero.h | /* -*- mode:C; c-file-style: "bsd" -*- */
/*
* Copyright (c) 2008-2019 Yubico AB
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __YKBZERO_H_INCLUDED__
#define __YKBZERO_H_INCLUDED__
#ifdef _WIN32
#include <windows.h>
#else
#include <string.h>
#endif
#ifdef _WIN32
#define insecure_memzero(buf, len) SecureZeroMemory(buf, len)
#elif HAVE_MEMSET_S
#define insecure_memzero(buf, len) memset_s(buf, len, 0, len)
#elif HAVE_EXPLICIT_BZERO
#define insecure_memzero(buf, len) explicit_bzero(buf, len)
#elif HAVE_EXPLICIT_MEMSET
#define insecure_memzero(buf, len) explicit_memset(buf, 0, len)
#elif HAVE_INLINE_ASM
#define insecure_memzero(buf, len) do { \
memset(buf, 0, len); \
__asm__ __volatile__ ("" : : "r"(buf) : "memory"); \
} while (0)
#else
#define insecure_memzero(buf, len) do { \
volatile unsigned char *volatile __buf_ = \
(volatile unsigned char *volatile)buf; \
size_t __i_ = 0; \
while (__i_ < len) __buf_[__i_++] = 0; \
} while (0)
#endif
#endif /* __YKBZERO_H_INCLUDED__ */
| Add missing header file missing in the last commit | Add missing header file missing in the last commit
| C | bsd-2-clause | eworm-de/yubico-pam,Yubico/yubico-pam,Yubico/yubico-pam,Yubico/yubico-pam,eworm-de/yubico-pam,eworm-de/yubico-pam |
|
d94d8d1afeaecbde0ed644de30a51f19f3b170dd | examples/picovic.c | examples/picovic.c | /* shadowVIC – Copyright (c) 2015 Sven Michael Klose <[email protected]> */
#include <stdio.h>
#include "types.h"
#include "config.h"
#include "6502.h"
#include "shadowvic.h"
#include "joystick.h"
#include "video.h"
#include "sync.h"
#define FALSE 0
#define TRUE 1
int
main (int argc, char * argv[])
{
struct vic20_config config = {
.is_expanded = FALSE,
.use_paddles = FALSE,
.manual_screen_updates = FALSE,
.frames_per_second = 50,
.frame_interceptor = NULL
};
printf ("shadowVIC – https://github.com/SvenMichaelKlose/shadowvic/");
joystick_open ();
video_open ();
video_map ();
vic20_open (&config);
vic20_emulate (m[0xfffc] + (m[0xfffd] << 8));
vic20_close ();
video_close ();
joystick_close ();
return 0;
}
| /* shadowVIC – Copyright (c) 2015 Sven Michael Klose <[email protected]> */
#include <stdio.h>
#include "types.h"
#include "config.h"
#include "6502.h"
#include "shadowvic.h"
#include "joystick.h"
#include "video.h"
#include "sync.h"
#define FALSE 0
#define TRUE 1
int
main (int argc, char * argv[])
{
struct vic20_config config = {
.is_expanded = FALSE,
.use_paddles = FALSE,
.manual_screen_updates = FALSE,
.frames_per_second = 50,
.frame_interceptor = NULL
};
printf ("picoVIC – https://github.com/SvenMichaelKlose/shadowvic/\n");
joystick_open ();
video_open ();
video_map ();
vic20_open (&config);
vic20_emulate (m[0xfffc] + (m[0xfffd] << 8));
vic20_close ();
video_close ();
joystick_close ();
return 0;
}
| Print welcome message with application name and newline. | Print welcome message with application name and newline.
| C | mit | SvenMichaelKlose/shadowvic,SvenMichaelKlose/shadowvic |
ec73e01d1ec3837eb103e408b6fdc19b58fd6787 | projects/switch/mains/uart/main.c | projects/switch/mains/uart/main.c |
#include "main.h"
#include <msp430.h>
#include "led_driver.h"
int main(void)
{
WDTCTL = WDTPW + WDTHOLD;
led_initialize((led_addresses_s*)P1IN_);
P1DIR = 0x04;
P1SEL = 0x06;
UCA0CTL0 = 0x00;
UCA0CTL1 = UCSSEL_3;
UCA0BR0 = 104;
UCA0BR1 = 0x00;
UCA0MCTL = 0x03 << 4;
set_led_color(LED_GREEN);
while(1)
{
if(UCA0STAT & 0x01 == 0x00)
{
UCA0TXBUF = 0x5a;
}
}
}
|
#include "main.h"
#include <msp430.h>
#include "led_driver.h"
void main(void)
{
WDTCTL = WDTPW + WDTHOLD;
//Set clock to 1MHz
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;
led_initialize((led_addresses_s*)P1IN_);
P1DIR |= 0x04;
P1SEL |= 0x06;
P1SEL2 |= 0x06;
UCA0CTL0 |= 0x00;
UCA0CTL1 |= UCSSEL_2;
UCA0BR0 = 104;
UCA0BR1 = 0x00;
UCA0MCTL = UCBRS0;
UCA0CTL1 &= ~UCSWRST;
set_led_color(LED_GREEN);
while(1)
{
if((IFG2 & UCA0TXIFG) == UCA0TXIFG)
{
UCA0TXBUF = 0x5a;
}
//IE2 |= UCA0TXIE; // Enable USCI_A0 TX interrupt
//__bis_SR_register(LPM0_bits + GIE); // Enter LPM0, interrupts enabled
}
}
#pragma vector=USCIAB0TX_VECTOR
__interrupt void TX_Ready(void)
{
if((IFG2 & UCA0TXIFG) == UCA0TXIFG)
{
UCA0TXBUF = 0x5a;
}
}
| Send '0x5A' across UART continuously. | Send '0x5A' across UART continuously.
| C | bsd-2-clause | sep/ping-pong-platform,sep/ping-pong-platform,sep/ping-pong-platform |
538fbb508663e8c091f7e129ec36a6c7e6a4f1b1 | include/llvm/ADT/StringSet.h | include/llvm/ADT/StringSet.h | //===--- StringSet.h - The LLVM Compiler Driver -----------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open
// Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// StringSet - A set-like wrapper for the StringMap.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_ADT_STRINGSET_H
#define LLVM_ADT_STRINGSET_H
#include "llvm/ADT/StringMap.h"
#include <cassert>
namespace llvm {
/// StringSet - A wrapper for StringMap that provides set-like
/// functionality. Only insert() and count() methods are used by my
/// code.
template <class AllocatorTy = llvm::MallocAllocator>
class StringSet : public llvm::StringMap<char, AllocatorTy> {
typedef llvm::StringMap<char, AllocatorTy> base;
public:
bool insert (const std::string& InLang) {
assert(!InLang.empty());
const char* KeyStart = &InLang[0];
const char* KeyEnd = KeyStart + InLang.size();
return base::insert(llvm::StringMapEntry<char>::
Create(KeyStart, KeyEnd, base::getAllocator(), '+'));
}
};
}
#endif // LLVM_ADT_STRINGSET_H
| //===--- StringSet.h - The LLVM Compiler Driver -----------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open
// Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// StringSet - A set-like wrapper for the StringMap.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_ADT_STRINGSET_H
#define LLVM_ADT_STRINGSET_H
#include "llvm/ADT/StringMap.h"
#include <cassert>
namespace llvm {
/// StringSet - A wrapper for StringMap that provides set-like
/// functionality. Only insert() and count() methods are used by my
/// code.
template <class AllocatorTy = llvm::MallocAllocator>
class StringSet : public llvm::StringMap<char, AllocatorTy> {
typedef llvm::StringMap<char, AllocatorTy> base;
public:
bool insert(const std::string& InLang) {
assert(!InLang.empty());
const char* KeyStart = &InLang[0];
const char* KeyEnd = KeyStart + InLang.size();
return base::insert(llvm::StringMapEntry<char>::
Create(KeyStart, KeyEnd, base::getAllocator(), '+'));
}
};
}
#endif // LLVM_ADT_STRINGSET_H
| Remove extra blank line and space. | Remove extra blank line and space.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@61916 91177308-0d34-0410-b5e6-96231b3b80d8
| C | bsd-2-clause | dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm |
d71a3e7b93a9d7f4a4e95d40d4fc91b59afae358 | src/hal/classicladder/classicladder_gtk.h | src/hal/classicladder/classicladder_gtk.h | void UpdateVScrollBar();
void save_label_comment_edited();
void refresh_label_comment( void );
void clear_label_comment();
void autorize_prevnext_buttons(int Yes);
void ShowMessageBox(const char * title, const char * text, const char * button);
void ShowConfirmationBoxWithChoiceOrNot(const char * title, const char * text, void * function_if_yes, char HaveTheChoice);
void ShowConfirmationBox(const char * title, const char * text, void * function_if_yes);
void RefreshOneBoolVar( int Type, int Num, int Val );
void RefreshAllBoolsVars( );
void UpdateAllLabelsBoolsVars( );
void DoQuitGtkApplication( void );
void DoReset( );
void MessageInStatusBar( char * msg );
void InitGtkWindows( int argc, char *argv[] );
void UpdateAllGtkWindows( void );
void UpdateWindowTitleWithProjectName( void );
| void UpdateVScrollBar();
void save_label_comment_edited();
void refresh_label_comment( void );
void clear_label_comment();
void autorize_prevnext_buttons(int Yes);
void ShowMessageBox(const char * title, const char * text, const char * button);
void ShowConfirmationBoxWithChoiceOrNot(const char * title, const char * text, void * function_if_yes, char HaveTheChoice);
void ShowConfirmationBox(const char * title, const char * text, void * function_if_yes);
void RefreshOneBoolVar( int Type, int Num, int Val );
void RefreshAllBoolsVars( );
void UpdateAllLabelsBoolsVars( );
void DoQuitGtkApplication( void );
void DoReset( );
void MessageInStatusBar( char * msg );
void InitGtkWindows( int argc, char *argv[] );
void UpdateAllGtkWindows( void );
void UpdateWindowTitleWithProjectName( void );
void ShowErrorMessage(const char * title, const char * text, const char * button);
void CheckForErrors (void);
| Add a message window to display %E variable controlled errors with out grabing focus | Add a message window to display %E variable controlled errors with out grabing focus
| C | lgpl-2.1 | RunningLight/machinekit,Cid427/machinekit,unseenlaser/linuxcnc,RunningLight/machinekit,bobvanderlinden/machinekit,ArcEye/machinekit-testing,ikcalB/linuxcnc-mirror,bmwiedemann/linuxcnc-mirror,kinsamanka/machinekit,araisrobo/linuxcnc,kinsamanka/machinekit,cdsteinkuehler/linuxcnc,ArcEye/machinekit-testing,unseenlaser/linuxcnc,araisrobo/machinekit,unseenlaser/linuxcnc,cnc-club/linuxcnc,mhaberler/machinekit,cdsteinkuehler/linuxcnc,Cid427/machinekit,aschiffler/linuxcnc,bobvanderlinden/machinekit,EqAfrica/machinekit,kinsamanka/machinekit,mhaberler/machinekit,unseenlaser/machinekit,araisrobo/linuxcnc,ArcEye/MK-Qt5,cdsteinkuehler/MachineKit,bobvanderlinden/machinekit,mhaberler/machinekit,bmwiedemann/linuxcnc-mirror,ArcEye/machinekit-testing,araisrobo/linuxcnc,ArcEye/MK-Qt5,strahlex/machinekit,unseenlaser/machinekit,ianmcmahon/linuxcnc-mirror,cdsteinkuehler/linuxcnc,bobvanderlinden/machinekit,bobvanderlinden/machinekit,strahlex/machinekit,araisrobo/machinekit,yishinli/emc2,EqAfrica/machinekit,cdsteinkuehler/MachineKit,EqAfrica/machinekit,cnc-club/linuxcnc,ikcalB/linuxcnc-mirror,cnc-club/linuxcnc,araisrobo/machinekit,jaguarcat79/ILC-with-LinuxCNC,bmwiedemann/linuxcnc-mirror,bmwiedemann/linuxcnc-mirror,aschiffler/linuxcnc,kinsamanka/machinekit,mhaberler/machinekit,araisrobo/machinekit,ArcEye/MK-Qt5,narogon/linuxcnc,ArcEye/MK-Qt5,jaguarcat79/ILC-with-LinuxCNC,araisrobo/linuxcnc,RunningLight/machinekit,ArcEye/machinekit-testing,strahlex/machinekit,ikcalB/linuxcnc-mirror,ianmcmahon/linuxcnc-mirror,ianmcmahon/linuxcnc-mirror,kinsamanka/machinekit,cdsteinkuehler/linuxcnc,RunningLight/machinekit,ArcEye/machinekit-testing,ikcalB/linuxcnc-mirror,araisrobo/machinekit,narogon/linuxcnc,kinsamanka/machinekit,ArcEye/MK-Qt5,bobvanderlinden/machinekit,narogon/linuxcnc,Cid427/machinekit,ianmcmahon/linuxcnc-mirror,kinsamanka/machinekit,cdsteinkuehler/MachineKit,EqAfrica/machinekit,araisrobo/machinekit,unseenlaser/linuxcnc,ianmcmahon/linuxcnc-mirror,jaguarcat79/ILC-with-LinuxCNC,bmwiedemann/linuxcnc-mirror,Cid427/machinekit,ianmcmahon/linuxcnc-mirror,yishinli/emc2,unseenlaser/machinekit,cdsteinkuehler/linuxcnc,cdsteinkuehler/linuxcnc,mhaberler/machinekit,strahlex/machinekit,mhaberler/machinekit,unseenlaser/machinekit,araisrobo/machinekit,Cid427/machinekit,narogon/linuxcnc,RunningLight/machinekit,unseenlaser/machinekit,unseenlaser/machinekit,Cid427/machinekit,EqAfrica/machinekit,ianmcmahon/linuxcnc-mirror,narogon/linuxcnc,bobvanderlinden/machinekit,araisrobo/linuxcnc,bmwiedemann/linuxcnc-mirror,EqAfrica/machinekit,cdsteinkuehler/MachineKit,yishinli/emc2,RunningLight/machinekit,ikcalB/linuxcnc-mirror,kinsamanka/machinekit,strahlex/machinekit,jaguarcat79/ILC-with-LinuxCNC,ArcEye/machinekit-testing,ArcEye/machinekit-testing,aschiffler/linuxcnc,strahlex/machinekit,mhaberler/machinekit,araisrobo/machinekit,RunningLight/machinekit,bmwiedemann/linuxcnc-mirror,RunningLight/machinekit,bobvanderlinden/machinekit,unseenlaser/linuxcnc,aschiffler/linuxcnc,unseenlaser/machinekit,EqAfrica/machinekit,ArcEye/MK-Qt5,aschiffler/linuxcnc,ikcalB/linuxcnc-mirror,strahlex/machinekit,Cid427/machinekit,EqAfrica/machinekit,cdsteinkuehler/MachineKit,araisrobo/machinekit,mhaberler/machinekit,cnc-club/linuxcnc,ArcEye/MK-Qt5,unseenlaser/machinekit,cnc-club/linuxcnc,ikcalB/linuxcnc-mirror,cnc-club/linuxcnc,jaguarcat79/ILC-with-LinuxCNC,Cid427/machinekit,ArcEye/machinekit-testing,yishinli/emc2,cdsteinkuehler/MachineKit,cnc-club/linuxcnc,ArcEye/MK-Qt5 |
e1e3efe58ba4cc53ac354cfdf87ddff092c7dcc3 | mudlib/mud/home/String/initd.c | mudlib/mud/home/String/initd.c | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2013 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <kernel/kernel.h>
#include <kotaka/paths.h>
inherit LIB_INITD;
inherit UTILITY_COMPILE;
static void create()
{
KERNELD->set_global_access("String", 1);
load_dir("sys", 1);
}
| Create String subsystem to handle all string related stuff | Create String subsystem to handle all string related stuff
| C | agpl-3.0 | shentino/kotaka,shentino/kotaka,shentino/kotaka |
|
2a63eef748fa1910eddb0b772eb24344e6705fdc | net/socket/ssl_client_socket.h | net/socket/ssl_client_socket.h | // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_SOCKET_SSL_CLIENT_SOCKET_H_
#define NET_SOCKET_SSL_CLIENT_SOCKET_H_
#include "net/socket/client_socket.h"
namespace net {
class SSLCertRequestInfo;
class SSLInfo;
// A client socket that uses SSL as the transport layer.
//
// NOTE: The SSL handshake occurs within the Connect method after a TCP
// connection is established. If a SSL error occurs during the handshake,
// Connect will fail.
//
class SSLClientSocket : public ClientSocket {
public:
// Gets the SSL connection information of the socket.
virtual void GetSSLInfo(SSLInfo* ssl_info) = 0;
// Gets the SSL CertificateRequest info of the socket after Connect failed
// with ERR_SSL_CLIENT_AUTH_CERT_NEEDED.
virtual void GetSSLCertRequestInfo(
SSLCertRequestInfo* cert_request_info) = 0;
};
} // namespace net
#endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_
| // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_SOCKET_SSL_CLIENT_SOCKET_H_
#define NET_SOCKET_SSL_CLIENT_SOCKET_H_
#include "net/socket/client_socket.h"
namespace net {
class SSLCertRequestInfo;
class SSLInfo;
// A client socket that uses SSL as the transport layer.
//
// NOTE: The SSL handshake occurs within the Connect method after a TCP
// connection is established. If a SSL error occurs during the handshake,
// Connect will fail.
//
class SSLClientSocket : public ClientSocket {
public:
// Next Protocol Negotiation (NPN), if successful, results in agreement on an
// application-level string that specifies the application level protocol to
// use over the TLS connection. NextProto enumerates the application level
// protocols that we recognise.
enum NextProto {
kProtoUnknown = 0,
kProtoHTTP11 = 1,
kProtoSPDY = 2,
};
// Gets the SSL connection information of the socket.
virtual void GetSSLInfo(SSLInfo* ssl_info) = 0;
// Gets the SSL CertificateRequest info of the socket after Connect failed
// with ERR_SSL_CLIENT_AUTH_CERT_NEEDED.
virtual void GetSSLCertRequestInfo(
SSLCertRequestInfo* cert_request_info) = 0;
static NextProto NextProtoFromString(const std::string& proto_string) {
if (proto_string == "http1.1") {
return kProtoHTTP11;
} else if (proto_string == "spdy") {
return kProtoSPDY;
} else {
return kProtoUnknown;
}
}
};
} // namespace net
#endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_
| Add static function to convert NPN strings to an enum. | Add static function to convert NPN strings to an enum.
http://codereview.chromium.org/487012
git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@34287 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
| C | bsd-3-clause | wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser |
c22a72ef4865dea9581a39c3d48dc638fe6f894a | test/python_api/hello_world/main.c | test/python_api/hello_world/main.c | #include <stdio.h>
int main(int argc, char const *argv[]) {
printf("Hello world.\n"); // Set break point at this line.
if (argc == 1)
return 0;
// Waiting to be attached by the debugger, otherwise.
char line[100];
while (fgets(line, sizeof(line), stdin)) { // Waiting to be attached...
printf("input line=>%s\n", line);
}
printf("Exiting now\n");
}
| #include <stdio.h>
#if defined(__linux__)
#include <sys/prctl.h>
#endif
int main(int argc, char const *argv[]) {
#if defined(__linux__)
// Immediately enable any ptracer so that we can allow the stub attach
// operation to succeed. Some Linux kernels are locked down so that
// only an ancestor process can be a ptracer of a process. This disables that
// restriction. Without it, attach-related stub tests will fail.
#if defined(PR_SET_PTRACER) && defined(PR_SET_PTRACER_ANY)
int prctl_result;
// For now we execute on best effort basis. If this fails for
// some reason, so be it.
prctl_result = prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0);
(void) prctl_result;
#endif
#endif
printf("Hello world.\n"); // Set break point at this line.
if (argc == 1)
return 0;
// Waiting to be attached by the debugger, otherwise.
char line[100];
while (fgets(line, sizeof(line), stdin)) { // Waiting to be attached...
printf("input line=>%s\n", line);
}
printf("Exiting now\n");
}
| Fix HelloWorld attach test for Linux kernels with ptrace ancestor lockdown. | Fix HelloWorld attach test for Linux kernels with ptrace ancestor lockdown.
Similar to a recent test I fixed for gdb-remote attach scenarios, this
fix is for Linux kernels, such as Ubuntu's stock setup on 11.04-ish and
later, where ptrace starts requiring a ptracer to be an ancestor of the
inferior to be ptraced. This change checks for Linux and the ptrace-related
flags. If they're found, it tries to switch on the "allow any ptracer" mode
for the inferior as the first statements in the program. It's a best-effort
solution - if the prctl call fails, the failure is ignored, and probably will
lead to the test failing.
The ptrace security behavior can be modified system-wide, but is outside the
scope of the test to address. Hence I went with this particular solution.
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@220650 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb |
79be1938ba7f1d22397d24a58c4a39fe5ad13c41 | modules/modinclude.h | modules/modinclude.h | #ifndef MODINCLUDE_H
#define MODINCLUDE_H
#include "../main.h"
class ConfigReader;
class ModuleInterface; // forward-declare so it can be used in modules and server
#include "../connection.h" // declare other classes that use it
#include "../modules.h"
#include "../config.h"
#include "../modules.h"
#endif
| #ifndef MODINCLUDE_H
#define MODINCLUDE_H
#include "../main.h"
class ConfigReader;
class ModuleInterface; // forward-declare so it can be used in modules and server
#include "../connection.h" // declare other classes that use it
#include "../modules.h"
#include "../config.h"
#endif
| Remove double include of a file | Remove double include of a file
| C | mit | ElementalAlchemist/RoBoBo,ElementalAlchemist/RoBoBo |
c269fb2bc1bb58f91145303a4ce3a24957085b4b | lb_vector.c | lb_vector.c | #include "lb_vector.h"
Vector lb_create_vector(Scalar* data, unsigned int length) {
Vector v;
v.data = data;
v.length = length;
return v;
}
Vector lb_allocate_vector(unsigned int length) {
Scalar* ptr = (Scalar*)malloc(sizeof(Scalar) * length);
return lb_create_vector(ptr, length);
}
// Result = Vector dot Vector
void lbdp(Vector a, Vector b, Scalar* result) {
*result = 0.0;
int i;
for(i = 0; i < a.length; i++) *result += a.data[i] * b.data[i];
}
// Result = Scalar * Vector
void lbstv(Scalar s, Vector v, Vector result) {
int i;
for(i = 0; i < v.length; i++) result.data[i] = s * v.data[i];
}
| #include <stdlib.h>
#include "lb_vector.h"
Vector lb_create_vector(Scalar* data, unsigned int length) {
Vector v;
v.data = data;
v.length = length;
return v;
}
Vector lb_allocate_vector(unsigned int length) {
Scalar* ptr = (Scalar*)malloc(sizeof(Scalar) * length);
return lb_create_vector(ptr, length);
}
// Result = Vector dot Vector
void lbdp(Vector a, Vector b, Scalar* result) {
*result = 0.0;
int i;
for(i = 0; i < a.length; i++) *result += a.data[i] * b.data[i];
}
// Result = Scalar * Vector
void lbstv(Scalar s, Vector v, Vector result) {
int i;
for(i = 0; i < v.length; i++) result.data[i] = s * v.data[i];
}
| Include stdlib.h for malloc not to bail | Include stdlib.h for malloc not to bail
| C | apache-2.0 | frenchrd/laid-back-lapack,frenchrd/laid-back-lapack |
01815d76afedad438c36cd3c8d2132e36ec02715 | include/core/SkMilestone.h | include/core/SkMilestone.h | /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 71
#endif
| /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 72
#endif
| Update Skia milestone to 72 | Update Skia milestone to 72
No API changes
TBR=reed
NOTRY=TRUE
Bug: skia:
Change-Id: I1ffde14bc6ebf0cf3d89735f70fb9a385b35d167
Reviewed-on: https://skia-review.googlesource.com/c/161940
Commit-Queue: Heather Miller <[email protected]>
Reviewed-by: Heather Miller <[email protected]>
| C | bsd-3-clause | Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,rubenvb/skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,google/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,rubenvb/skia,HalCanary/skia-hc,HalCanary/skia-hc,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,rubenvb/skia,aosp-mirror/platform_external_skia,google/skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,HalCanary/skia-hc,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,rubenvb/skia,google/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,google/skia,rubenvb/skia,rubenvb/skia,google/skia |
75091bfd2394b33a259bc9ea9b48807f964a3af4 | src/android/AndroidConfigurationEvent.h | src/android/AndroidConfigurationEvent.h | #ifndef _ANDROIDCONFIGURATIONEVENT_H_
#define _ANDROIDCONFIGURATIONEVENT_H_
#include <ConfigurationEvent.h>
#include <android/native_window.h>
class AndroidConfigurationEvent : public ConfigurationEvent {
public:
AndroidConfigurationEvent(double _timestamp, ANativeWindow * _window)
: ConfigurationEvent(_timestamp), window(_window) { }
ANativeWindow * getWindow() { return window; }
std::shared_ptr<EventBase> dup() const { return NULL; }
void dispatch(Element & element);
private:
ANativeWindow * window = 0;
};
#endif
| #ifndef _ANDROIDCONFIGURATIONEVENT_H_
#define _ANDROIDCONFIGURATIONEVENT_H_
#include <ConfigurationEvent.h>
#include <android/native_window.h>
class AndroidConfigurationEvent : public ConfigurationEvent {
public:
AndroidConfigurationEvent(double _timestamp, ANativeWindow * _window)
: ConfigurationEvent(_timestamp), window(_window) { }
ANativeWindow * getWindow() { return window; }
std::shared_ptr<EventBase> dup() const { return std::make_shared<AndroidConfigurationEvent>(*this); }
void dispatch(Element & element);
private:
ANativeWindow * window = 0;
};
#endif
| Fix AConfigurationEvent dup() return value | Fix AConfigurationEvent dup() return value | C | mit | Sometrik/framework,Sometrik/framework,Sometrik/framework |
3b8868dca49ba4e317d562279d2128ed8fff9a81 | src/qt/bitcoinaddressvalidator.h | src/qt/bitcoinaddressvalidator.h | #ifndef BITCOINADDRESSVALIDATOR_H
#define BITCOINADDRESSVALIDATOR_H
#include <QValidator>
/** Base48 entry widget validator.
Corrects near-miss characters and refuses characters that are no part of base48.
*/
class BitcoinAddressValidator : public QValidator
{
Q_OBJECT
public:
explicit BitcoinAddressValidator(QObject *parent = 0);
State validate(QString &input, int &pos) const;
static const int MaxAddressLength = 35;
};
#endif // BITCOINADDRESSVALIDATOR_H
| #ifndef BITCOINADDRESSVALIDATOR_H
#define BITCOINADDRESSVALIDATOR_H
#include <QValidator>
/** Base58 entry widget validator.
Corrects near-miss characters and refuses characters that are not part of base58.
*/
class BitcoinAddressValidator : public QValidator
{
Q_OBJECT
public:
explicit BitcoinAddressValidator(QObject *parent = 0);
State validate(QString &input, int &pos) const;
static const int MaxAddressLength = 35;
};
#endif // BITCOINADDRESSVALIDATOR_H
| Fix typo in a comment: it's base58, not base48. | Fix typo in a comment: it's base58, not base48.
| C | mit | Climbee/artcoin,madman5844/poundkoin,renatolage/wallets-BRCoin,madman5844/poundkoin,kevin-cantwell/crunchcoin,goldmidas/goldmidas,vbernabe/freicoin,BenjaminsCrypto/Benjamins-1,DigitalPandacoin/pandacoin,Climbee/artcoin,kevin-cantwell/crunchcoin,dobbscoin/dobbscoin-source,therealaltcoin/altcoin,tripmode/pxlcoin,goldmidas/goldmidas,keisercoin-official/keisercoin,MitchellMintCoins/AutoCoin,metrocoins/metrocoin,mammix2/ccoin-dev,compasscoin/compasscoin,keisercoin-official/keisercoin,applecoin-official/fellatio,applecoin-official/applecoin,raasakh/bardcoin,peercoin/peercoin,raasakh/bardcoin.exe,raasakh/bardcoin,barcoin-project/nothingcoin,osuyuushi/laughingmancoin,Carrsy/PoundCoin,Earlz/dobbscoin-source,MitchellMintCoins/AutoCoin,dobbscoin/dobbscoin-source,glv2/peerunity,Carrsy/PoundCoin,raasakh/bardcoin,cryptohelper/premine,jimblasko/2015_UNB_Wallets,MitchellMintCoins/MortgageCoin,Dinarcoin/dinarcoin,jimblasko/2015_UNB_Wallets,CarpeDiemCoin/CarpeDiemLaunch,DigitalPandacoin/pandacoin,metrocoins/metrocoin,peercoin/peercoin,madman5844/poundkoin,raasakh/bardcoin.exe,peacedevelop/peacecoin,hg5fm/nexuscoin,raasakh/bardcoin,DigitalPandacoin/pandacoin,MitchellMintCoins/AutoCoin,brettwittam/geocoin,CarpeDiemCoin/CarpeDiemLaunch,goldmidas/goldmidas,cainca/liliucoin,SocialCryptoCoin/SocialCoin,mammix2/ccoin-dev,peercoin/peercoin,ppcoin/ppcoin,starwalkerz/fincoin-fork,therealaltcoin/altcoin,brettwittam/geocoin,totallylegitbiz/totallylegitcoin,Climbee/artcoin,metrocoins/metrocoin,CarpeDiemCoin/CarpeDiemLaunch,renatolage/wallets-BRCoin,zestcoin/ZESTCOIN,DigitalPandacoin/pandacoin,cainca/liliucoin,renatolage/wallets-BRCoin,jimblasko/2015_UNB_Wallets,therealaltcoin/altcoin,5mil/Tradecoin,compasscoin/compasscoin,Adaryian/E-Currency,OfficialTitcoin/titcoin-wallet,Adaryian/E-Currency,raasakh/bardcoin,tripmode/pxlcoin,bitpagar/bitpagar,howardrya/AcademicCoin,Dinarcoin/dinarcoin,applecoin-official/fellatio,borgcoin/Borgcoin1,pdrobek/Polcoin-1-3,brettwittam/geocoin,WorldLeadCurrency/WLC,gjhiggins/fuguecoin,webdesignll/coin,cryptohelper/premine,webdesignll/coin,totallylegitbiz/totallylegitcoin,metrocoins/metrocoin,CarpeDiemCoin/CarpeDiemLaunch,peerdb/cors,borgcoin/Borgcoin1,ppcoin/ppcoin,vbernabe/freicoin,Enticed87/Decipher,borgcoin/Borgcoin.rar,zestcoin/ZESTCOIN,peerdb/cors,Earlz/dobbscoin-source,raasakh/bardcoin.exe,borgcoin/Borgcoin1,osuyuushi/laughingmancoin,Adaryian/E-Currency,vbernabe/freicoin,howardrya/AcademicCoin,applecoin-official/applecoin,Earlz/dobbscoin-source,glv2/peerunity,WorldLeadCurrency/WLC,zestcoin/ZESTCOIN,madman5844/poundkoin,borgcoin/Borgcoin.rar,gjhiggins/fuguecoin,hg5fm/nexuscoin,jimblasko/2015_UNB_Wallets,qubitcoin-project/QubitCoinQ2C,howardrya/AcademicCoin,barcoin-project/nothingcoin,WorldLeadCurrency/WLC,jimblasko/UnbreakableCoin-master,Carrsy/PoundCoin,borgcoin/Borgcoin.rar,totallylegitbiz/totallylegitcoin,peerdb/cors,WorldLeadCurrency/WLC,applecoin-official/applecoin,bitpagar/bitpagar,BenjaminsCrypto/Benjamins-1,peacedevelop/peacecoin,dobbscoin/dobbscoin-source,webdesignll/coin,osuyuushi/laughingmancoin,jimblasko/UnbreakableCoin-master,howardrya/AcademicCoin,Enticed87/Decipher,gjhiggins/fuguecoin,glv2/peerunity,WorldLeadCurrency/WLC,Earlz/dobbscoin-source,OfficialTitcoin/titcoin-wallet,pdrobek/Polcoin-1-3,totallylegitbiz/totallylegitcoin,hg5fm/nexuscoin,peercoin/peercoin,webdesignll/coin,Carrsy/PoundCoin,goldmidas/goldmidas,peerdb/cors,cryptocoins4all/zcoin,pdrobek/Polcoin-1-3,applecoin-official/applecoin,cainca/liliucoin,ionux/freicoin,brettwittam/geocoin,Carrsy/PoundCoin,cainca/liliucoin,mammix2/ccoin-dev,peercoin/peercoin,keisercoin-official/keisercoin,pdrobek/Polcoin-1-3,brettwittam/geocoin,keisercoin-official/keisercoin,pdrobek/Polcoin-1-3,vbernabe/freicoin,raasakh/bardcoin.exe,raasakh/bardcoin,ionux/freicoin,jimblasko/UnbreakableCoin-master,SocialCryptoCoin/SocialCoin,cryptohelper/premine,peacedevelop/peacecoin,OfficialTitcoin/titcoin-wallet,renatolage/wallets-BRCoin,peacedevelop/peacecoin,raasakh/bardcoin.exe,BenjaminsCrypto/Benjamins-1,barcoin-project/nothingcoin,DigitalPandacoin/pandacoin,compasscoin/compasscoin,applecoin-official/fellatio,cainca/liliucoin,jimblasko/UnbreakableCoin-master,CarpeDiemCoin/CarpeDiemLaunch,gjhiggins/fuguecoin,tripmode/pxlcoin,cryptohelper/premine,BenjaminsCrypto/Benjamins-1,Enticed87/Decipher,5mil/Tradecoin,osuyuushi/laughingmancoin,compasscoin/compasscoin,barcoin-project/nothingcoin,MitchellMintCoins/AutoCoin,tripmode/pxlcoin,zestcoin/ZESTCOIN,5mil/Tradecoin,Enticed87/Decipher,MitchellMintCoins/MortgageCoin,starwalkerz/fincoin-fork,MitchellMintCoins/MortgageCoin,Adaryian/E-Currency,peerdb/cors,goldmidas/goldmidas,applecoin-official/applecoin,howardrya/AcademicCoin,ionux/freicoin,SocialCryptoCoin/SocialCoin,cryptocoins4all/zcoin,borgcoin/Borgcoin.rar,kevin-cantwell/crunchcoin,borgcoin/Borgcoin.rar,therealaltcoin/altcoin,applecoin-official/fellatio,mammix2/ccoin-dev,Adaryian/E-Currency,osuyuushi/laughingmancoin,renatolage/wallets-BRCoin,hg5fm/nexuscoin,MitchellMintCoins/AutoCoin,therealaltcoin/altcoin,jimblasko/2015_UNB_Wallets,Climbee/artcoin,Earlz/dobbscoin-source,OfficialTitcoin/titcoin-wallet,cryptocoins4all/zcoin,kevin-cantwell/crunchcoin,Climbee/artcoin,mammix2/ccoin-dev,hg5fm/nexuscoin,starwalkerz/fincoin-fork,ppcoin/ppcoin,dobbscoin/dobbscoin-source,WorldLeadCurrency/WLC,ionux/freicoin,bitpagar/bitpagar,vbernabe/freicoin,cryptohelper/premine,MitchellMintCoins/MortgageCoin,starwalkerz/fincoin-fork,qubitcoin-project/QubitCoinQ2C,cryptocoins4all/zcoin,dobbscoin/dobbscoin-source,DigitalPandacoin/pandacoin,Earlz/dobbscoin-source,webdesignll/coin,vbernabe/freicoin,qubitcoin-project/QubitCoinQ2C,metrocoins/metrocoin,peerdb/cors,ppcoin/ppcoin,ionux/freicoin,compasscoin/compasscoin,Dinarcoin/dinarcoin,SocialCryptoCoin/SocialCoin,borgcoin/Borgcoin1,peercoin/peercoin,qubitcoin-project/QubitCoinQ2C,gjhiggins/fuguecoin,zestcoin/ZESTCOIN,kevin-cantwell/crunchcoin,bitpagar/bitpagar,Dinarcoin/dinarcoin,borgcoin/Borgcoin1,SocialCryptoCoin/SocialCoin,keisercoin-official/keisercoin,5mil/Tradecoin,Dinarcoin/dinarcoin,OfficialTitcoin/titcoin-wallet,cryptocoins4all/zcoin,jimblasko/UnbreakableCoin-master,5mil/Tradecoin,glv2/peerunity,Enticed87/Decipher,ionux/freicoin,peacedevelop/peacecoin,tripmode/pxlcoin,applecoin-official/fellatio,MitchellMintCoins/MortgageCoin,dobbscoin/dobbscoin-source,qubitcoin-project/QubitCoinQ2C,totallylegitbiz/totallylegitcoin,raasakh/bardcoin.exe,barcoin-project/nothingcoin |
33ea6a02332d0944150e9445a584d6f26718509b | src/untrusted/irt/irt_private_pthread.c | src/untrusted/irt/irt_private_pthread.c | /*
* Copyright (c) 2012 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <errno.h>
#include <pthread.h>
#include <unistd.h>
#include "native_client/src/untrusted/nacl/tls.h"
/*
* libstdc++ makes minimal use of pthread_key_t stuff.
*/
#undef PTHREAD_KEYS_MAX
#define PTHREAD_KEYS_MAX 16
#define NC_TSD_NO_MORE_KEYS irt_tsd_no_more_keys()
static void irt_tsd_no_more_keys(void) {
static const char msg[] = "IRT: too many pthread keys\n";
write(2, msg, sizeof msg - 1);
}
#define NACL_IN_IRT
/* @IGNORE_LINES_FOR_CODE_HYGIENE[2] */
#include "native_client/src/untrusted/pthread/nc_init_private.c"
#include "native_client/src/untrusted/pthread/nc_thread.c"
| /*
* Copyright (c) 2012 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <errno.h>
#include <pthread.h>
#include <unistd.h>
#include "native_client/src/untrusted/nacl/tls.h"
/*
* libstdc++ makes minimal use of pthread_key_t stuff.
*/
#undef PTHREAD_KEYS_MAX
#define PTHREAD_KEYS_MAX 32
#define NC_TSD_NO_MORE_KEYS irt_tsd_no_more_keys()
static void irt_tsd_no_more_keys(void) {
static const char msg[] = "IRT: too many pthread keys\n";
write(2, msg, sizeof msg - 1);
}
#define NACL_IN_IRT
/* @IGNORE_LINES_FOR_CODE_HYGIENE[2] */
#include "native_client/src/untrusted/pthread/nc_init_private.c"
#include "native_client/src/untrusted/pthread/nc_thread.c"
| Increase the number of pthread keys available to the IRT | Increase the number of pthread keys available to the IRT
The Mojo EDK uses an additional key for thread-local storage
and is now necessary to bring up IPC in Chrome. This is apparently
enough to push us over the 16 key limit in some cases.
Doubling to 32 to leave some room for further expansion.
BUG=https://code.google.com/p/chromium/issues/detail?id=612500
Review-Url: https://codereview.chromium.org/2050043004
| C | bsd-3-clause | sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client |
d849a52cc61e6183554cdbfe49d458e6bcbd79e8 | ports/gtk-webkit/next-gtk-webkit.c | ports/gtk-webkit/next-gtk-webkit.c | /*
Copyright © 2018 Atlas Engineer LLC.
Use of this file is governed by the license that can be found in LICENSE.
*/
#include <gtk/gtk.h>
#include "server.h"
int main(int argc, char *argv[]) {
// TODO: Use GtkApplication?
gtk_init(&argc, &argv);
// TODO: Start the xmlrpc server first? If GUI is started, then we can
// report xmlrpc startup issue graphically.
start_server();
start_client();
gtk_main();
stop_server();
return 0;
}
| /*
Copyright © 2018 Atlas Engineer LLC.
Use of this file is governed by the license that can be found in LICENSE.
*/
#include <gtk/gtk.h>
#include <stdlib.h>
#include "server.h"
int main(int argc, char *argv[]) {
// TODO: Use GtkApplication?
gtk_init(&argc, &argv);
// TODO: Start the xmlrpc server first? If GUI is started, then we can
// report xmlrpc startup issue graphically.
start_server();
start_client();
gtk_main();
stop_server();
return EXIT_SUCCESS;
}
| Use stdlib and return EXIT_SUCCESS | ports/gtk-webkit: Use stdlib and return EXIT_SUCCESS
| C | bsd-3-clause | jmercouris/NeXT,jmercouris/NeXT |
9a4a639fa3586a5ec10444d0fc26049bd9c3b707 | src/lib/pubkey/cecpq1/cecpq1.h | src/lib/pubkey/cecpq1/cecpq1.h | /*
* CECPQ1 (x25519 + NewHope)
* (C) 2016 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
#ifndef BOTAN_CECPQ1_H__
#define BOTAN_CECPQ1_H__
#include <botan/secmem.h>
#include <botan/newhope.h>
namespace Botan {
struct CECPQ1_key {
secure_vector<uint8_t> m_x25519;
newhope_poly m_newhope;
};
void BOTAN_DLL CECPQ1_offer(uint8_t* offer_message,
CECPQ1_key* offer_key_output,
RandomNumberGenerator& rng);
void BOTAN_DLL CECPQ1_accept(uint8_t* shared_key,
uint8_t* accept_message,
const uint8_t* offer_message,
RandomNumberGenerator& rng);
void BOTAN_DLL CECPQ1_finish(uint8_t* shared_key,
const CECPQ1_key& offer_key,
const uint8_t* accept_message);
}
#endif
| /*
* CECPQ1 (x25519 + NewHope)
* (C) 2016 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
#ifndef BOTAN_CECPQ1_H__
#define BOTAN_CECPQ1_H__
#include <botan/secmem.h>
#include <botan/newhope.h>
namespace Botan {
class CECPQ1_key
{
public:
secure_vector<uint8_t> m_x25519;
newhope_poly m_newhope;
};
void BOTAN_DLL CECPQ1_offer(uint8_t* offer_message,
CECPQ1_key* offer_key_output,
RandomNumberGenerator& rng);
void BOTAN_DLL CECPQ1_accept(uint8_t* shared_key,
uint8_t* accept_message,
const uint8_t* offer_message,
RandomNumberGenerator& rng);
void BOTAN_DLL CECPQ1_finish(uint8_t* shared_key,
const CECPQ1_key& offer_key,
const uint8_t* accept_message);
}
#endif
| Fix class vs struct declaration. | Fix class vs struct declaration.
Recent Clang complains about forward decl as 'class X' when X was
actually declared as a struct.
| C | bsd-2-clause | webmaster128/botan,webmaster128/botan,randombit/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,webmaster128/botan,webmaster128/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan |
406f0cd7f1c4cd3796592305ae9e338d2ea6cdf8 | testmud/mud/home/Game/sys/band.c | testmud/mud/home/Game/sys/band.c | /* keeps track of bans */
mapping username_bans;
mapping ip_bans;
static void create()
{
username_bans = ([ ]);
}
void ban_username(string username)
{
ACCESS_CHECK(GAME());
if (username_bans[username]) {
error("Username already banned");
}
username_bans[username] = 1;
}
void unban_username(string username)
{
ACCESS_CHECK(GAME());
if (!username_bans[username]) {
error("Username not banned");
}
username_bans[username] = nil;
}
int query_is_banned(string username)
{
return !!username_bans(username);
}
| #include <kotaka/privilege.h>
/* keeps track of bans */
mapping username_bans;
private void save();
private void restore();
static void create()
{
username_bans = ([ ]);
restore();
}
void ban_username(string username)
{
ACCESS_CHECK(GAME());
if (username == "admin") {
error("Cannot ban admin");
}
if (username_bans[username]) {
error("Username already banned");
}
username_bans[username] = 1;
save();
}
void unban_username(string username)
{
ACCESS_CHECK(GAME());
if (!username_bans[username]) {
error("Username not banned");
}
username_bans[username] = nil;
save();
}
int query_is_banned(string username)
{
return !!username_bans[username];
}
private void save()
{
save_object("band.o");
}
private void restore()
{
restore_object("band.o");
}
| Allow ban manager to save state | Allow ban manager to save state
| C | agpl-3.0 | shentino/kotaka,shentino/kotaka,shentino/kotaka |
b8f31ace2931a5ba15f10abbba4f819fa207c88b | test/CodeGen/2007-11-07-ZeroAggregateAlign.c | test/CodeGen/2007-11-07-ZeroAggregateAlign.c | // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
struct A { short s; short t; int i; };
// CHECK: %a = alloca %struct.A, align 4
// CHECK: call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 8, i32 4, i1 false)
void q() { struct A a = {0}; }
| // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
struct A { short s; short t; int i; };
// CHECK: %a = alloca %struct.A, align 4
// CHECK: call void @llvm.memset.p0i8.i64{{.*}}i32 4, i1 false)
void q() { struct A a = {0}; }
| Rework the match here to silence release mode windows buildbots. | Rework the match here to silence release mode windows buildbots.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@136164 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang |
546aa3b916172c46fa6df8f7a002949c3976c060 | Xcode/Audio/src/user_color_sensor.h | Xcode/Audio/src/user_color_sensor.h | #include "GRT/GRT.h"
#include "istream.h"
using namespace GRT;
// Normalize by dividing each dimension by the total magnitude.
// Also add the magnitude as an additional feature.
vector<double> normalize(vector<double> input) {
double magnitude;
for (int i = 0; i < input.size(); i++) magnitude += (input[i] * input[i]);
magnitude = sqrt(magnitude);
for (int i = 0; i < input.size(); i++) input[i] /= magnitude;
input.push_back(magnitude);
return input;
}
ASCIISerialStream stream(9600, 3);
GestureRecognitionPipeline pipeline;
void setup() {
stream.useUSBPort(0);
stream.useNormalizer(normalize);
useStream(stream);
pipeline.addPreProcessingModule(MovingAverageFilter(5, 4));
//pipeline.addFeatureExtractionModule(TimeDomainFeatures(10, 1, 3, false, true, true, false, false));
pipeline.setClassifier(ANBC());
usePipeline(pipeline);
}
| #include "GRT/GRT.h"
#include "istream.h"
using namespace GRT;
// Normalize by dividing each dimension by the total magnitude.
// Also add the magnitude as an additional feature.
vector<double> normalize(vector<double> input) {
double magnitude = 0.0;
for (int i = 0; i < input.size(); i++) magnitude += (input[i] * input[i]);
magnitude = sqrt(magnitude);
for (int i = 0; i < input.size(); i++) input[i] /= magnitude;
input.push_back(magnitude);
return input;
}
ASCIISerialStream stream(9600, 3);
GestureRecognitionPipeline pipeline;
void setup() {
stream.useUSBPort(0);
stream.useNormalizer(normalize);
useStream(stream);
pipeline.addPreProcessingModule(MovingAverageFilter(5, 4));
//pipeline.addFeatureExtractionModule(TimeDomainFeatures(10, 1, 3, false, true, true, false, false));
pipeline.setClassifier(ANBC());
usePipeline(pipeline);
}
| Initialize double variable before use. | Initialize double variable before use.
Also removed trailing spaces.
| C | bsd-3-clause | damellis/ESP,damellis/ESP |
238cb4590508838cf420c23eece94715ce314a27 | CppChart/Log.h | CppChart/Log.h | #ifndef LOG_H
#define LOG_H
#include <string>
#include <iostream>
#include <SFML/Graphics.hpp>
inline void Log(std::string str)
{
std::cout << "[" << __LINE__ << "] " << __FUNCTION__ << " : " << str << std::endl;
}
inline void LogFnStart()
{
Log("Entered");
}
inline void LogFnEnd()
{
Log("Finished");
}
inline void NestedLog(std::string str)
{
std::cout << "\n\t" << str << "\n" << std::endl;
}
namespace CppChart
{
std::ostream& operator<<(std::ostream& stream, const sf::Vector2f& v);
std::ostream& operator<<(std::ostream& stream, const sf::Vector2u& v);
std::ostream& operator<<(std::ostream& stream, const sf::Color& c);
template <typename T>
std::string ToString(const T& val);
}
#endif | #ifndef LOG_H
#define LOG_H
#include <string>
#include <iostream>
#include <SFML/Graphics.hpp>
inline void Log(std::string str)
{
std::cout << "[" << __LINE__ << "] " << __FUNCTION__ << " : " << str << std::endl;
}
inline void LogFnStart()
{
Log("Entered");
}
inline void LogFnEnd()
{
Log("Finished");
}
inline void NestedLog(std::string str)
{
std::cout << "\n\t" << str << "\n" << std::endl;
}
namespace CppChart
{
std::ostream& operator<<(std::ostream&, const sf::Vector2f&);
std::ostream& operator<<(std::ostream&, const sf::Vector2u&);
std::ostream& operator<<(std::ostream&, const sf::Color&);
template <typename T>
std::string ToString(const T&);
}
#endif | Delete argument names of function | Delete argument names of function
| C | mit | utilForever/CppChart |
7a8eda6a9283448ffe1a164b7cfa39c832d3fec0 | searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h | searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h | // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "blueprint.h"
#include <vespa/searchlib/fef/matchdatalayout.h>
namespace search::queryeval {
class EquivBlueprint : public ComplexLeafBlueprint
{
private:
FieldSpecBaseList _fields;
HitEstimate _estimate;
fef::MatchDataLayout _layout;
std::vector<Blueprint::UP> _terms;
std::vector<double> _exactness;
public:
EquivBlueprint(const FieldSpecBaseList &fields, fef::MatchDataLayout subtree_mdl);
virtual ~EquivBlueprint();
// used by create visitor
EquivBlueprint& addTerm(Blueprint::UP term, double exactness);
SearchIteratorUP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, bool strict) const override;
SearchIteratorUP createFilterSearch(bool strict, FilterConstraint constraint) const override;
void visitMembers(vespalib::ObjectVisitor &visitor) const override;
void fetchPostings(const ExecuteInfo &execInfo) override;
bool isEquiv() const override { return true; }
};
}
| // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "blueprint.h"
#include <vespa/searchlib/fef/matchdatalayout.h>
namespace search::queryeval {
class EquivBlueprint : public ComplexLeafBlueprint
{
private:
FieldSpecBaseList _fields;
HitEstimate _estimate;
fef::MatchDataLayout _layout;
std::vector<Blueprint::UP> _terms;
std::vector<double> _exactness;
public:
EquivBlueprint(const FieldSpecBaseList &fields, fef::MatchDataLayout subtree_mdl);
~EquivBlueprint() override;
// used by create visitor
EquivBlueprint& addTerm(Blueprint::UP term, double exactness);
SearchIteratorUP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, bool strict) const override;
SearchIteratorUP createFilterSearch(bool strict, FilterConstraint constraint) const override;
void visitMembers(vespalib::ObjectVisitor &visitor) const override;
void fetchPostings(const ExecuteInfo &execInfo) override;
bool isEquiv() const override { return true; }
};
}
| Use override specifier for EquivBlueprint destructor. | Use override specifier for EquivBlueprint destructor.
| 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 |
a846558b6addf536e5600d2a53e053bf07c92a5c | examples/output_file.c | examples/output_file.c | #include <stdio.h>
#include <string.h>
#include "zf_log.h"
#define LOG_FILENAME "test.log"
FILE *log_file;
static void log_file_write(zf_log_output_ctx *ctx) {
*ctx->p = '\n';
fwrite(ctx->buf, 1, (ctx->p + 1) - ctx->buf, log_file);
fflush(log_file);
}
int main(int argc, char *argv[])
{
log_file = fopen(LOG_FILENAME, "a+");
if (NULL == log_file) {
printf("Failed to open log file.\n");
}
zf_log_set_output_callback(log_file_write);
ZF_LOGI("You will see the number of arguments: %i", argc);
ZF_LOGI_MEM(argv, argc * sizeof(*argv), "argv pointers:");
fclose(log_file);
return 0;
}
| Add example which outputs log to a file. | Add example which outputs log to a file.
| C | mit | wonder-mice/zf_log,wonder-mice/zf_log,wonder-mice/zf_log |
|
e56b0c0f248ae779a0abd9e1d5aa7f7420a03f64 | ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.h | ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.h | // -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//
// This file is part of the LibreOffice project.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#import "MLOViewController.h"
#import "MLOTestingTileSubviewControllerProtocol.h"
static const CGFloat CONTEXT_WIDTH_DEFAULT = 450;
static const CGFloat CONTEXT_HEIGHT_DEFAULT = 450;
static const CGFloat TILE_POS_X_DEFAULT = 400;
static const CGFloat TILE_POS_Y_DEFAULT = 420;
static const CGFloat TILE_WIDTH_DEFAULT = 250;
static const CGFloat TILE_HEIGHT_DEFAULT = 250;
@interface MLOTestingTileParametersViewController : MLOViewController<MLOTestingTileSubviewControllerProtocol>
@property CGFloat contextWidth, contextHeight, tilePosX, tilePosY, tileWidth, tileHeight;
-(void)renderTile;
@end
| // -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//
// This file is part of the LibreOffice project.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#import "MLOViewController.h"
#import "MLOTestingTileSubviewControllerProtocol.h"
// The size of the actual pixel tile
static const CGFloat CONTEXT_WIDTH_DEFAULT = 450;
static const CGFloat CONTEXT_HEIGHT_DEFAULT = 450;
// In our "decatwips"
static const CGFloat TILE_POS_X_DEFAULT = 0;
static const CGFloat TILE_POS_Y_DEFAULT = 0;
// "Tile" size here means the decatwip size of the part of the document
// rendered into the pixel tile
static const CGFloat TILE_WIDTH_DEFAULT = 500;
static const CGFloat TILE_HEIGHT_DEFAULT = 500;
@interface MLOTestingTileParametersViewController : MLOViewController<MLOTestingTileSubviewControllerProtocol>
@property CGFloat contextWidth, contextHeight, tilePosX, tilePosY, tileWidth, tileHeight;
-(void)renderTile;
@end
| Adjust parameter defaults to give pleasant result | Adjust parameter defaults to give pleasant result
Change-Id: Ifee900344547ef25b2041d25c13fcbc50428485e
| C | mpl-2.0 | JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core |
f113d37eb04e24b4f047886918aefb1c3f545be0 | bugs/typeof_asm_rewrite_interpose.c | bugs/typeof_asm_rewrite_interpose.c | #define QUOTE_(x) #x
#define QUOTE(x) QUOTE_(x)
inline void f(int a, char *);
__typeof(f) orig_f asm(QUOTE(__USER_LABEL_PREFIX__) "f");
inline void f(int a, char *p) asm(QUOTE(__USER_LABEL_PREFIX__) "f_wrapper_thunk");
inline void f(int a, char *p)
{
orig_f(a+1, p+1);
}
int main()
{
f(0, "hi");
}
| Add example of using __asm__() to rewrite calls to a function | Add example of using __asm__() to rewrite calls to a function
| C | mit | bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler |
|
1c34607f3b280ab0b40835b8f57555f941ed2b6c | src/dyn_types.h | src/dyn_types.h | typedef uint64_t msgid_t;
typedef uint64_t msec_t;
typedef uint64_t usec_t;
| #pragma once
typedef uint64_t msgid_t;
typedef uint64_t msec_t;
typedef uint64_t usec_t;
| Fix compile error on CentOS | Fix compile error on CentOS
| C | apache-2.0 | Netflix/dynomite,Netflix/dynomite,Netflix/dynomite,Netflix/dynomite |
53ab89427f4c061e86a3f43ef3d5e860601aec86 | src/debugUtils.h | src/debugUtils.h | #pragma once
#include <string>
#include <iostream>
#include <fstream>
#include <exception>
#include <boost/format.hpp>
using boost::format;
class LogFile
{
public:
LogFile();
explicit LogFile(const std::string& filename);
~LogFile();
void open(const std::string& filename);
void close();
template <class T>
void write(const T& other, bool newline=true) {
if (haveFile) {
file << other;
if (newline) {
file << std::endl;
}
} else {
std::cout << other;
if (newline) {
std::cout << std::endl;
}
}
}
private:
bool haveFile;
std::ofstream file;
};
class debugParameters
{
public:
static bool debugAdapt;
static bool debugRegrid;
static bool debugTimesteps;
static bool debugFlameRadiusControl;
static bool veryVerbose;
};
extern LogFile logFile;
class debugException : public std::exception
{
public:
std::string errorString;
debugException(void);
~debugException(void) throw() {}
debugException(const std::string& error);
virtual const char* what() throw();
};
| #pragma once
#include <string>
#include <iostream>
#include <fstream>
#include <exception>
#include <boost/format.hpp>
using boost::format;
class LogFile
{
public:
LogFile();
explicit LogFile(const std::string& filename);
~LogFile();
void open(const std::string& filename);
void close();
template <class T>
void write(const T& other, bool newline=true) {
if (haveFile) {
file << other;
if (newline) {
file << std::endl;
}
} else {
std::cout << other;
if (newline) {
std::cout << std::endl;
}
#ifndef NDEBUG
std::cout.flush();
std::cerr.flush();
#endif
}
}
private:
bool haveFile;
std::ofstream file;
};
class debugParameters
{
public:
static bool debugAdapt;
static bool debugRegrid;
static bool debugTimesteps;
static bool debugFlameRadiusControl;
static bool veryVerbose;
};
extern LogFile logFile;
class debugException : public std::exception
{
public:
std::string errorString;
debugException(void);
~debugException(void) throw() {}
debugException(const std::string& error);
virtual const char* what() throw();
};
| Synchronize logging to stderr and stdout in debug mode | Synchronize logging to stderr and stdout in debug mode
| C | mit | speth/ember,speth/ember,speth/ember |
648e6d93d6d7510d348eb5f30102490efdf55011 | test/Frontend/aarch64-target-cpu.c | test/Frontend/aarch64-target-cpu.c | // Ensure we support the various CPU names.
//
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu cortex-a35 -verify %s
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu cortex-a53 -verify %s
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu cortex-a57 -verify %s
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu cortex-a72 -verify %s
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu cortex-a73 -verify %s
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu cyclone -verify %s
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu exynos-m1 -verify %s
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu generic -verify %s
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu kryo -verify %s
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu vulcan -verify %s
//
// expected-no-diagnostics
| Add a test for aarch64 target CPU names. | test/Frontend: Add a test for aarch64 target CPU names.
Nothing else checked the target cpu names for aarch64 yet.
Add a test in the spirit of x86-target-cpu.c.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@276930 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang |
|
d44086db5a2aa362510d7ac1a1f2f401c8ff180c | boards/posix/nrf52_bsim/cmdline.h | boards/posix/nrf52_bsim/cmdline.h | /*
* Copyright (c) 2019 Oticon A/S
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* This header exists solely to allow drivers meant for the native_posix board
* to be used directly in the nrf52_bsim board.
* Note that such reuse should be done with great care.
*
* The command line arguments parsing logic from native_posix was born as a copy
* of the one from the BabbleSim's libUtil library
* They are therefore mostly equal except for types and functions names.
*
* This header converts these so the native_posix call to dynamically register
* command line arguments is passed to the nrf52_bsim one
*/
#include "../native_posix/cmdline_common.h"
static inline void native_add_command_line_opts(struct args_struct_t *args)
{
void bs_add_extra_dynargs(struct args_struct_t *args);
bs_add_extra_dynargs(args);
}
| Add header to allow reusing native_posix drivers | nrf52_bsim: Add header to allow reusing native_posix drivers
This board and the native_posix board share the POSIX architecture.
Some of the native_posix drivers/backends only rely on the
underlaying operating system API, and do not require any special
HW model to operate.
Therefore it is quite easy to reuse some of them into this board.
Currently the only limitation for some, is the interface they use
in the board to register their command line arguments.
This header provides a minimal shim to rename the, otherwise
equivalent, call.
Signed-off-by: Alberto Escolar Piedras <[email protected]>
| C | apache-2.0 | galak/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,GiulianoFranchetto/zephyr,nashif/zephyr,Vudentz/zephyr,galak/zephyr,Vudentz/zephyr,GiulianoFranchetto/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,GiulianoFranchetto/zephyr,finikorg/zephyr,finikorg/zephyr,ldts/zephyr,finikorg/zephyr,Vudentz/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,ldts/zephyr,Vudentz/zephyr,GiulianoFranchetto/zephyr,nashif/zephyr,galak/zephyr,ldts/zephyr,ldts/zephyr,nashif/zephyr,ldts/zephyr,galak/zephyr,nashif/zephyr,GiulianoFranchetto/zephyr,galak/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr |
|
c473a67a06813dc3d4ae5d312633657d7093b324 | include/materials/NoEvapFreeEnergy.h | include/materials/NoEvapFreeEnergy.h | /****************************************************************/
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* All contents are licensed under LGPL V2.1 */
/* See LICENSE for full restrictions */
/****************************************************************/
#ifndef NOEVAPFREEENERGY_H
#define NOEVAPFREEENERGY_H
#include "DerivativeFunctionMaterialBase.h"
//Forward Declarations
class NoEvapFreeEnergy;
template<>
InputParameters validParams<NoEvapFreeEnergy>();
/**
* Material class that creates a piecewise free energy with supressed evaporation and its derivatives
* for use with CHParsed and SplitCHParsed. F = .
*/
class NoEvapFreeEnergy : public DerivativeFunctionMaterialBase
{
public:
NoEvapFreeEnergy(const InputParameters & parameters);
protected:
virtual Real computeF();
virtual Real computeDF(unsigned int j_var);
virtual Real computeD2F(unsigned int j_var, unsigned int k_var);
private:
/// Coupled variable value for the concentration \f$ \c \f$.
VariableValue & _c;
unsigned int _c_var;
};
#endif //NOEVAPFREEENERGY_H
| /****************************************************************/
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* All contents are licensed under LGPL V2.1 */
/* See LICENSE for full restrictions */
/****************************************************************/
#ifndef NOEVAPFREEENERGY_H
#define NOEVAPFREEENERGY_H
#include "DerivativeFunctionMaterialBase.h"
//Forward Declarations
class NoEvapFreeEnergy;
template<>
InputParameters validParams<NoEvapFreeEnergy>();
/**
* Material class that creates a piecewise free energy with supressed evaporation and its derivatives
* for use with CHParsed and SplitCHParsed. F = .
*/
class NoEvapFreeEnergy : public DerivativeFunctionMaterialBase
{
public:
NoEvapFreeEnergy(const InputParameters & parameters);
protected:
virtual Real computeF();
virtual Real computeDF(unsigned int j_var);
virtual Real computeD2F(unsigned int j_var, unsigned int k_var);
private:
/// Coupled variable value for the concentration \f$ \c \f$.
const VariableValue & _c;
unsigned int _c_var;
};
#endif //NOEVAPFREEENERGY_H
| Add const in newly-added file. | Add const in newly-added file.
| C | lgpl-2.1 | dinayuryev/panda,dinayuryev/panda,dinayuryev/panda |
79e698a2b20277e2c7c8b2d2d688ff1529b8df9d | src/gfx/extra/json.h | src/gfx/extra/json.h | /*
* Copyright (C) 2015 Luke San Antonio
* All rights reserved.
*/
#pragma once
#include "rapidjson/document.h"
#include "glm/glm.hpp"
namespace redc
{
inline glm::vec3 vec3_from_js_object(rapidjson::Value const& v) noexcept
{
return glm::vec3{v["x"].GetDouble(),v["y"].GetDouble(),v["z"].GetDouble()};
}
inline glm::vec3 vec3_from_js_array(rapidjson::Value const& v) noexcept
{
return glm::vec3{v[0].GetDouble(),v[1].GetDouble(),v[2].GetDouble()};
}
}
| /*
* Copyright (C) 2015 Luke San Antonio
* All rights reserved.
*/
#pragma once
#include "rapidjson/document.h"
#include "glm/glm.hpp"
namespace redc
{
inline glm::vec3 vec3_from_js_object(rapidjson::Value const& v) noexcept
{
return glm::vec3{v["x"].GetDouble(),v["y"].GetDouble(),v["z"].GetDouble()};
}
inline glm::vec3 vec3_from_js_array(rapidjson::Value const& v) noexcept
{
return glm::vec3{v[0].GetDouble(),v[1].GetDouble(),v[2].GetDouble()};
}
inline bool load_js_vec3(rapidjson::Value const& v, glm::vec3& vec,
std::string* err)
{
if(v.IsArray())
{
vec = vec3_from_js_array(v);
return true;
}
else if(v.IsObject())
{
vec = vec3_from_js_object(v);
return true;
}
else
{
if(err) (*err) = "Invalid JSON; expected Vec3 (object or array)";
return false;
}
}
}
| Support loading vec3s from JSON objects or arrays | Support loading vec3s from JSON objects or arrays
| C | bsd-3-clause | RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine |
d80d80192972f1a90b10a43b2a4f4c88fd66f88c | vim/avr/compat.h | vim/avr/compat.h | #pragma once
#ifndef __AVR_ARCH__
#include <unistd.h>
#define _BV(bit) (1<<(bit))
inline void _delay_ms(int ms) { usleep(ms*1000); }
inline void _delay_us(int us) { usleep(us); }
extern unsigned char UCSR0B;
extern unsigned char DDRB;
extern unsigned char DDRD;
extern unsigned char PINB;
extern unsigned char PIND;
extern unsigned char PORTB;
extern unsigned char PORTD;
#endif
| #pragma once
#ifndef __AVR_ARCH__
#include <unistd.h>
#define _BV(bit) (1<<(bit))
inline void _delay_ms(int ms) { usleep(ms*1000); }
inline void _delay_us(int us) { usleep(us); }
extern unsigned char UCSR0A;
extern unsigned char UCSR0B;
extern unsigned char UCSR0C;
extern unsigned char UBRR0H;
extern unsigned char UBRR0L;
extern unsigned char DDRB;
extern unsigned char DDRD;
extern unsigned char PINB;
extern unsigned char PIND;
extern unsigned char PORTB;
extern unsigned char PORTD;
extern unsigned char UDR0;
#define U2X0 1
#define RXEN0 4
#define TXEN0 3
#endif
| Add some more common ports and pins | Add some more common ports and pins
| C | mit | vargad/dotfiles,vargad/dotfiles,vargad/dotfiles |
c4c2ca46421f642a05f12aa5d0ab7af8313c7df0 | extobjc/extobjc.h | extobjc/extobjc.h | /*
* extobjc.h
* extobjc
*
* Created by Justin Spahr-Summers on 2010-11-09.
* Released into the public domain.
*/
#import "EXTADT.h"
#import "EXTAspect.h"
#import "EXTBlockMethod.h"
#import "EXTBlockTarget.h"
#import "EXTConcreteProtocol.h"
#import "EXTDispatchObject.h"
#import "EXTFinalMethod.h"
#import "EXTKeyPathCoding.h"
#import "EXTMaybe.h"
#import "EXTMixin.h"
#import "EXTMultiObject.h"
#import "EXTNil.h"
#import "EXTPrivateMethod.h"
#import "EXTProtocolCategory.h"
#import "EXTSafeCategory.h"
#import "EXTScope.h"
#import "EXTSwizzle.h"
#import "EXTTuple.h"
#import "EXTVarargs.h"
#import "NSInvocation+EXT.h"
#import "NSMethodSignature+EXT.h"
| /*
* extobjc.h
* extobjc
*
* Created by Justin Spahr-Summers on 2010-11-09.
* Released into the public domain.
*/
#import "EXTADT.h"
#import "EXTAspect.h"
#import "EXTBlockMethod.h"
#import "EXTBlockTarget.h"
#import "EXTConcreteProtocol.h"
#import "EXTDispatchObject.h"
#import "EXTFinalMethod.h"
#import "EXTKeyPathCoding.h"
#import "EXTMaybe.h"
#import "EXTMixin.h"
#import "EXTMultimethod.h"
#import "EXTMultiObject.h"
#import "EXTNil.h"
#import "EXTPrivateMethod.h"
#import "EXTProtocolCategory.h"
#import "EXTSafeCategory.h"
#import "EXTScope.h"
#import "EXTSwizzle.h"
#import "EXTTuple.h"
#import "EXTVarargs.h"
#import "NSInvocation+EXT.h"
#import "NSMethodSignature+EXT.h"
| Add EXTMultimethod to umbrella header | Add EXTMultimethod to umbrella header
| C | mit | sandyway/libextobjc,kolyuchiy/libextobjc,WPDreamMelody/libextobjc,sunfei/libextobjc,goodheart/libextobjc,bboyesc/libextobjc,sanojnambiar/libextobjc,telly/libextobjc,jiakai-lian/libextobjc,liuruxian/libextobjc,KBvsMJ/libextobjc |
c86aa8f5c20a9d85460851418d8ba92fab23bb30 | sql/src/client/mem.h | sql/src/client/mem.h | #ifndef _MEM_H_
#define _MEM_H_
#include <config.h>
#ifdef _MSC_VER
#include <sql_config.h>
#endif
#include <stdio.h>
#include <assert.h>
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#define NEW( type ) (type*)malloc(sizeof(type) )
#define NEW_ARRAY( type, size ) (type*)malloc((size)*sizeof(type))
#define RENEW_ARRAY( type,ptr,size) (type*)realloc((void*)ptr,(size)*sizeof(type))
#define NEWADT( size ) (adt*)malloc(size)
#define _DELETE( ptr ) free(ptr)
#define _strdup( ptr ) strdup((char*)ptr)
#endif /*_MEM_H_*/
| #ifndef _MEM_H_
#define _MEM_H_
#include <config.h>
#include <sql_config.h>
#include <stdio.h>
#include <assert.h>
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#define NEW( type ) (type*)malloc(sizeof(type) )
#define NEW_ARRAY( type, size ) (type*)malloc((size)*sizeof(type))
#define RENEW_ARRAY( type,ptr,size) (type*)realloc((void*)ptr,(size)*sizeof(type))
#define NEWADT( size ) (adt*)malloc(size)
#define _DELETE( ptr ) free(ptr)
#define _strdup( ptr ) strdup((char*)ptr)
#endif /*_MEM_H_*/
| Include sql_config.h always so that we get HAVE_TERMIOS_H, so that the password doesn't get echoed. | Include sql_config.h always so that we get HAVE_TERMIOS_H, so that the
password doesn't get echoed.
| C | mpl-2.0 | zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb |
fbf5b9c1da353780074ca0129f80dd5f6b43664e | unix/sig_all.c | unix/sig_all.c | #include <signal.h>
#include "sig.h"
#include "sysdeps.h"
#define SIGMAX _NSIG
void sig_all_catch(signalfn fn)
{
int i;
for (i = 1; i < SIGMAX; i++)
if (i != SIGPROF)
sig_catch(i, fn);
}
void sig_all_default(void)
{
int i;
for (i = 1; i < SIGMAX; i++)
if (i != SIGPROF)
sig_default(i);
}
void sig_all_block(void)
{
int i;
#ifdef HASSIGPROCMASK
sigset_t set;
sigemptyset(&set);
for (i = 1; i < SIGMAX; i++)
if (i != SIGPROF)
sigaddset(&set, i);
sigprocmask(SIG_BLOCK, &set, 0);
#else
sigblock(~(1 << (SIGPROF-1)));
#endif
}
void sig_all_unblock(void)
{
#ifdef HASSIGPROCMASK
sigset_t set;
sigemptyset(&set);
sigprocmask(SIG_UNBLOCK, &set, 0);
#else
sigsetmask(0);
#endif
}
| #include <signal.h>
#include "sig.h"
#include "sysdeps.h"
#ifdef _SIG_MAXSIG
#define SIGMAX _SIG_MAXSIG
#else
#ifdef _NSIG
#define SIGMAX _NSIG
#else
#define SIGMAX 32
#endif
#endif
void sig_all_catch(signalfn fn)
{
int i;
for (i = 1; i < SIGMAX; i++)
if (i != SIGPROF)
sig_catch(i, fn);
}
void sig_all_default(void)
{
int i;
for (i = 1; i < SIGMAX; i++)
if (i != SIGPROF)
sig_default(i);
}
void sig_all_block(void)
{
int i;
#ifdef HASSIGPROCMASK
sigset_t set;
sigemptyset(&set);
for (i = 1; i < SIGMAX; i++)
if (i != SIGPROF)
sigaddset(&set, i);
sigprocmask(SIG_BLOCK, &set, 0);
#else
sigblock(~(1 << (SIGPROF-1)));
#endif
}
void sig_all_unblock(void)
{
#ifdef HASSIGPROCMASK
sigset_t set;
sigemptyset(&set);
sigprocmask(SIG_UNBLOCK, &set, 0);
#else
sigsetmask(0);
#endif
}
| Work on systems that don't define _NSIG | Work on systems that don't define _NSIG
| C | lgpl-2.1 | bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs |
3a883aee5ea4ed9fe27a627c439e4cb0eae18adf | src/lib/efl_egueb_document.c | src/lib/efl_egueb_document.c | /* EFL-Egueb Egueb based EFL extensions
* Copyright (C) 2013 - 2014 Jorge Luis Zapata
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "efl_egueb_private.h"
#include "efl_egueb_main.h"
/* Put the common interfaces with EFL here, like:
* - Animation
* - IO
* - Render?
*/
/*============================================================================*
* Local *
*============================================================================*/
/*============================================================================*
* Global *
*============================================================================*/
/*============================================================================*
* API *
*============================================================================*/
| Add the future file for common interfaces | Add the future file for common interfaces
| C | lgpl-2.1 | turran/efl-egueb,turran/efl-egueb |
|
3e8df9192426b28a6fdad02faeb98a5e51dc4e43 | src/vast/aliases.h | src/vast/aliases.h | #ifndef VAST_ALIASES_H
#define VAST_ALIASES_H
#include <cstdint>
namespace vast {
/// Uniquely identifies a VAST event.
using event_id = uint64_t;
/// Uniquely identifies a VAST type.
using type_id = uint64_t;
} // namespace vast
#endif
| #ifndef VAST_ALIASES_H
#define VAST_ALIASES_H
#include <cstdint>
#include <limits>
namespace vast {
/// Uniquely identifies a VAST event.
using event_id = uint64_t;
/// The smallest possible event ID.
static constexpr event_id min_event_id = 1;
/// The largest possible event ID.
static constexpr event_id max_event_id =
std::numeric_limits<event_id>::max() - 1;
/// Uniquely identifies a VAST type.
using type_id = uint64_t;
} // namespace vast
#endif
| Add names for ID space boundaries. | Add names for ID space boundaries.
| C | bsd-3-clause | mavam/vast,mavam/vast,mavam/vast,pmos69/vast,pmos69/vast,vast-io/vast,vast-io/vast,mavam/vast,vast-io/vast,pmos69/vast,vast-io/vast,vast-io/vast,pmos69/vast |
4cec50d3ba00a1a7afc1fc6f4ce536fe9759170f | src/plparrot.c | src/plparrot.c | #include "postgres.h"
#include "executor/spi.h"
#include "commands/trigger.h"
#include "fmgr.h"
#include "access/heapam.h"
#include "utils/syscache.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
PG_MODULE_MAGIC;
PG_FUNCTION_INFO_V1(plparrot_call_handler);
Datum
plparrot_call_handler(PG_FUNCTION_ARGS)
{
PG_RETURN_VOID();
}
| #include "postgres.h"
#include "executor/spi.h"
#include "commands/trigger.h"
#include "fmgr.h"
#include "access/heapam.h"
#include "utils/syscache.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
PG_MODULE_MAGIC;
Datum plparrot_call_handler(PG_FUNCTION_ARGS);
void plparrot_elog(int level, char *message);
PG_FUNCTION_INFO_V1(plparrot_call_handler);
Datum
plparrot_call_handler(PG_FUNCTION_ARGS)
{
PG_RETURN_VOID();
}
void
plparrot_elog(int level, char *message)
{
elog(level, "%s", message);
}
| Add simple function to interact with pgsql APIs, and make something for the NQP bits to export | Add simple function to interact with pgsql APIs, and make something for the NQP bits to export
| C | artistic-2.0 | leto/plparrot,leto/plparrot,leto/plparrot |
5b3f7c5dd5173b07bec251e3a685ccead22a1002 | src/readstat_convert.c | src/readstat_convert.c |
#include <errno.h>
#include "readstat.h"
#include "readstat_iconv.h"
#include "readstat_convert.h"
readstat_error_t readstat_convert(char *dst, size_t dst_len, const char *src, size_t src_len, iconv_t converter) {
/* strip off spaces from the input because the programs use ASCII space
* padding even with non-ASCII encoding. */
while (src_len && src[src_len-1] == ' ') {
src_len--;
}
if (converter) {
size_t dst_left = dst_len;
char *dst_end = dst;
size_t status = iconv(converter, (readstat_iconv_inbuf_t)&src, &src_len, &dst_end, &dst_left);
if (status == (size_t)-1) {
if (errno == E2BIG) {
return READSTAT_ERROR_CONVERT_LONG_STRING;
} else if (errno == EILSEQ) {
return READSTAT_ERROR_CONVERT_BAD_STRING;
} else if (errno != EINVAL) { /* EINVAL indicates improper truncation; accept it */
return READSTAT_ERROR_CONVERT;
}
}
dst[dst_len - dst_left] = '\0';
} else {
memcpy(dst, src, src_len);
dst[src_len] = '\0';
}
return READSTAT_OK;
}
|
#include <errno.h>
#include "readstat.h"
#include "readstat_iconv.h"
#include "readstat_convert.h"
readstat_error_t readstat_convert(char *dst, size_t dst_len, const char *src, size_t src_len, iconv_t converter) {
/* strip off spaces from the input because the programs use ASCII space
* padding even with non-ASCII encoding. */
while (src_len && src[src_len-1] == ' ') {
src_len--;
}
if (converter) {
size_t dst_left = dst_len;
char *dst_end = dst;
size_t status = iconv(converter, (readstat_iconv_inbuf_t)&src, &src_len, &dst_end, &dst_left);
if (status == (size_t)-1) {
if (errno == E2BIG) {
return READSTAT_ERROR_CONVERT_LONG_STRING;
} else if (errno == EILSEQ) {
return READSTAT_ERROR_CONVERT_BAD_STRING;
} else if (errno != EINVAL) { /* EINVAL indicates improper truncation; accept it */
return READSTAT_ERROR_CONVERT;
}
}
dst[dst_len - dst_left] = '\0';
} else if (src_len + 1 > dst_len) {
return READSTAT_ERROR_CONVERT_LONG_STRING;
} else {
memcpy(dst, src, src_len);
dst[src_len] = '\0';
}
return READSTAT_OK;
}
| Fix out of bounds writes during charset conversion | Fix out of bounds writes during charset conversion
Fixes #128. Thanks to Google Autofuzz Project
| C | mit | WizardMac/ReadStat,WizardMac/ReadStat |
b3d410c04e682cdb096bc1211544b9cf6a7186bf | src/runtime/buf_size.h | src/runtime/buf_size.h | #ifndef HALIDE_BUF_SIZE_H
#define HALIDE_BUF_SIZE_H
// TODO: in new buffer_t, add an inline method to do this and kill this file.
// Compute the total amount of memory we'd need to allocate on gpu to
// represent a given buffer (using the same strides as the host
// allocation).
WEAK size_t buf_size(const buffer_t *buf) {
size_t size = buf->elem_size;
for (size_t i = 0; i < sizeof(buf->stride) / sizeof(buf->stride[0]); i++) {
size_t positive_stride;
if (buf->stride[i] < 0) {
positive_stride = (size_t)-buf->stride[i];
} else {
positive_stride = (size_t)buf->stride[i];
}
size_t total_dim_size = buf->elem_size * buf->extent[i] * positive_stride;
if (total_dim_size > size) {
size = total_dim_size;
}
}
return size;
}
#endif // HALIDE_BUF_SIZE_H
| Add new file that was forgotten. | Add new file that was forgotten.
| C | mit | kgnk/Halide,kgnk/Halide,psuriana/Halide,ronen/Halide,kgnk/Halide,kgnk/Halide,jiawen/Halide,jiawen/Halide,kgnk/Halide,kgnk/Halide,psuriana/Halide,psuriana/Halide,ronen/Halide,ronen/Halide,jiawen/Halide,psuriana/Halide,jiawen/Halide,psuriana/Halide,jiawen/Halide,kgnk/Halide,ronen/Halide,ronen/Halide,ronen/Halide,kgnk/Halide,ronen/Halide,jiawen/Halide,psuriana/Halide,ronen/Halide,psuriana/Halide,jiawen/Halide |
|
a68494b48bbbdeb8293a0e5c521a501bf3eb3750 | OpenMRS-iOS/MRSVisit.h | OpenMRS-iOS/MRSVisit.h | //
// MRSVisit.h
// OpenMRS-iOS
//
// Created by Parker Erway on 12/2/14.
// Copyright (c) 2014 Erway Software. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MRSVisit : NSObject
@property (nonatomic, strong) NSString *displayName;
@property (nonatomic, strong) NSString *UUID;
@property (nonatomic) BOOL active;
@end
| //
// MRSVisit.h
// OpenMRS-iOS
//
// Created by Parker Erway on 12/2/14.
// Copyright (c) 2014 Erway Software. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "MRSLocation.h"
@class MRSVisitType;
@interface MRSVisit : NSObject
@property (nonatomic, strong) NSString *displayName;
@property (nonatomic, strong) NSString *UUID;
@property (nonatomic, strong) NSString *startDateTime;
@property (nonatomic, strong) MRSVisitType *visitType;
@property (nonatomic, strong) MRSLocation *location;
@property (nonatomic) BOOL active;
@end
| Add new attributes to Visit class | Add new attributes to Visit class
| C | mpl-2.0 | yousefhamza/openmrs-contrib-ios-client,Undo1/openmrs-contrib-ios-client,yousefhamza/openmrs-contrib-ios-client,Undo1/openmrs-contrib-ios-client |
17e3691b024a18b4c5bd7359436bd8002074f537 | Equinox/SimpleTimer.h | Equinox/SimpleTimer.h | #ifndef __TIMER_H__
#define __TIMER_H__
#include "SDL/include/SDL.h"
class SimpleTimer
{
public:
SimpleTimer()
{
pausedTicks = 0, runTicks = 0;
running = false;
}
void Start()
{
running = true;
runTicks = SDL_GetTicks();
}
void Stop()
{
if(running)
{
running = false;
pausedTicks = SDL_GetTicks() - runTicks;
}
}
void Resume()
{
if(!running)
{
running = true;
runTicks = SDL_GetTicks() - pausedTicks;
pausedTicks = 0;
}
}
void Clear()
{
running = false;
runTicks = 0;
pausedTicks = 0;
}
int GetTimerTicks() const
{
if (running)
return SDL_GetTicks() - runTicks;
return 0;
}
bool IsRunning() const
{
return running;
}
private:
int pausedTicks, runTicks;
bool running;
};
#endif // __TIMER_H__ | #ifndef __TIMER_H__
#define __TIMER_H__
#include "SDL/include/SDL.h"
class SimpleTimer
{
public:
SimpleTimer()
{
pausedTicks = 0, runTicks = 0;
running = false;
}
void Start()
{
running = true;
runTicks = SDL_GetTicks();
}
int Stop()
{
if(running)
{
running = false;
return pausedTicks = SDL_GetTicks() - runTicks;
}
return 0;
}
void Resume()
{
if(!running)
{
running = true;
runTicks = SDL_GetTicks() - pausedTicks;
pausedTicks = 0;
}
}
void Clear()
{
running = false;
runTicks = 0;
pausedTicks = 0;
}
unsigned int GetTimerTicks() const
{
if (running)
return SDL_GetTicks() - runTicks;
return 0;
}
unsigned int GetPausedTicks() const
{
if (!running)
return pausedTicks;
return 0;
}
bool IsRunning() const
{
return running;
}
private:
unsigned int pausedTicks, runTicks;
bool running;
};
#endif // __TIMER_H__ | Change int to unsigned int | Change int to unsigned int
| C | mit | NeebulaGames/EquinoxEngine,NeebulaGames/EquinoxEngine,NeebulaGames/EquinoxEngine |
896daac6a878b6cf5feaa718c6a518335dfcc109 | src/dtkCore/dtkSingleton.h | src/dtkCore/dtkSingleton.h | #ifndef DTKSINGLETON_H
#define DTKSINGLETON_H
#include <QtCore/QMutex>
template <class T> class dtkSingleton
{
public:
static T& instance(void)
{
static QMutex mutex;
if(!s_instance) {
mutex.lock();
if(!s_instance)
s_instance = new T;
mutex.unlock();
}
return s_instance;
}
private:
dtkSingleton(void) {};
~dtkSingleton(void) {};
private:
Q_DISABLE_COPY(dtkSingleton)
private:
static T *s_instance;
};
template <class T> T *dtkSingleton<T>::s_instance = NULL;
#define DTK_IMPLEMENT_SINGLETON(T) \
T *T::instance() \
{ \
return &(dtkSingleton<T>::instance()); \
}
#endif //DTKSINGLETON
| #ifndef DTKSINGLETON_H
#define DTKSINGLETON_H
#include <QtCore/QMutex>
template <class T> class dtkSingleton
{
public:
static T& instance(void)
{
static QMutex mutex;
if(!s_instance) {
mutex.lock();
if(!s_instance)
s_instance = new T;
mutex.unlock();
}
return (*s_instance);
}
private:
dtkSingleton(void) {};
~dtkSingleton(void) {};
private:
Q_DISABLE_COPY(dtkSingleton)
private:
static T *s_instance;
};
template <class T> T *dtkSingleton<T>::s_instance = NULL;
#define DTK_IMPLEMENT_SINGLETON(T) \
T *T::instance() \
{ \
return &(dtkSingleton<T>::instance()); \
}
#endif //DTKSINGLETON
| Fix generic singleton accessor syntax. | Fix generic singleton accessor syntax.
| C | bsd-3-clause | d-tk/dtk,NicolasSchnitzler/dtk,NicolasSchnitzler/dtk,NicolasSchnitzler/dtk,d-tk/dtk,rdebroiz/dtk,d-tk/dtk,rdebroiz/dtk,d-tk/dtk,d-tk/dtk,rdebroiz/dtk,NicolasSchnitzler/dtk,d-tk/dtk,rdebroiz/dtk |
d8036e2cc4c1c60c5a2344df288af8d5e67b1bfc | src/string_reverse/string_reverse.c | src/string_reverse/string_reverse.c | #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
int main()
{
// Read string from a file
FILE* file_ptr = fopen("test.txt", "r");
if (file_ptr == NULL)
return 1;
char* string = malloc(256);
fscanf(file_ptr, "%s", string);
// Solution
int length = sprintf(string, "%s", string);
int front = 0;
int back = length - 1;
while(front < back)
{
// swap 2 characters
char tmp = string[front];
string[front] = string[back];
string[back] = tmp;
++front;
--back;
}
printf("%s\n", string);
return 0;
}
| #include <stdio.h>
#include <stdlib.h>
void reverse(char* string)
{
char* back = string;
char tmp;
while(*back)
++back;
// Move from the null terminator
--back;
while (string < back)
{
char tmp = *string;
*string = *back;
*back = tmp;
++string;
--back;
}
}
int main()
{
// Read string from a file
FILE* file_ptr = fopen("test.txt", "r");
if (file_ptr == NULL)
return 1;
char* string = malloc(256);
fscanf(file_ptr, "%s", string);
// Solution
reverse(string);
printf("%s\n", string);
return 0;
}
| Handle null terminator in string reverse | Handle null terminator in string reverse
| C | mit | cknadler/questions |
4020b05b515c5a486de3224739e370dedfb5c005 | ext/ffi_c/Pointer.h | ext/ffi_c/Pointer.h |
#ifndef _POINTER_H
#define _POINTER_H
#ifdef __cplusplus
extern "C" {
#endif
#include "AbstractMemory.h"
extern void rbffi_Pointer_Init(VALUE moduleFFI);
extern void rbffi_NullPointer_Init(VALUE moduleFFI);
extern VALUE rbffi_Pointer_NewInstance(void* addr);
extern VALUE rbffi_PointerClass;
extern VALUE rbffi_NullPointerClass;
extern VALUE rbffi_NullPointerSingleton;
extern MemoryOps rbffi_NullPointerOps;
#ifdef __cplusplus
}
#endif
#endif /* _POINTER_H */
| /*
* Copyright (c) 2008, 2009, Wayne Meissner
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* * 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.
* * The name of the author or authors may not be used to endorse or promote
* products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef RBFFI_POINTER_H
#define RBFFI_POINTER_H
#ifdef __cplusplus
extern "C" {
#endif
#include "AbstractMemory.h"
extern void rbffi_Pointer_Init(VALUE moduleFFI);
extern VALUE rbffi_Pointer_NewInstance(void* addr);
extern VALUE rbffi_PointerClass;
extern VALUE rbffi_NullPointerSingleton;
#ifdef __cplusplus
}
#endif
#endif /* RBFFI_POINTER_H */
| Remove some leftover null pointer vars | Remove some leftover null pointer vars
| C | bsd-3-clause | majioa/ffi,tduehr/ffi,sparkchaser/ffi,ferventcoder/ffi,majioa/ffi,mvz/ffi,yghannam/ffi,tduehr/ffi,sparkchaser/ffi,ferventcoder/ffi,tduehr/ffi,MikaelSmith/ffi,ffi/ffi,majioa/ffi,ffi/ffi,mvz/ffi,sparkchaser/ffi,sparkchaser/ffi,MikaelSmith/ffi,tduehr/ffi,mvz/ffi,yghannam/ffi,ferventcoder/ffi,MikaelSmith/ffi,mvz/ffi,yghannam/ffi,ferventcoder/ffi,yghannam/ffi,majioa/ffi,MikaelSmith/ffi,yghannam/ffi,ffi/ffi |
a81e238bcc471d0d8bf305a05da54d56eeef7ff5 | test/Driver/no-canonical-prefixes.c | test/Driver/no-canonical-prefixes.c | // Due to ln -sf:
// REQUIRES: shell
// RUN: rm -rf %t.real
// RUN: mkdir -p %t.real
// RUN: cd %t.real
// RUN: ln -sf %clang test-clang
// RUN: cd ..
// Important to remove %t.fake: If it already is a symlink to %t.real when
// `ln -sf %t.real %t.fake` runs, then that would symlink %t.real to itself,
// forming a cycle.
// RUN: rm -rf %t.fake
// RUN: ln -sf %t.real %t.fake
// RUN: cd %t.fake
// RUN: ./test-clang -v -S %s 2>&1 | FileCheck --check-prefix=CANONICAL %s
// RUN: ./test-clang -v -S %s -no-canonical-prefixes 2>&1 | FileCheck --check-prefix=NON-CANONICAL %s
//
// FIXME: This should really be '.real'.
// CANONICAL: InstalledDir: {{.*}}.fake
// CANONICAL: {{[/|\\]*}}clang{{.*}}" -cc1
//
// NON-CANONICAL: InstalledDir: .{{$}}
// NON-CANONICAL: test-clang" -cc1
| // Due to ln -sf:
// REQUIRES: shell
// RUN: mkdir -p %t.real
// RUN: cd %t.real
// RUN: ln -sf %clang test-clang
// RUN: cd ..
// If %.fake already is a symlink to %t.real when `ln -sf %t.real %t.fake`
// runs, then that would symlink %t.real to itself, forming a cycle.
// The `-n` flag prevents this.
// RUN: ln -sfn %t.real %t.fake
// RUN: cd %t.fake
// RUN: ./test-clang -v -S %s 2>&1 | FileCheck --check-prefix=CANONICAL %s
// RUN: ./test-clang -v -S %s -no-canonical-prefixes 2>&1 | FileCheck --check-prefix=NON-CANONICAL %s
//
// FIXME: This should really be '.real'.
// CANONICAL: InstalledDir: {{.*}}.fake
// CANONICAL: {{[/|\\]*}}clang{{.*}}" -cc1
//
// NON-CANONICAL: InstalledDir: .{{$}}
// NON-CANONICAL: test-clang" -cc1
| Use `ln -n` to prevent forming a symlink cycle, instead of rm'ing the source | Use `ln -n` to prevent forming a symlink cycle, instead of rm'ing the source
This is a better fix for the problem fixed in r334972.
Also remove the rm'ing of the symlink destination that was there to
clean up the bots -- it's over a year later, bots should be happy now.
Differential Revision: https://reviews.llvm.org/D64301
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@365414 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang |
cde8356ff78ad98f1c5cf8f34fa92014a1c0342f | kernel.h | kernel.h | extern void denoise(void*, int, const uint32_t *in, uint32_t *out, int h, int w);
extern void *kernelInit(void);
extern void kernelFinalize(void*);
enum {
SPATIAL,
TEMPORAL_AVG,
KNN,
AKNN,
ADAPTIVE_TEMPORAL_AVG,
DIFF,
SOBEL,
MOTION,
};
| extern void denoise(void*, int, const uint32_t *in, uint32_t *out, int h, int w);
extern void *kernelInit(void);
extern void kernelFinalize(void*);
enum {
// "Real" filters
SPATIAL,
TEMPORAL_AVG,
ADAPTIVE_TEMPORAL_AVG,
KNN,
AKNN,
// Helpers
DIFF,
SOBEL,
MOTION,
NFILTERS,
};
| Add comments for filter enums | Add comments for filter enums
| C | mit | xiaq/webcamfilter,xiaq/webcamfilter,xiaq/webcamfilter |
82a080813c8def8caace0d3b11079cfa20c72766 | src/modules/conf_randr/e_smart_monitor.h | src/modules/conf_randr/e_smart_monitor.h | #ifdef E_TYPEDEFS
#else
# ifndef E_SMART_MONITOR_H
# define E_SMART_MONITOR_H
Evas_Object *e_smart_monitor_add(Evas *evas);
# endif
#endif
| #ifdef E_TYPEDEFS
#else
# ifndef E_SMART_MONITOR_H
# define E_SMART_MONITOR_H
Evas_Object *e_smart_monitor_add(Evas *evas);
void e_smart_monitor_crtc_set(Evas_Object *obj, E_Randr_Crtc_Config *crtc);
void e_smart_monitor_output_set(Evas_Object *obj, E_Randr_Output_Config *output);
# endif
#endif
| Add function prototypes for setting monitor crtc and output config. | Add function prototypes for setting monitor crtc and output config.
Signed-off-by: Christopher Michael <[email protected]>
SVN revision: 84129
| C | bsd-2-clause | tasn/enlightenment,rvandegrift/e,rvandegrift/e,rvandegrift/e,FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment,tasn/enlightenment,tasn/enlightenment,tizenorg/platform.upstream.enlightenment,FlorentRevest/Enlightenment,FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment |
50c4ea79c8ba7f43cf0c47b8670824d0e60597ce | crater.c | crater.c | /* Copyright (C) 2014-2015 Ben Kurtovic <[email protected]>
Released under the terms of the MIT License. See LICENSE for details. */
#include <stdlib.h>
#include "src/config.h"
#include "src/logging.h"
#include "src/rom.h"
/*
Main function.
*/
int main(int argc, char *argv[])
{
Config *config;
ROM *rom;
int retval;
retval = config_create(&config, argc, argv);
if (retval != CONFIG_OK)
return retval == CONFIG_EXIT_SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE;
printf("crater: a Sega Game Gear emulator\n\n");
#ifdef DEBUG_MODE
config_dump_args(config);
#endif
if (!(rom = rom_open(config->rom_path))) {
if (errno == ENOMEM)
OUT_OF_MEMORY()
else
FATAL_ERRNO("couldn't load ROM image '%s'", config->rom_path)
}
printf("Loaded ROM image: %s.\n", rom->name);
// TODO: start from here
rom_close(rom);
config_destroy(config);
return EXIT_SUCCESS;
}
| /* Copyright (C) 2014-2015 Ben Kurtovic <[email protected]>
Released under the terms of the MIT License. See LICENSE for details. */
#include <stdlib.h>
#include "src/config.h"
#include "src/logging.h"
#include "src/rom.h"
/*
Main function.
*/
int main(int argc, char *argv[])
{
Config *config;
int retval;
retval = config_create(&config, argc, argv);
if (retval != CONFIG_OK)
return retval == CONFIG_EXIT_SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE;
#ifdef DEBUG_MODE
config_dump_args(config);
#endif
if (config->assemble) {
printf("Running assembler: %s -> %s.\n",config->src_path, config->dst_path);
} else if (config->disassemble) {
printf("Running disassembler: %s -> %s.\n", config->src_path, config->dst_path);
} else {
ROM *rom;
printf("crater: a Sega Game Gear emulator\n\n");
if (!(rom = rom_open(config->rom_path))) {
if (errno == ENOMEM)
OUT_OF_MEMORY()
else
FATAL_ERRNO("couldn't load ROM image '%s'", config->rom_path)
}
printf("Loaded ROM image: %s.\n", rom->name);
// TODO: start from here
rom_close(rom);
}
config_destroy(config);
return EXIT_SUCCESS;
}
| Call different stuff for the assembler/disassembler. | Call different stuff for the assembler/disassembler.
| C | mit | earwig/crater,earwig/crater,earwig/crater,earwig/crater |
0319204b74cf182ffe0670e51154bd14b3510dc7 | include/flatcc/portable/pwarnings.h | include/flatcc/portable/pwarnings.h | #ifndef PWARNINGS_H
#define PWARNINGS_H
#if defined(_MSC_VER)
/* Needed when flagging code in or out and more. */
#pragma warning(disable: 4127) /* conditional expression is constant */
/* happens also in MS's own headers. */
#pragma warning(disable: 4668) /* preprocessor name not defined */
/* MSVC does not respect double parenthesis for intent */
#pragma warning(disable: 4706) /* assignment within conditional expression */
/* `inline` only advisory anyway. */
#pragma warning(disable: 4710) /* function not inlined */
/* Well, we don't intend to add the padding manually. */
#pragma warning(disable: 4820) /* x bytes padding added in struct */
/* Define this in the build as `-D_CRT_SECURE_NO_WARNINGS`, it has no effect here. */
/* #define _CRT_SECURE_NO_WARNINGS don't warn that fopen etc. are unsafe */
/*
* Anonymous union in struct is valid in C11 and has been supported in
* GCC and Clang for a while, but it is not C99. MSVC also handles it,
* but warns. Truly portable code should perhaps not use this feature,
* but this is not the place to complain about it.
*/
#pragma warning(disable: 4201) /* nonstandard extension used: nameless struct/union */
#endif
#endif PWARNINGS_H
| #ifndef PWARNINGS_H
#define PWARNINGS_H
#if defined(_MSC_VER)
/* Needed when flagging code in or out and more. */
#pragma warning(disable: 4127) /* conditional expression is constant */
/* happens also in MS's own headers. */
#pragma warning(disable: 4668) /* preprocessor name not defined */
/* MSVC does not respect double parenthesis for intent */
#pragma warning(disable: 4706) /* assignment within conditional expression */
/* `inline` only advisory anyway. */
#pragma warning(disable: 4710) /* function not inlined */
/* Well, we don't intend to add the padding manually. */
#pragma warning(disable: 4820) /* x bytes padding added in struct */
/* Define this in the build as `-D_CRT_SECURE_NO_WARNINGS`, it has no effect here. */
/* #define _CRT_SECURE_NO_WARNINGS don't warn that fopen etc. are unsafe */
/*
* Anonymous union in struct is valid in C11 and has been supported in
* GCC and Clang for a while, but it is not C99. MSVC also handles it,
* but warns. Truly portable code should perhaps not use this feature,
* but this is not the place to complain about it.
*/
#pragma warning(disable: 4201) /* nonstandard extension used: nameless struct/union */
#endif
#endif /* PWARNINGS_H */
| Fix warning in header disabling some warnings (sigh) | Fix warning in header disabling some warnings (sigh)
| C | apache-2.0 | skhoroshavin/flatcc,skhoroshavin/flatcc,skhoroshavin/flatcc,dvidelabs/flatcc,dvidelabs/flatcc,dvidelabs/flatcc |
8ab76006de60ad761be1528e75f7e9898270c1f9 | include/dfb_types.h | include/dfb_types.h | #ifndef __DFB_TYPES_H__
#define __DFB_TYPES_H__
#ifdef USE_KOS
#include <sys/types.h>
typedef uint8 u8;
typedef uint16 u16;
typedef uint32 u32;
typedef uint64 u64;
typedef sint8 s8;
typedef sint16 s16;
typedef sint32 s32;
typedef sint64 s64;
#else
#include <stdint.h>
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;
#endif
#endif
| #ifndef __DFB_TYPES_H__
#define __DFB_TYPES_H__
#ifdef USE_KOS
#include <sys/types.h>
typedef uint8 u8;
typedef uint16 u16;
typedef uint32 u32;
typedef uint64 u64;
typedef sint8 s8;
typedef sint16 s16;
typedef sint32 s32;
typedef sint64 s64;
#else
#include <stdint.h>
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;
#endif
#ifndef DIRECTFB_NO_CRUFT
#define __u8 u8
#define __u16 u16
#define __u32 u32
#define __u64 u64
#define __s8 s8
#define __s16 s16
#define __s32 s32
#define __s64 s64
#endif
#endif
| Define compatibility macros for __ types unless DIRECTFB_NO_CRUFT is defined. | Define compatibility macros for __ types unless DIRECTFB_NO_CRUFT is defined.
| C | lgpl-2.1 | dfbdok/DirectFB1,dfbdok/DirectFB1,mtsekm/test,deniskropp/DirectFB,kevleyski/directfb,kevleyski/DirectFB-1,deniskropp/DirectFB,deniskropp/DirectFB,mtsekm/test,lancebaiyouview/DirectFB,kaostao/directfb,lancebaiyouview/DirectFB,djbclark/directfb-core-DirectFB,djbclark/directfb-core-DirectFB,djbclark/directfb-core-DirectFB,Distrotech/DirectFB,sklnet/DirectFB,lancebaiyouview/DirectFB,Distrotech/DirectFB,kaostao/directfb,Distrotech/DirectFB,kaostao/directfb,sklnet/DirectFB,kevleyski/directfb,sklnet/DirectFB,mtsekm/test,kevleyski/directfb,kevleyski/DirectFB-1,djbclark/directfb-core-DirectFB,jcdubois/DirectFB,dfbdok/DirectFB1,DirectFB/directfb,kevleyski/DirectFB-1,jcdubois/DirectFB,deniskropp/DirectFB,kevleyski/directfb,jcdubois/DirectFB,DirectFB/directfb,DirectFB/directfb,lancebaiyouview/DirectFB,sklnet/DirectFB,kevleyski/DirectFB-1 |
5c80c5e640d0fcb238cd3b9546c3a33edf7ca45c | tests/dcpu-testing.c | tests/dcpu-testing.c | int test(int a, int b, int c, int d, int e);
typedef (*funcCall)();
short array = {0x61c1};
int main()
{
((funcCall)array)();
return test(1, 2, 3, 4, 5);
}
int test(int a, int b, int c, int d, int e)
{
return (e + (a + b + c) * a / d) + (a * 6);
}
| int test(int a, int b, int c, int d, int e);
typedef (*funcCall)();
short array = {0x61c1};
int main()
{
((funcCall)array)();
int some_var = 3;
int ret = test(1, 2, 3, 4, 5);
return some_var + ret;
}
int foo(int a)
{
return 9 + a;
}
int test(int a, int b, int c, int d, int e)
{
a = foo(a);
return ((a + b + c) * d / a) + (d * e);
}
| Make example a bit more advanced | Make example a bit more advanced
| C | lgpl-2.1 | Wallbraker/DCPU-TCC,Wallbraker/DCPU-TCC,Wallbraker/DCPU-TCC |
9ef6cf64a9fff87a5e2135fd831e5586f38b0d6d | Applications/Simple/FragariaAppDelegate.h | Applications/Simple/FragariaAppDelegate.h | //
// FragariaAppDelegate.h
// Fragaria
//
// Created by Jonathan on 30/04/2010.
// Copyright 2010 mugginsoft.com. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <MGSFragaria/MGSFragariaTextViewDelegate.h>
#import <MGSFragaria/SMLSyntaxColouringDelegate.h>
@class SMLTextView;
@class MGSFragaria;
@class MGSSimpleBreakpointDelegate;
@interface FragariaAppDelegate : NSObject <NSApplicationDelegate, MGSFragariaTextViewDelegate, SMLSyntaxColouringDelegate>
- (IBAction)showPreferencesWindow:(id)sender;
- (IBAction)copyToPasteBoard:(id)sender;
- (IBAction)reloadString:(id)sender;
@property (weak) IBOutlet NSWindow *window;
@property (weak) IBOutlet NSView *editView;
@property (nonatomic,assign) NSString *syntaxDefinition;
@end
| //
// FragariaAppDelegate.h
// Fragaria
//
// Created by Jonathan on 30/04/2010.
// Copyright 2010 mugginsoft.com. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <MGSFragaria/MGSFragariaTextViewDelegate.h>
#import <MGSFragaria/SMLSyntaxColouringDelegate.h>
#import <MGSFragaria/MGSDragOperationDelegate.h>
@class SMLTextView;
@class MGSFragaria;
@class MGSSimpleBreakpointDelegate;
@interface FragariaAppDelegate : NSObject <NSApplicationDelegate, MGSFragariaTextViewDelegate, SMLSyntaxColouringDelegate, MGSDragOperationDelegate>
- (IBAction)showPreferencesWindow:(id)sender;
- (IBAction)copyToPasteBoard:(id)sender;
- (IBAction)reloadString:(id)sender;
@property (weak) IBOutlet NSWindow *window;
@property (weak) IBOutlet NSView *editView;
@property (nonatomic,assign) NSString *syntaxDefinition;
@end
| Fix simple example delegate's protocol compliance. | Fix simple example delegate's protocol compliance.
| C | apache-2.0 | vakoc/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,bitstadium/Fragaria,shysaur/Fragaria,vakoc/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,bitstadium/Fragaria,shysaur/Fragaria,shysaur/Fragaria |
1a3e5dcc47629e1707191ab1641a89be5eb1328b | src/storage/module.h | src/storage/module.h | /*
* waysome - wayland based window manager
*
* Copyright in alphabetical order:
*
* Copyright (C) 2014-2015 Julian Ganz
* Copyright (C) 2014-2015 Manuel Messner
* Copyright (C) 2014-2015 Marcel Müller
* Copyright (C) 2014-2015 Matthias Beyer
* Copyright (C) 2014-2015 Nadja Sommerfeld
*
* This file is part of waysome.
*
* waysome 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.
*
* waysome is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with waysome. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __WS_STORAGE_MODULE_H__
#define __WS_STORAGE_MODULE_H__
#endif // __WS_STORAGE_MODULE_H__
| /*
* waysome - wayland based window manager
*
* Copyright in alphabetical order:
*
* Copyright (C) 2014-2015 Julian Ganz
* Copyright (C) 2014-2015 Manuel Messner
* Copyright (C) 2014-2015 Marcel Müller
* Copyright (C) 2014-2015 Matthias Beyer
* Copyright (C) 2014-2015 Nadja Sommerfeld
*
* This file is part of waysome.
*
* waysome 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.
*
* waysome is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with waysome. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @addtogroup storage "Storage"
*
* @{
*/
#ifndef __WS_STORAGE_MODULE_H__
#define __WS_STORAGE_MODULE_H__
#endif // __WS_STORAGE_MODULE_H__
/**
* @}
*/
| Add storage files to storage documentation group | Add storage files to storage documentation group
| C | lgpl-2.1 | waysome/waysome,waysome/waysome |
e0a5c2288da7d2b7b20e3725e0e060269dbc2be5 | src/rtpp_version.h | src/rtpp_version.h | #define RTPP_SW_VERSION "rel.20140506110718"
| /* IPOLICE_FLAGS: DONT_REMOVE */
#define RTPP_SW_VERSION "rel.20160514172346"
| Add IPOLICE_FLAGS: DONT_REMOVE, bump RTPP_SW_VERSION forward. | Add IPOLICE_FLAGS: DONT_REMOVE, bump RTPP_SW_VERSION forward.
| C | bsd-2-clause | dsanders11/rtpproxy,synety-jdebp/rtpproxy,jevonearth/rtpproxy,synety-jdebp/rtpproxy,sippy/rtpproxy,synety-jdebp/rtpproxy,synety-jdebp/rtpproxy,jevonearth/rtpproxy,jevonearth/rtpproxy,sippy/rtpproxy,dsanders11/rtpproxy,dsanders11/rtpproxy,jevonearth/rtpproxy,sippy/rtpproxy |
b7eefacc5e2fb92cd67098bde440e623075213cd | testing/test_utils.c | testing/test_utils.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "cem/utils.h"
static void test_set_periodic_multiple_of_4(void) {
const int len = 12;
int array[12] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
int expected[12] = {6, 7, 8, 3, 4, 5, 6, 7, 8, 3, 4, 5};
apply_periodic_boundary(array, sizeof(int), len);
g_assert_cmpmem(array, len, expected, len);
}
static void test_set_periodic_even_width(void) {
const int len = 10;
int array[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
int expected[10] = {5, 6, 2, 3, 4, 5, 6, 2, 3, 4};
apply_periodic_boundary(array, sizeof(int), len);
g_assert_cmpmem(array, len, expected, len);
}
static void test_set_periodic_odd_width(void) {
const int len = 11;
int array[11] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int expected[11] = {5, 6, 7, 3, 4, 5, 6, 7, 3, 4, 5};
apply_periodic_boundary(array, sizeof(int), len);
g_assert_cmpmem(array, len, expected, len);
}
int main(int argc, char* argv[]) {
g_test_init(&argc, &argv, NULL);
g_test_add_func("/cem/utils/set_periodic_4", &test_set_periodic_multiple_of_4);
g_test_add_func("/cem/utils/set_periodic_even", &test_set_periodic_even_width);
g_test_add_func("/cem/utils/set_periodic_odd", &test_set_periodic_odd_width);
return g_test_run();
}
| Add unit tests for utils.c functions. | Add unit tests for utils.c functions.
| C | mit | csdms-contrib/cem |
|
b3590333382a99d18cc057bc509052629f21e87a | 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: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@9021 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
| C | bsd-3-clause | wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser |
|
f651d51d97b75f12ba68f1cbfca914724136d121 | tools/halide_image.h | tools/halide_image.h | #ifndef HALIDE_TOOLS_IMAGE_H
#define HALIDE_TOOLS_IMAGE_H
/*
This allows code that relied on halide_image.h and Halide::Tools::Image to
continue to work with newer versions of Halide where HalideBuffer.h and
Halide::Buffer are the way to work with data.
Besides mapping Halide::Tools::Image to Halide::Buffer, it defines
USING_HALIDE_BUFFER to allow code to conditionally compile for one or the
other.
It is intended as a stop-gap measure until the code can be updated.
*/
#include "HalideBuffer.h"
namespace Halide {
namespace Tools {
#define USING_HALIDE_BUFFER
template< typename T >
using Image = Buffer<T>;
} // namespace Tools
} // mamespace Halide
#endif // #ifndef HALIDE_TOOLS_IMAGE_H
| #ifndef HALIDE_TOOLS_IMAGE_H
#define HALIDE_TOOLS_IMAGE_H
/** \file
*
* This allows code that relied on halide_image.h and
* Halide::Tools::Image to continue to work with newer versions of
* Halide where HalideBuffer.h and Halide::Buffer are the way to work
* with data.
*
* Besides mapping Halide::Tools::Image to Halide::Buffer, it defines
* USING_HALIDE_BUFFER to allow code to conditionally compile for one
* or the other.
*
* It is intended as a stop-gap measure until the code can be updated.
*/
#include "HalideBuffer.h"
namespace Halide {
namespace Tools {
#define USING_HALIDE_BUFFER
template< typename T >
using Image = Buffer<T>;
} // namespace Tools
} // mamespace Halide
#endif // #ifndef HALIDE_TOOLS_IMAGE_H
| Reformat comment into Doxygen comment for file. | Reformat comment into Doxygen comment for file.
| C | mit | kgnk/Halide,kgnk/Halide,psuriana/Halide,psuriana/Halide,kgnk/Halide,kgnk/Halide,psuriana/Halide,psuriana/Halide,kgnk/Halide,kgnk/Halide,psuriana/Halide,psuriana/Halide,kgnk/Halide,psuriana/Halide,kgnk/Halide |
cacbf0ecd02835adb555a9d64294e3ae987d918d | GoogleMaps/GoogleMapsDemos/SDKDemoAPIKey.h | GoogleMaps/GoogleMapsDemos/SDKDemoAPIKey.h | /*
* Copyright 2016 Google LLC. All rights reserved.
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
* ANY KIND, either express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/**
* To use GoogleMapsDemos, please register an API Key for your application and set it here. Your
* API Key should be kept private.
*
* See documentation on getting an API Key for your API Project here:
* https://developers.google.com/maps/documentation/ios/start#get-key
*/
//#error Register for API Key and insert here. Then delete this line.
static NSString *const kAPIKey = @";ajlksdf";
| /*
* Copyright 2016 Google LLC. All rights reserved.
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
* ANY KIND, either express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/**
* To use GoogleMapsDemos, please register an API Key for your application and set it here. Your
* API Key should be kept private.
*
* See documentation on getting an API Key for your API Project here:
* https://developers.google.com/maps/documentation/ios/start#get-key
*/
#error Register for API Key and insert here. Then delete this line.
static NSString *const kAPIKey = @"";
| Use empty string as the default kAPIKey | fix: Use empty string as the default kAPIKey | C | apache-2.0 | googlemaps/maps-sdk-for-ios-samples,googlemaps/maps-sdk-for-ios-samples,googlemaps/maps-sdk-for-ios-samples,googlemaps/maps-sdk-for-ios-samples |
531ec1e7a2330a76ef7168167f42440cc88fbfd5 | test/CFrontend/2007-06-18-SextAttrAggregate.c | test/CFrontend/2007-06-18-SextAttrAggregate.c | // RUN: llvm-gcc %s -o - -S -emit-llvm -O3 | grep {i8 sext}
// PR1513
struct s{
long a;
long b;
};
void f(struct s a, char *b, char C) {
}
| // RUN: %llvmgcc %s -o - -S -emit-llvm -O3 | grep {i8 sext}
// PR1513
struct s{
long a;
long b;
};
void f(struct s a, char *b, char C) {
}
| Fix this test to not rely on the path but to use the configured llvm-gcc instead. | Fix this test to not rely on the path but to use the
configured llvm-gcc instead.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@39992 91177308-0d34-0410-b5e6-96231b3b80d8
| C | bsd-2-clause | chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap |
755fb0f25342c7ebd8df2c736e46a812d2408f91 | Pod/Classes/PINRemoteImageMacros.h | Pod/Classes/PINRemoteImageMacros.h | //
// PINRemoteImageMacros.h
// PINRemoteImage
//
// Created by Brian Dorfman on 10/15/15.
// Copyright © 2015 Pinterest. All rights reserved.
//
#ifndef PINRemoteImageMacros_h
#define PINRemoteImageMacros_h
#define PINRemoteImageLogging 0
#if PINRemoteImageLogging
#define PINLog(args...) NSLog(args)
#else
#define PINLog(args...)
#endif
#if __has_include(<FLAnimatedImage/FLAnimatedImage.h>)
#define USE_FLANIMATED_IMAGE 1
#else
#define USE_FLANIMATED_IMAGE 0
#define FLAnimatedImage NSObject
#endif
#define BlockAssert(condition, desc, ...) \
do { \
__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
if (!(condition)) { \
[[NSAssertionHandler currentHandler] handleFailureInMethod:_cmd \
object:strongSelf file:[NSString stringWithUTF8String:__FILE__] \
lineNumber:__LINE__ description:(desc), ##__VA_ARGS__]; \
} \
__PRAGMA_POP_NO_EXTRA_ARG_WARNINGS \
} while(0);
#endif /* PINRemoteImageMacros_h */
| //
// PINRemoteImageMacros.h
// PINRemoteImage
//
#ifndef PINRemoteImageMacros_h
#define PINRemoteImageMacros_h
#define PINRemoteImageLogging 0
#if PINRemoteImageLogging
#define PINLog(args...) NSLog(args)
#else
#define PINLog(args...)
#endif
#if __has_include(<FLAnimatedImage/FLAnimatedImage.h>)
#define USE_FLANIMATED_IMAGE 1
#else
#define USE_FLANIMATED_IMAGE 0
#define FLAnimatedImage NSObject
#endif
#define BlockAssert(condition, desc, ...) \
do { \
__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
if (!(condition)) { \
[[NSAssertionHandler currentHandler] handleFailureInMethod:_cmd \
object:strongSelf file:[NSString stringWithUTF8String:__FILE__] \
lineNumber:__LINE__ description:(desc), ##__VA_ARGS__]; \
} \
__PRAGMA_POP_NO_EXTRA_ARG_WARNINGS \
} while(0);
#endif /* PINRemoteImageMacros_h */
| Remove my name from xcode's auto gen header template | Remove my name from xcode's auto gen header template
| C | apache-2.0 | pinterest/PINRemoteImage,pinterest/PINRemoteImage,pinterest/PINRemoteImage,pinterest/PINRemoteImage |
6a4888c54b31429442078f2bd804f0714b9e629d | button.h | button.h | /* Manages interaction with the buttons */
#ifndef BUTTON_H
#define BUTTON_H
const unsigned char BUTTON_NONE = 100;
bool button_isPressed(int buttonNumber);
void button_wait(int buttonNumber);
void button_ISR();
#endif
| /* Manages interaction with the buttons */
#ifndef BUTTON_H
#define BUTTON_H
#include <Arduino.h>
const unsigned char BUTTON_NONE = 100;
bool button_isPressed(uint8_t buttonNumber);
void button_wait(uint8_t buttonNumber);
void button_ISR();
#endif
| Fix header to be the same as cpp | Fix header to be the same as cpp
| C | mit | SUPERETDUPER/bolt-arduino |
52142e756e9bf6485d3d53596e8aff2e816a7253 | include/asm-powerpc/page_32.h | include/asm-powerpc/page_32.h | #ifndef _ASM_POWERPC_PAGE_32_H
#define _ASM_POWERPC_PAGE_32_H
#ifdef __KERNEL__
#define VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS32
#define PPC_MEMSTART 0
#ifndef __ASSEMBLY__
/*
* The basic type of a PTE - 64 bits for those CPUs with > 32 bit
* physical addressing. For now this just the IBM PPC440.
*/
#ifdef CONFIG_PTE_64BIT
typedef unsigned long long pte_basic_t;
#define PTE_SHIFT (PAGE_SHIFT - 3) /* 512 ptes per page */
#else
typedef unsigned long pte_basic_t;
#define PTE_SHIFT (PAGE_SHIFT - 2) /* 1024 ptes per page */
#endif
struct page;
extern void clear_pages(void *page, int order);
static inline void clear_page(void *page) { clear_pages(page, 0); }
extern void copy_page(void *to, void *from);
#include <asm-generic/page.h>
#endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_PAGE_32_H */
| #ifndef _ASM_POWERPC_PAGE_32_H
#define _ASM_POWERPC_PAGE_32_H
#ifdef __KERNEL__
#define VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS32
#define PPC_MEMSTART 0
#ifdef CONFIG_NOT_COHERENT_CACHE
#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
#endif
#ifndef __ASSEMBLY__
/*
* The basic type of a PTE - 64 bits for those CPUs with > 32 bit
* physical addressing. For now this just the IBM PPC440.
*/
#ifdef CONFIG_PTE_64BIT
typedef unsigned long long pte_basic_t;
#define PTE_SHIFT (PAGE_SHIFT - 3) /* 512 ptes per page */
#else
typedef unsigned long pte_basic_t;
#define PTE_SHIFT (PAGE_SHIFT - 2) /* 1024 ptes per page */
#endif
struct page;
extern void clear_pages(void *page, int order);
static inline void clear_page(void *page) { clear_pages(page, 0); }
extern void copy_page(void *to, void *from);
#include <asm-generic/page.h>
#endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_PAGE_32_H */
| Fix kmalloc alignment on non-coherent DMA platforms | [POWERPC] Fix kmalloc alignment on non-coherent DMA platforms
On platforms doing non-coherent DMA (4xx, 8xx, ...), it's important
that the kmalloc minimum alignment is set to the cache line size, to
avoid sharing cache lines between different objects, so that DMA to
one of the objects doesn't corrupt the other.
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Paul Mackerras <[email protected]>
| C | apache-2.0 | TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas |
44f9fbcddec64b7c43f7882ab58c8f23007a44d0 | include/base/errors.h | include/base/errors.h | /* --------------------------------------------------------------------------
* Name: errors.h
* Purpose: Error type and constants
* ----------------------------------------------------------------------- */
#ifndef ERRORS_H
#define ERRORS_H
typedef unsigned long int error;
#define error_OK 0
#define error_EXISTS 1
#define error_NOT_FOUND 2
#define error_OOM 3
#define error_STOP_WALK 4
#define error_CLASHES 5 /* key would clash with existing one */
#define error_NOT_IMPLEMENTED 6
#define error_KEYLEN_REQUIRED 200
#define error_KEYCOMPARE_REQUIRED 201
#define error_KEYHASH_REQIURED 202
#define error_QUEUE_FULL 300
#define error_QUEUE_EMPTY 301
#define error_TEST_FAILED 400
#define error_HASH_END 500
#define error_HASH_BAD_CONT 501
#endif /* ERRORS_H */
| /* --------------------------------------------------------------------------
* Name: errors.h
* Purpose: Error type and constants
* ----------------------------------------------------------------------- */
#ifndef ERRORS_H
#define ERRORS_H
typedef unsigned long int error;
/* Generic errors */
#define error_OK 0ul /* No error */
#define error_OOM 1ul /* Out of memory */
#define error_NOT_IMPLEMENTED 2ul /* Function not implemented */
#define error_NOT_FOUND 3ul /* Item not found */
#define error_EXISTS 4ul /* Item already exists */
#define error_STOP_WALK 5ul /* Callback was cancelled */
/* Data structure errors */
#define error_CLASHES 100ul /* Key would clash with existing one */
#define error_QUEUE_FULL 110ul
#define error_QUEUE_EMPTY 111ul
#define error_HASH_END 120ul
#define error_HASH_BAD_CONT 121ul
/* Container errors */
#define error_KEYLEN_REQUIRED 200ul
#define error_KEYCOMPARE_REQUIRED 201ul
#define error_KEYHASH_REQIURED 202ul
/* Test errors */
#define error_TEST_FAILED 300ul
#endif /* ERRORS_H */
| Make error constants unsigned longs. | Make error constants unsigned longs.
| C | bsd-2-clause | dpt/Containers,dpt/Containers |
96018d05e6801cf935ef630288d45dc2238b5db8 | src/util.c | src/util.c | #include "util.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "laco.h"
static inline void ignore_extra(const char chr, char** string_ptr) {
if(*string_ptr == NULL) return;
while(**string_ptr == chr) {
*string_ptr += 1;
}
}
/* External API */
void laco_kill(LacoState* laco, int status, const char* message) {
laco_destroy_laco_state(laco);
if(message != NULL) {
fprintf(stderr, "%s\n", message);
}
exit(status);
}
bool laco_is_match(const char** matches, const char* test_string) {
int i;
char* match;
for(i = 0; (match = (char*) matches[i]); i++) {
if(strcmp(test_string, match) == 0) {
return true;
}
}
return false;
}
char** laco_split_by(const char split_with, char* string,
int ignore_repeats) {
if(string == NULL) return NULL;
char** result = calloc(16, sizeof(char*));
size_t i = 0;
while(1) {
result[i] = strsep(&string, &split_with);
if(result[i] == NULL) break;
if(ignore_repeats) ignore_extra(split_with, &string);
i += 1;
}
return result;
}
| #include "util.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "laco.h"
static inline void ignore_extra(const char chr, char** string_ptr) {
if(*string_ptr == NULL) return;
while(**string_ptr == chr) {
*string_ptr += 1;
}
}
/* External API */
void laco_kill(LacoState* laco, int status, const char* message) {
laco_destroy_laco_state(laco);
if(message != NULL) {
fprintf(stderr, "%s\n", message);
}
exit(status);
}
bool laco_is_match(const char** matches, const char* test_string) {
int i;
const char* match;
for(i = 0; (match = matches[i]); i++) {
if(strcmp(test_string, match) == 0) {
return true;
}
}
return false;
}
char** laco_split_by(const char split_with, char* string,
int ignore_repeats) {
if(string == NULL) return NULL;
char** result = calloc(16, sizeof(char*));
size_t i = 0;
while(1) {
result[i] = strsep(&string, &split_with);
if(result[i] == NULL) break;
if(ignore_repeats) ignore_extra(split_with, &string);
i += 1;
}
return result;
}
| Change type from `char*` to `const char*` | Change type from `char*` to `const char*`
This is to gets rid of the explicit type conversation every iteration of the
loop.
| C | bsd-2-clause | sourrust/laco |
5861b4b4ba13a3feedb9544e94d9d0bc4296662c | test/Driver/ios-simulator-arcruntime.c | test/Driver/ios-simulator-arcruntime.c | // RUN: %clang -### -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=40201 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s
// RUN: %clang -### -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s
// CHECK-OPTIONS1: -fobjc-no-arc-runtime
// CHECK-OPTIONS2-NOT: -fobjc-no-arc-runtime
| // RUN: %clang -### -ccc-host-triple i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=40201 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s
// RUN: %clang -### -ccc-host-triple i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s
//
// CHECK-OPTIONS1: -fobjc-no-arc-runtime
// CHECK-OPTIONS2-NOT: -fobjc-no-arc-runtime
| Make this test pretend to be on a darwin host. | Make this test pretend to be on a darwin host.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@133125 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang |
1561aa5eb97ab56b2aeb23f57d58f4818201ffc9 | include/plasp/pddl/translation/Predicate.h | include/plasp/pddl/translation/Predicate.h | #ifndef __PLASP__PDDL__TRANSLATION__PREDICATE_H
#define __PLASP__PDDL__TRANSLATION__PREDICATE_H
#include <plasp/output/Formatting.h>
#include <plasp/pddl/expressions/DerivedPredicate.h>
#include <plasp/pddl/expressions/Predicate.h>
#include <plasp/pddl/expressions/PredicateDeclaration.h>
#include <plasp/pddl/translation/Variables.h>
namespace plasp
{
namespace pddl
{
namespace translation
{
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Predicate
//
////////////////////////////////////////////////////////////////////////////////////////////////////
void printPredicateName(output::ColorStream &outputStream, const expressions::PredicateDeclaration &predicateDeclaration);
void printDerivedPredicateName(output::ColorStream &outputStream, const expressions::DerivedPredicate &derivedPredicate);
////////////////////////////////////////////////////////////////////////////////////////////////////
inline void printPredicateName(output::ColorStream &outputStream, const expressions::PredicateDeclaration &predicateDeclaration)
{
outputStream << output::Keyword("variable") << "(";
if (predicateDeclaration.parameters().empty())
{
outputStream << output::String(predicateDeclaration.name().c_str()) << ")";
return;
}
outputStream << "(" << output::String(predicateDeclaration.name().c_str());
translation::translateVariablesForRuleHead(outputStream, predicateDeclaration.parameters());
outputStream << "))";
}
////////////////////////////////////////////////////////////////////////////////////////////////////
inline void printDerivedPredicateName(output::ColorStream &outputStream, const expressions::DerivedPredicate &derivedPredicate)
{
outputStream << output::Keyword("derivedVariable") << "(";
const auto id = derivedPredicate.id();
if (derivedPredicate.parameters().empty())
{
outputStream << output::Number<decltype(id)>(id) << ")";
return;
}
outputStream << "(" << output::Number<decltype(id)>(id);
translation::translateVariablesForRuleHead(outputStream, derivedPredicate.parameters());
outputStream << "))";
}
////////////////////////////////////////////////////////////////////////////////////////////////////
}
}
}
#endif
| Put functions related to translation of predicates in separate file. | Put functions related to translation of predicates in separate file.
| C | mit | potassco/plasp |
|
4b399f1a943e556f1fcd6a248991be922ad9741c | src/rtpp_command_query.h | src/rtpp_command_query.h | /*
* Copyright (c) 2014 Sippy Software, Inc., http://www.sippysoft.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#define RTPP_QUERY_NSTATS 5
struct rtpp_session_obj;
int handle_query(struct cfg *, struct rtpp_command *, struct rtpp_session_obj *, int);
| /*
* Copyright (c) 2014 Sippy Software, Inc., http://www.sippysoft.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#define RTPP_QUERY_NSTATS 5
struct rtpp_pipe;
int handle_query(struct cfg *, struct rtpp_command *, struct rtpp_pipe *, int);
| Change from working on "session" to working on "pipes". | Change from working on "session" to working on "pipes".
| C | bsd-2-clause | synety-jdebp/rtpproxy,synety-jdebp/rtpproxy,sippy/rtpproxy,jevonearth/rtpproxy,dsanders11/rtpproxy,synety-jdebp/rtpproxy,jevonearth/rtpproxy,sippy/rtpproxy,jevonearth/rtpproxy,dsanders11/rtpproxy,dsanders11/rtpproxy,jevonearth/rtpproxy,synety-jdebp/rtpproxy,sippy/rtpproxy |
dae8629cff132d3abd5ae83852380b568fbf654a | src/utils/CommonParams.h | src/utils/CommonParams.h |
# ifndef COMMONPARAMS_H
# define COMMONPARAMS_H
struct CommonParams{
int nx,ny,nz;
int NX,NY,NZ;
int rank;
int np;
int xOff;
int iskip;
int jskip;
int kskip;
int nstep;
int numOutputs;
double dx,dy,dz;
double LX,LY,LZ;
double dt;
};
# endif // COMMONPARAMS_H
|
# ifndef COMMONPARAMS_H
# define COMMONPARAMS_H
struct CommonParams{
int nx,ny,nz;
int NX,NY,NZ;
int rank;
int np;
int nbrL;
int nbrR;
int xOff;
int iskip;
int jskip;
int kskip;
int nstep;
int numOutputs;
double dx,dy,dz;
double LX,LY,LZ;
double dt;
};
# endif // COMMONPARAMS_H
| Add SfieldFD class and TIPS3 and TIPS4 classes to phase_field app | Add SfieldFD class and TIPS3 and TIPS4 classes to phase_field app
| C | mit | paulmillett/meso |
9201aebbe24b8513b2af370d26bdfc2925daa037 | Include/KAI/Config/Compiler.h | Include/KAI/Config/Compiler.h |
#ifndef KAI_CONFIG_COMPILER_H
# define KAI_CONFIG_COMPILER_H
#
# if defined(BOOST_MSVC)
# define KAI_COMPILER_MSVC
# endif
#
# undef KAI_HAVE_PRAGMA_ONCE
#
# ifdef KAI_COMPILER_MSVC
# ifndef KAI_HAVE_PRAGMA_ONCE
# define KAI_HAVE_PRAGMA_ONCE
# endif
# endif // KAI_COMPILER_MSVC
#endif // KAI_CONFIG_COMPILER_H
//EOF
|
#ifndef KAI_CONFIG_COMPILER_H
# define KAI_CONFIG_COMPILER_H
#
# if defined(BOOST_MSVC)
# define KAI_COMPILER_MSVC
# endif
#
# undef KAI_HAVE_PRAGMA_ONCE
#pragma warning (disable: 4458 4456)
#
# ifdef KAI_COMPILER_MSVC
# ifndef KAI_HAVE_PRAGMA_ONCE
# define KAI_HAVE_PRAGMA_ONCE
# endif
# endif // KAI_COMPILER_MSVC
#endif // KAI_CONFIG_COMPILER_H
//EOF
| Apply fixes required to work with VS 2015 Community. | Apply fixes required to work with VS 2015 Community.
Former-commit-id: 11fb6880db2d2d53bb8bf126a58e2eba7d0806d3
Former-commit-id: 6923894e1f89726caee9cecd8e43d078c17ce070 | C | mit | cschladetsch/KAI,cschladetsch/KAI,cschladetsch/KAI |
fc89323210a5f3f53808f7d801705d6b8c0a4224 | test/Analysis/unix-fns.c | test/Analysis/unix-fns.c | // RUN: %clang_cc1 -analyze -analyzer-check-objc-mem %s -analyzer-store=region
// RUN: %clang_cc1 -analyze -analyzer-check-objc-mem %s -analyzer-store=basic
#include <fcntl.h>
void test_open(const char *path) {
int fd;
fd = open(path, O_RDONLY); // no-warning
if (!fd)
close(fd);
fd = open(path, O_CREAT); // expected-warning{{Call to 'open' requires a third argument when the 'O_CREAT' flag is set}}
if (!fd)
close(fd);
}
| // RUN: %clang_cc1 -analyze -analyzer-check-objc-mem %s -analyzer-store=region
// RUN: %clang_cc1 -analyze -analyzer-check-objc-mem %s -analyzer-store=basic
#ifndef O_CREAT
#define O_CREAT 0x0200
#define O_RDONLY 0x0000
#endif
int open(const char *, int, ...);
void test_open(const char *path) {
int fd;
fd = open(path, O_RDONLY); // no-warning
if (!fd)
close(fd);
fd = open(path, O_CREAT); // expected-warning{{Call to 'open' requires a third argument when the 'O_CREAT' flag is set}}
if (!fd)
close(fd);
}
| Remove test case dependancy on platform headers. | Remove test case dependancy on platform headers.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@97088 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.