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
|
---|---|---|---|---|---|---|---|---|---|
21a1e7a69685d0698eac0cfee6435035e02363d9 | base/checks.h | base/checks.h | /*
* Copyright 2006 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
// This module contains some basic debugging facilities.
// Originally comes from shared/commandlineflags/checks.h
#ifndef WEBRTC_BASE_CHECKS_H_
#define WEBRTC_BASE_CHECKS_H_
namespace rtc {
// Prints an error message to stderr and aborts execution.
void Fatal(const char* file, int line, const char* format, ...);
} // namespace rtc
// The UNREACHABLE macro is very useful during development.
#define UNREACHABLE() \
rtc::Fatal(__FILE__, __LINE__, "unreachable code")
#endif // WEBRTC_BASE_CHECKS_H_
| /*
* Copyright 2006 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
// This module contains some basic debugging facilities.
// Originally comes from shared/commandlineflags/checks.h
#ifndef WEBRTC_BASE_CHECKS_H_
#define WEBRTC_BASE_CHECKS_H_
namespace rtc {
// Prints an error message to stderr and aborts execution.
void Fatal(const char* file, int line, const char* format, ...);
} // namespace rtc
// Trigger a fatal error (which aborts the process and prints an error
// message). FATAL_ERROR_IF may seem a lot like assert, but there's a crucial
// difference: it's always "on". This means that it can be used to check for
// regular errors that could actually happen, not just programming errors that
// supposedly can't happen---but triggering a fatal error will kill the process
// in an ugly way, so it's not suitable for catching errors that might happen
// in production.
#define FATAL_ERROR(msg) do { rtc::Fatal(__FILE__, __LINE__, msg); } while (0)
#define FATAL_ERROR_IF(x) do { if (x) FATAL_ERROR("check failed"); } while (0)
// The UNREACHABLE macro is very useful during development.
#define UNREACHABLE() FATAL_ERROR("unreachable code")
#endif // WEBRTC_BASE_CHECKS_H_
| Define convenient FATAL_ERROR() and FATAL_ERROR_IF() macros | Define convenient FATAL_ERROR() and FATAL_ERROR_IF() macros
[email protected]
Review URL: https://webrtc-codereview.appspot.com/16079004
git-svn-id: 03ae4fbe531b1eefc9d815f31e49022782c42458@6701 4adac7df-926f-26a2-2b94-8c16560cd09d
| C | bsd-3-clause | Omegaphora/external_chromium_org_third_party_webrtc,jgcaaprom/android_external_chromium_org_third_party_webrtc,android-ia/platform_external_chromium_org_third_party_webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,MIPS/external-chromium_org-third_party-webrtc,Omegaphora/external_chromium_org_third_party_webrtc,Omegaphora/external_chromium_org_third_party_webrtc,MIPS/external-chromium_org-third_party-webrtc,Omegaphora/external_chromium_org_third_party_webrtc,MIPS/external-chromium_org-third_party-webrtc,Omegaphora/external_chromium_org_third_party_webrtc,jgcaaprom/android_external_chromium_org_third_party_webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,Omegaphora/external_chromium_org_third_party_webrtc,MIPS/external-chromium_org-third_party-webrtc,android-ia/platform_external_chromium_org_third_party_webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,android-ia/platform_external_chromium_org_third_party_webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,android-ia/platform_external_chromium_org_third_party_webrtc,Omegaphora/external_chromium_org_third_party_webrtc,jgcaaprom/android_external_chromium_org_third_party_webrtc,jgcaaprom/android_external_chromium_org_third_party_webrtc,jgcaaprom/android_external_chromium_org_third_party_webrtc,MIPS/external-chromium_org-third_party-webrtc,android-ia/platform_external_chromium_org_third_party_webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,android-ia/platform_external_chromium_org_third_party_webrtc,jgcaaprom/android_external_chromium_org_third_party_webrtc,jgcaaprom/android_external_chromium_org_third_party_webrtc,MIPS/external-chromium_org-third_party-webrtc,Omegaphora/external_chromium_org_third_party_webrtc,android-ia/platform_external_chromium_org_third_party_webrtc,MIPS/external-chromium_org-third_party-webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,jgcaaprom/android_external_chromium_org_third_party_webrtc,android-ia/platform_external_chromium_org_third_party_webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,MIPS/external-chromium_org-third_party-webrtc |
9bae8c664000ff38f07429fa1726ec61575f2c84 | tests/regression/13-privatized/17-priv_interval.c | tests/regression/13-privatized/17-priv_interval.c | // PARAM: --set ana.int.interval true --set solver "'new'"
#include<pthread.h>
#include<assert.h>
int glob1 = 5;
pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
int t;
pthread_mutex_lock(&mutex1);
t = glob1;
assert(t == 5);
glob1 = -10;
assert(glob1 == -10);
glob1 = t;
pthread_mutex_unlock(&mutex1);
return NULL;
}
int main(void) {
pthread_t id;
assert(glob1 == 5);
pthread_create(&id, NULL, t_fun, NULL);
pthread_mutex_lock(&mutex1);
glob1++;
assert(glob1 == 6);
glob1--;
pthread_mutex_unlock(&mutex1);
pthread_join (id, NULL);
return 0;
}
| // PARAM: --set ana.int.interval true --set solver "'td3'"
#include<pthread.h>
#include<assert.h>
int glob1 = 5;
pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
int t;
pthread_mutex_lock(&mutex1);
t = glob1;
assert(t == 5);
glob1 = -10;
assert(glob1 == -10);
glob1 = t;
pthread_mutex_unlock(&mutex1);
return NULL;
}
int main(void) {
pthread_t id;
assert(glob1 == 5);
pthread_create(&id, NULL, t_fun, NULL);
pthread_mutex_lock(&mutex1);
glob1++;
assert(glob1 == 6);
glob1--;
pthread_mutex_unlock(&mutex1);
pthread_join (id, NULL);
return 0;
}
| Switch solver for 13-privatized/17-priv_internal.c to td3 to make test case pass | Switch solver for 13-privatized/17-priv_internal.c to td3 to make test case pass
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
50c714cde2c67b4c326cbec21d9383620ffbd32d | tensorflow/core/platform/default/integral_types.h | tensorflow/core/platform/default/integral_types.h | /* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_PLATFORM_DEFAULT_INTEGRAL_TYPES_H_
#define TENSORFLOW_CORE_PLATFORM_DEFAULT_INTEGRAL_TYPES_H_
// IWYU pragma: private, include "third_party/tensorflow/core/platform/types.h"
// IWYU pragma: friend third_party/tensorflow/core/platform/types.h
namespace tensorflow {
typedef signed char int8;
typedef short int16;
typedef int int32;
typedef long long int64;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned long long uint64;
} // namespace tensorflow
#endif // TENSORFLOW_CORE_PLATFORM_DEFAULT_INTEGRAL_TYPES_H_
| /* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_PLATFORM_DEFAULT_INTEGRAL_TYPES_H_
#define TENSORFLOW_CORE_PLATFORM_DEFAULT_INTEGRAL_TYPES_H_
#include <cstdint>
// IWYU pragma: private, include "third_party/tensorflow/core/platform/types.h"
// IWYU pragma: friend third_party/tensorflow/core/platform/types.h
namespace tensorflow {
typedef signed char int8;
typedef short int16;
typedef int int32;
typedef std::int64_t int64;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef std::uint64_t uint64;
} // namespace tensorflow
#endif // TENSORFLOW_CORE_PLATFORM_DEFAULT_INTEGRAL_TYPES_H_
| Change definition of tensorflow::int64 to std::int64_t. | Change definition of tensorflow::int64 to std::int64_t.
There is no reason for TensorFlow to have its own special non-standard `int64` type any more; we can use the standard one instead.
PiperOrigin-RevId: 351674712
Change-Id: I82c1d67c07436a3f158a029a3a657fef5a05060e
| C | apache-2.0 | karllessard/tensorflow,tensorflow/tensorflow,gautam1858/tensorflow,petewarden/tensorflow,sarvex/tensorflow,yongtang/tensorflow,yongtang/tensorflow,Intel-tensorflow/tensorflow,sarvex/tensorflow,frreiss/tensorflow-fred,karllessard/tensorflow,yongtang/tensorflow,Intel-Corporation/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,frreiss/tensorflow-fred,annarev/tensorflow,tensorflow/tensorflow-pywrap_saved_model,annarev/tensorflow,Intel-tensorflow/tensorflow,paolodedios/tensorflow,paolodedios/tensorflow,annarev/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,frreiss/tensorflow-fred,annarev/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_tf_optimizer,karllessard/tensorflow,petewarden/tensorflow,frreiss/tensorflow-fred,frreiss/tensorflow-fred,tensorflow/tensorflow,annarev/tensorflow,karllessard/tensorflow,Intel-Corporation/tensorflow,annarev/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,frreiss/tensorflow-fred,yongtang/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,petewarden/tensorflow,paolodedios/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-Corporation/tensorflow,Intel-tensorflow/tensorflow,paolodedios/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-Corporation/tensorflow,yongtang/tensorflow,tensorflow/tensorflow,annarev/tensorflow,petewarden/tensorflow,annarev/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,petewarden/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,sarvex/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-Corporation/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,petewarden/tensorflow,annarev/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,sarvex/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,Intel-tensorflow/tensorflow,karllessard/tensorflow,gautam1858/tensorflow,sarvex/tensorflow,sarvex/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,annarev/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,petewarden/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_saved_model,frreiss/tensorflow-fred,tensorflow/tensorflow,sarvex/tensorflow,frreiss/tensorflow-fred,gautam1858/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_saved_model,petewarden/tensorflow,paolodedios/tensorflow,Intel-tensorflow/tensorflow,sarvex/tensorflow,karllessard/tensorflow,Intel-Corporation/tensorflow,annarev/tensorflow,karllessard/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,gautam1858/tensorflow,gautam1858/tensorflow,Intel-tensorflow/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,petewarden/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,petewarden/tensorflow,tensorflow/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,petewarden/tensorflow,frreiss/tensorflow-fred,gautam1858/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,yongtang/tensorflow,petewarden/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,paolodedios/tensorflow |
97369c4ccf54315091fbcfb5909e97768d54cfd0 | mudlib/mud/home/Verb/sys/verb/ulario/wiz/ooc/blist.c | mudlib/mud/home/Verb/sys/verb/ulario/wiz/ooc/blist.c | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2012, 2013, 2014 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 <kotaka/paths/algorithm.h>
#include <kotaka/paths/bigstruct.h>
#include <kotaka/paths/system.h>
#include <kotaka/paths/string.h>
#include <kotaka/paths/verb.h>
#include <kernel/access.h>
#include <status.h>
inherit LIB_VERB;
string *query_parse_methods()
{
return ({ "raw" });
}
int compare(string a, string b)
{
int na, nb;
sscanf(a, "%s#%d", a, na);
sscanf(b, "%s#%d", b, nb);
if (na > nb) {
return 1;
}
if (na < nb) {
return -1;
}
return 0;
}
void printlist(string path)
{
mixed st;
object cinfo;
object obj;
st = status(path);
if (!st) {
send_out("No such object.\n");
return;
}
cinfo = CLONED->query_clone_info(st[O_INDEX]);
if (!cinfo) {
send_out("No clone info for object.\n");
return;
}
obj = cinfo->query_first_clone();
do {
send_out(STRINGD->mixed_sprint(obj) + ", with access grants " + STRINGD->mixed_sprint(obj->query_grants()) + "\n");
obj = obj->query_next_clone();
} while (obj != cinfo->query_first_clone());
}
void main(object actor, mapping roles)
{
if (query_user()->query_class() < 2) {
send_out("You do not have sufficient access rights to do a clone check.\n");
return;
}
printlist("~Bigstruct/obj/array/root");
printlist("~Bigstruct/obj/deque/root");
printlist("~Bigstruct/obj/map/root");
}
| Add a command to check bigstruct owners, used to check for leaks | Add a command to check bigstruct owners, used to check for leaks
| C | agpl-3.0 | shentino/kotaka,shentino/kotaka,shentino/kotaka |
|
505b66949e488060daf82413a399b328d05b4ebc | tests/regression/46-apron2/24-pipeline-no-threadflag.c | tests/regression/46-apron2/24-pipeline-no-threadflag.c | // SKIP PARAM: --set ana.activated[+] apron --set ana.activated[-] threadflag
// Minimized from sv-benchmarks/c/systemc/pipeline.cil-1.c
#include <assert.h>
int main_clk_pos_edge;
int main_in1_req_up;
int main()
{
// main_clk_pos_edge = 2; // TODO: uncomment to unskip apron test
if (main_in1_req_up == 1) // TODO: both branches are dead
assert(0); // TODO: uncomment to unskip apron test, FAIL (unreachable)
else
assert(1); // reachable
return (0);
}
| Add minimized testcase from both apron branches dead without threadflag | Add minimized testcase from both apron branches dead without threadflag
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
bc97f851842b313acf04e099fc95f94676a05894 | TRVSDictionaryWithCaseInsensitivity/TRVSDictionaryWithCaseInsensitivity.h | TRVSDictionaryWithCaseInsensitivity/TRVSDictionaryWithCaseInsensitivity.h | //
// TRVSDictionaryWithCaseInsensitivity.h
// TRVSDictionaryWithCaseInsensitivity
//
// Created by Travis Jeffery on 7/24/14.
// Copyright (c) 2014 Travis Jeffery. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for TRVSDictionaryWithCaseInsensitivity.
FOUNDATION_EXPORT double TRVSDictionaryWithCaseInsensitivityVersionNumber;
//! Project version string for TRVSDictionaryWithCaseInsensitivity.
FOUNDATION_EXPORT const unsigned char TRVSDictionaryWithCaseInsensitivityVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <TRVSDictionaryWithCaseInsensitivity/PublicHeader.h>
@interface TRVSDictionaryWithCaseInsensitivity : NSDictionary
@end
| //
// TRVSDictionaryWithCaseInsensitivity.h
// TRVSDictionaryWithCaseInsensitivity
//
// Created by Travis Jeffery on 7/24/14.
// Copyright (c) 2014 Travis Jeffery. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for TRVSDictionaryWithCaseInsensitivity.
FOUNDATION_EXPORT double TRVSDictionaryWithCaseInsensitivityVersionNumber;
//! Project version string for TRVSDictionaryWithCaseInsensitivity.
FOUNDATION_EXPORT const unsigned char TRVSDictionaryWithCaseInsensitivityVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <TRVSDictionaryWithCaseInsensitivity/PublicHeader.h>
@interface TRVSDictionaryWithCaseInsensitivity : NSDictionary
@end
| Fix import of foundation - no need for uikit | Fix import of foundation - no need for uikit
| C | mit | travisjeffery/TRVSDictionaryWithCaseInsensitivity |
7f2565af8a98c0dc8f3c0bcd3f92098e669208f1 | SmartDeviceLink/SDLImageField+ScreenManagerExtensions.h | SmartDeviceLink/SDLImageField+ScreenManagerExtensions.h | //
// SDLImageField+ScreenManagerExtensions.h
// SmartDeviceLink
//
// Created by Joel Fischer on 5/20/20.
// Copyright © 2020 smartdevicelink. All rights reserved.
//
#import <SmartDeviceLink/SmartDeviceLink.h>
NS_ASSUME_NONNULL_BEGIN
@interface SDLImageField (ScreenManagerExtensions)
+ (NSArray<SDLImageField *> *)allImageFields;
@end
NS_ASSUME_NONNULL_END
| //
// SDLImageField+ScreenManagerExtensions.h
// SmartDeviceLink
//
// Created by Joel Fischer on 5/20/20.
// Copyright © 2020 smartdevicelink. All rights reserved.
//
#import "SDLImageField.h"
NS_ASSUME_NONNULL_BEGIN
@interface SDLImageField (ScreenManagerExtensions)
+ (NSArray<SDLImageField *> *)allImageFields;
@end
NS_ASSUME_NONNULL_END
| Fix failed import in podspec | Fix failed import in podspec
| C | bsd-3-clause | smartdevicelink/sdl_ios,smartdevicelink/sdl_ios,smartdevicelink/sdl_ios,smartdevicelink/sdl_ios,smartdevicelink/sdl_ios |
6a70d7a87c3b684caf67cbccb56753db807fb005 | ext/cap2/cap2.c | ext/cap2/cap2.c | #include <ruby.h>
#include <errno.h>
#include <sys/capability.h>
static VALUE cap2_getpcaps(VALUE self, VALUE pid) {
cap_t cap_d;
ssize_t length;
char *caps;
VALUE result;
Check_Type(pid, T_FIXNUM);
cap_d = cap_get_pid(NUM2INT(pid));
if (cap_d == NULL) {
rb_raise(
rb_eRuntimeError,
"Failed to get cap's for proccess %d: (%s)\n",
NUM2INT(pid), strerror(errno)
);
} else {
caps = cap_to_text(cap_d, &length);
result = rb_str_new(caps, length);
cap_free(caps);
cap_free(cap_d);
}
return result;
}
void Init_cap2(void) {
VALUE rb_mCap2;
rb_mCap2 = rb_define_module("Cap2");
rb_define_module_function(rb_mCap2, "getpcaps", cap2_getpcaps, 1);
}
| #include <ruby.h>
#include <errno.h>
#include <sys/capability.h>
static VALUE cap2_getpcaps(VALUE self, VALUE pid) {
cap_t cap_d;
ssize_t length;
char *caps;
VALUE result;
Check_Type(pid, T_FIXNUM);
cap_d = cap_get_pid(FIX2INT(pid));
if (cap_d == NULL) {
rb_raise(
rb_eRuntimeError,
"Failed to get cap's for proccess %d: (%s)\n",
FIX2INT(pid), strerror(errno)
);
} else {
caps = cap_to_text(cap_d, &length);
result = rb_str_new(caps, length);
cap_free(caps);
cap_free(cap_d);
}
return result;
}
void Init_cap2(void) {
VALUE rb_mCap2;
rb_mCap2 = rb_define_module("Cap2");
rb_define_module_function(rb_mCap2, "getpcaps", cap2_getpcaps, 1);
}
| Use FIX2INT rather than NUM2INT in Cap2.getpcaps | Use FIX2INT rather than NUM2INT in Cap2.getpcaps
| C | mit | lmars/cap2,lmars/cap2 |
87a45b118a9b0c723fb0102842b47bf754e57ebf | include/scratch/bits/utility/nth-t.h | include/scratch/bits/utility/nth-t.h | #pragma once
#include <cstddef>
namespace scratch {
template<size_t Index, typename T, typename... Rest> struct nth : nth<Index-1, Rest...> {};
template<typename T, typename... Rest> struct nth<0, T, Rest...> { using type = T; };
template<size_t Index, typename... Ts> using nth_t = typename nth<Index, Ts...>::type;
} // namespace scratch
| Add a template type alias `scratch::nth_t<I, Ts...>` for the nth element of a pack. | Add a template type alias `scratch::nth_t<I, Ts...>` for the nth element of a pack.
The equivalent for (perfectly forwarded) values is basically
std::get<I>(std::forward_as_tuple(std::forward<Vs>(vs)...))
but since I haven't implemented `std::tuple` yet, I'm passing on that one.
| C | mit | Quuxplusone/from-scratch,Quuxplusone/from-scratch,Quuxplusone/from-scratch |
|
6e2bee2717a640046dd323972d9c7238d8184797 | include/ccspec/core/example_group.h | include/ccspec/core/example_group.h | #ifndef CCSPEC_CORE_EXAMPLE_GROUP_H_
#define CCSPEC_CORE_EXAMPLE_GROUP_H_
#include <functional>
#include <list>
#include <stack>
#include <string>
namespace ccspec {
namespace core {
class ExampleGroup;
typedef ExampleGroup* Creator(std::string desc, std::function<void ()> spec);
class ExampleGroup {
public:
virtual ~ExampleGroup();
void addChild(ExampleGroup*);
protected:
ExampleGroup(std::string desc);
private:
std::string desc_;
std::list<ExampleGroup*> children_;
friend Creator describe;
friend Creator context;
};
extern std::stack<ExampleGroup*> groups_being_defined;
Creator describe;
Creator context;
} // namespace core
} // namespace ccspec
#endif // CCSPEC_CORE_EXAMPLE_GROUP_H_
| #ifndef CCSPEC_CORE_EXAMPLE_GROUP_H_
#define CCSPEC_CORE_EXAMPLE_GROUP_H_
#include <functional>
#include <list>
#include <stack>
#include <string>
namespace ccspec {
namespace core {
class ExampleGroup;
typedef ExampleGroup* Creator(std::string desc, std::function<void ()> spec);
extern std::stack<ExampleGroup*> groups_being_defined;
class ExampleGroup {
public:
virtual ~ExampleGroup();
void addChild(ExampleGroup*);
protected:
ExampleGroup(std::string desc);
private:
std::string desc_;
std::list<ExampleGroup*> children_;
friend Creator describe;
friend Creator context;
};
Creator describe;
Creator context;
} // namespace core
} // namespace ccspec
#endif // CCSPEC_CORE_EXAMPLE_GROUP_H_
| Move global variable declaration for consistency | Move global variable declaration for consistency
| C | mit | zhangsu/ccspec,tempbottle/ccspec,michaelachrisco/ccspec,zhangsu/ccspec,michaelachrisco/ccspec,tempbottle/ccspec,michaelachrisco/ccspec,tempbottle/ccspec,zhangsu/ccspec |
a6c7d872c26713d43f0152ce23abf4c6eccfc609 | grantlee_core_library/filterexpression.h | grantlee_core_library/filterexpression.h | /*
Copyright (c) 2009 Stephen Kelly <[email protected]>
*/
#ifndef FILTER_H
#define FILTER_H
#include "variable.h"
#include "grantlee_export.h"
namespace Grantlee
{
class Parser;
}
class Token;
namespace Grantlee
{
class GRANTLEE_EXPORT FilterExpression
{
public:
enum Reversed
{
IsNotReversed,
IsReversed
};
FilterExpression();
FilterExpression(const QString &varString, Grantlee::Parser *parser = 0);
int error();
// QList<QPair<QString, QString> > filters();
Variable variable();
QVariant resolve(Context *c);
bool isTrue(Context *c);
QVariantList toList(Context *c);
private:
Variable m_variable;
int m_error;
};
}
#endif
| /*
Copyright (c) 2009 Stephen Kelly <[email protected]>
*/
#ifndef FILTEREXPRESSION_H
#define FILTEREXPRESSION_H
#include "variable.h"
#include "grantlee_export.h"
namespace Grantlee
{
class Parser;
}
class Token;
namespace Grantlee
{
class GRANTLEE_EXPORT FilterExpression
{
public:
enum Reversed
{
IsNotReversed,
IsReversed
};
FilterExpression();
FilterExpression(const QString &varString, Grantlee::Parser *parser = 0);
int error();
// QList<QPair<QString, QString> > filters();
Variable variable();
QVariant resolve(Context *c);
bool isTrue(Context *c);
QVariantList toList(Context *c);
private:
Variable m_variable;
int m_error;
};
}
#endif
| Use a correct include guard | Use a correct include guard
| C | lgpl-2.1 | simonwagner/grantlee,simonwagner/grantlee,cutelyst/grantlee,simonwagner/grantlee,simonwagner/grantlee,cutelyst/grantlee,cutelyst/grantlee,simonwagner/grantlee,simonwagner/grantlee,cutelyst/grantlee,cutelyst/grantlee |
baa17436b073514a3739fad3b487c0bee90afb5d | include/corsika/particle/VParticleProperties.h | include/corsika/particle/VParticleProperties.h | /**
\file
Particle property interface
\author Lukas Nellen
\version $Id$
\date 03 Apr 2004
*/
#pragma once
#include <string>
namespace corsika
{
/**
\class VParticleProperties VParticleProperties.h "corsika/VParticleProperties.h"
\brief Internal interface for particle properties. This is
intended to be implemented for elementary particles and nuclei.
\note This is an internal interface and not available for user code.
\author Lukas Nellen
\date 03 Apr 2004
\ingroup particles
*/
class VParticleProperties {
public:
virtual ~VParticleProperties() { }
/// Get particle type (using PDG particle codes)
virtual int GetType() const = 0;
/// Get particle name
virtual std::string GetName() const = 0;
/// Get particle mass (in Auger units)
virtual double GetMass() const = 0;
};
typedef std::shared_ptr<const VParticleProperties> ParticlePropertiesPtr;
}
| /**
\file
Particle property interface
\author Lukas Nellen
\version $Id$
\date 03 Apr 2004
*/
#pragma once
#include <string>
#include <memory.h>
namespace corsika
{
/**
\class VParticleProperties VParticleProperties.h "corsika/VParticleProperties.h"
\brief Internal interface for particle properties. This is
intended to be implemented for elementary particles and nuclei.
\note This is an internal interface and not available for user code.
\author Lukas Nellen
\date 03 Apr 2004
\ingroup particles
*/
class VParticleProperties {
public:
virtual ~VParticleProperties() { }
/// Get particle type (using PDG particle codes)
virtual int GetType() const = 0;
/// Get particle name
virtual std::string GetName() const = 0;
/// Get particle mass (in Auger units)
virtual double GetMass() const = 0;
};
typedef std::shared_ptr<const VParticleProperties> ParticlePropertiesPtr;
}
| Add one more memory include | Add one more memory include
| C | bsd-2-clause | javierggt/corsika_reader,javierggt/corsika_reader,javierggt/corsika_reader |
e1c47c5248d8c0d0bbb2462b73cd7ee031ef85d3 | src/engine/core/include/halley/core/entry/entry_point.h | src/engine/core/include/halley/core/entry/entry_point.h | #pragma once
#include <memory>
#include <vector>
#include "halley/core/game/main_loop.h"
#ifdef _WIN32
#define HALLEY_STDCALL __stdcall
#else
#define HALLEY_STDCALL
#endif
namespace Halley
{
class Game;
class Core;
class HalleyStatics;
constexpr static uint32_t HALLEY_DLL_API_VERSION = 23;
class IHalleyEntryPoint
{
public:
virtual ~IHalleyEntryPoint() = default;
void initSharedStatics(const HalleyStatics& parent);
virtual uint32_t getApiVersion() { return HALLEY_DLL_API_VERSION; }
virtual std::unique_ptr<Core> createCore(const std::vector<std::string>& args) = 0;
virtual std::unique_ptr<Game> createGame() = 0;
};
template <typename GameType>
class HalleyEntryPoint final : public IHalleyEntryPoint
{
public:
std::unique_ptr<Game> createGame() override
{
return std::make_unique<GameType>();
}
std::unique_ptr<Core> createCore(const std::vector<std::string>& args) override
{
Expects(args.size() >= 1);
Expects(args.size() < 1000);
return std::make_unique<Core>(std::make_unique<GameType>(), args);
}
};
}
| #pragma once
#include <memory>
#include <vector>
#include "halley/core/game/main_loop.h"
#ifdef _WIN32
#define HALLEY_STDCALL __stdcall
#else
#define HALLEY_STDCALL
#endif
namespace Halley
{
class Game;
class Core;
class HalleyStatics;
constexpr static uint32_t HALLEY_DLL_API_VERSION = 24;
class IHalleyEntryPoint
{
public:
virtual ~IHalleyEntryPoint() = default;
virtual uint32_t getApiVersion() { return HALLEY_DLL_API_VERSION; }
virtual std::unique_ptr<Core> createCore(const std::vector<std::string>& args) = 0;
virtual std::unique_ptr<Game> createGame() = 0;
void initSharedStatics(const HalleyStatics& parent);
};
template <typename GameType>
class HalleyEntryPoint final : public IHalleyEntryPoint
{
public:
std::unique_ptr<Game> createGame() override
{
return std::make_unique<GameType>();
}
std::unique_ptr<Core> createCore(const std::vector<std::string>& args) override
{
Expects(args.size() >= 1);
Expects(args.size() < 1000);
return std::make_unique<Core>(std::make_unique<GameType>(), args);
}
};
}
| Move new method on interface further down to avoid messing with vtable compatibility | Move new method on interface further down to avoid messing with vtable compatibility
| C | apache-2.0 | amzeratul/halley,amzeratul/halley,amzeratul/halley |
4771a29b5042fc9496f4d72f76c0151fe73716ba | src/placement/apollonius_labels_arranger.h | src/placement/apollonius_labels_arranger.h | #ifndef SRC_PLACEMENT_APOLLONIUS_LABELS_ARRANGER_H_
#define SRC_PLACEMENT_APOLLONIUS_LABELS_ARRANGER_H_
#include <Eigen/Core>
#include <memory>
#include <vector>
#include "./labels_arranger.h"
class CudaArrayProvider;
namespace Placement
{
/**
* \brief Returns the labels in an order defined by the apollonius graph
*
*/
class ApolloniusLabelsArranger : public LabelsArranger
{
public:
ApolloniusLabelsArranger() = default;
virtual ~ApolloniusLabelsArranger();
void
initialize(std::shared_ptr<CudaArrayProvider> distanceTransformTextureMapper,
std::shared_ptr<CudaArrayProvider> apolloniusTextureMapper);
virtual std::vector<Label>
getArrangement(const LabellerFrameData &frameData,
std::shared_ptr<LabelsContainer> labels);
private:
std::shared_ptr<CudaArrayProvider> distanceTransformTextureMapper;
std::shared_ptr<CudaArrayProvider> apolloniusTextureMapper;
std::vector<Eigen::Vector4f>
createLabelSeeds(Eigen::Vector2i size, Eigen::Matrix4f viewProjection,
std::shared_ptr<LabelsContainer> labels);
};
} // namespace Placement
#endif // SRC_PLACEMENT_APOLLONIUS_LABELS_ARRANGER_H_
| #ifndef SRC_PLACEMENT_APOLLONIUS_LABELS_ARRANGER_H_
#define SRC_PLACEMENT_APOLLONIUS_LABELS_ARRANGER_H_
#include <Eigen/Core>
#include <memory>
#include <vector>
#include "./labels_arranger.h"
class CudaArrayProvider;
namespace Placement
{
/**
* \brief Returns the labels in an order defined by the apollonius graph
*
*/
class ApolloniusLabelsArranger : public LabelsArranger
{
public:
ApolloniusLabelsArranger() = default;
void
initialize(std::shared_ptr<CudaArrayProvider> distanceTransformTextureMapper,
std::shared_ptr<CudaArrayProvider> apolloniusTextureMapper);
virtual std::vector<Label>
getArrangement(const LabellerFrameData &frameData,
std::shared_ptr<LabelsContainer> labels);
private:
std::shared_ptr<CudaArrayProvider> distanceTransformTextureMapper;
std::shared_ptr<CudaArrayProvider> apolloniusTextureMapper;
std::vector<Eigen::Vector4f>
createLabelSeeds(Eigen::Vector2i size, Eigen::Matrix4f viewProjection,
std::shared_ptr<LabelsContainer> labels);
};
} // namespace Placement
#endif // SRC_PLACEMENT_APOLLONIUS_LABELS_ARRANGER_H_
| Remove unused and not implement ApolloniusLabelsArranger destructor. | Remove unused and not implement ApolloniusLabelsArranger destructor.
| C | mit | Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller |
1912ee2e5a92ebde98aad2835b8ea5eef918cd8f | CefSharp.Core/Internals/CefRequestCallbackWrapper.h | CefSharp.Core/Internals/CefRequestCallbackWrapper.h | // Copyright 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "Stdafx.h"
using namespace CefSharp;
namespace CefSharp
{
namespace Internals
{
public ref class CefRequestCallbackWrapper : public IRequestCallback
{
private:
MCefRefPtr<CefRequestCallback> _callback;
IFrame^ _frame;
IRequest^ _request;
internal:
CefRequestCallbackWrapper(CefRefPtr<CefRequestCallback> &callback)
: _callback(callback)
{
}
CefRequestCallbackWrapper(
CefRefPtr<CefRequestCallback> &callback,
IFrame^ frame,
IRequest^ request)
: _callback(callback), _frame(frame), _request(request)
{
}
!CefRequestCallbackWrapper()
{
_callback = NULL;
}
~CefRequestCallbackWrapper()
{
this->!CefRequestCallbackWrapper();
delete _requestWrapper;
_requestWrapper = nullptr;
delete _frame;
_frame = nullptr;
}
public:
virtual void Continue(bool allow)
{
_callback->Continue(allow);
delete this;
}
virtual void Cancel()
{
_callback->Cancel();
delete this;
}
};
}
}
| // Copyright 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "Stdafx.h"
using namespace CefSharp;
namespace CefSharp
{
namespace Internals
{
public ref class CefRequestCallbackWrapper : public IRequestCallback
{
private:
MCefRefPtr<CefRequestCallback> _callback;
IFrame^ _frame;
IRequest^ _request;
internal:
CefRequestCallbackWrapper(CefRefPtr<CefRequestCallback> &callback)
: _callback(callback)
{
}
CefRequestCallbackWrapper(
CefRefPtr<CefRequestCallback> &callback,
IFrame^ frame,
IRequest^ request)
: _callback(callback), _frame(frame), _request(request)
{
}
!CefRequestCallbackWrapper()
{
_callback = NULL;
}
~CefRequestCallbackWrapper()
{
this->!CefRequestCallbackWrapper();
delete _request;
_request = nullptr;
delete _frame;
_frame = nullptr;
}
public:
virtual void Continue(bool allow)
{
_callback->Continue(allow);
delete this;
}
virtual void Cancel()
{
_callback->Cancel();
delete this;
}
};
}
}
| Fix build issue from prev. merge. | Fix build issue from prev. merge.
| C | bsd-3-clause | haozhouxu/CefSharp,VioletLife/CefSharp,joshvera/CefSharp,ITGlobal/CefSharp,windygu/CefSharp,AJDev77/CefSharp,yoder/CefSharp,haozhouxu/CefSharp,jamespearce2006/CefSharp,ruisebastiao/CefSharp,VioletLife/CefSharp,haozhouxu/CefSharp,joshvera/CefSharp,yoder/CefSharp,windygu/CefSharp,illfang/CefSharp,dga711/CefSharp,Haraguroicha/CefSharp,jamespearce2006/CefSharp,AJDev77/CefSharp,gregmartinhtc/CefSharp,rlmcneary2/CefSharp,twxstar/CefSharp,windygu/CefSharp,VioletLife/CefSharp,joshvera/CefSharp,gregmartinhtc/CefSharp,gregmartinhtc/CefSharp,illfang/CefSharp,Haraguroicha/CefSharp,wangzheng888520/CefSharp,zhangjingpu/CefSharp,twxstar/CefSharp,Haraguroicha/CefSharp,rlmcneary2/CefSharp,jamespearce2006/CefSharp,Livit/CefSharp,Haraguroicha/CefSharp,jamespearce2006/CefSharp,twxstar/CefSharp,Livit/CefSharp,AJDev77/CefSharp,ruisebastiao/CefSharp,ruisebastiao/CefSharp,yoder/CefSharp,jamespearce2006/CefSharp,wangzheng888520/CefSharp,AJDev77/CefSharp,dga711/CefSharp,battewr/CefSharp,joshvera/CefSharp,NumbersInternational/CefSharp,NumbersInternational/CefSharp,rlmcneary2/CefSharp,zhangjingpu/CefSharp,Haraguroicha/CefSharp,ITGlobal/CefSharp,illfang/CefSharp,battewr/CefSharp,dga711/CefSharp,dga711/CefSharp,ITGlobal/CefSharp,zhangjingpu/CefSharp,NumbersInternational/CefSharp,battewr/CefSharp,gregmartinhtc/CefSharp,wangzheng888520/CefSharp,Livit/CefSharp,NumbersInternational/CefSharp,wangzheng888520/CefSharp,VioletLife/CefSharp,rlmcneary2/CefSharp,twxstar/CefSharp,Livit/CefSharp,ruisebastiao/CefSharp,illfang/CefSharp,battewr/CefSharp,zhangjingpu/CefSharp,haozhouxu/CefSharp,windygu/CefSharp,yoder/CefSharp,ITGlobal/CefSharp |
6bfe949dbd60e78c6a7d9ecc438f38e69e50f757 | src/modules/linsys/factory.c | src/modules/linsys/factory.c | /*
* factory.c for Linsys SDI consumer
*/
#include <framework/mlt.h>
#include <string.h>
extern mlt_consumer consumer_SDIstream_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
MLT_REPOSITORY
{
MLT_REGISTER( consumer_type, "linsys_sdi", consumer_SDIstream_init );
}
| /*
* factory.c for Linsys SDI consumer
*/
#include <framework/mlt.h>
#include <string.h>
extern mlt_consumer consumer_SDIstream_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
MLT_REPOSITORY
{
MLT_REGISTER( consumer_type, "sdi", consumer_SDIstream_init );
}
| Change linssys_sdi consumer to just "sdi" | Change linssys_sdi consumer to just "sdi"
| C | lgpl-2.1 | gmarco/mlt-orig,zzhhui/mlt,siddharudh/mlt,anba8005/mlt,ttill/MLT-roto-tracking,wideioltd/mlt,ttill/MLT-roto,ttill/MLT-roto,wideioltd/mlt,ttill/MLT-roto-tracking,ttill/MLT-roto-tracking,ttill/MLT,ttill/MLT,xzhavilla/mlt,wideioltd/mlt,xzhavilla/mlt,anba8005/mlt,xzhavilla/mlt,gmarco/mlt-orig,mltframework/mlt,ttill/MLT-roto-tracking,anba8005/mlt,mltframework/mlt,ttill/MLT-roto-tracking,j-b-m/mlt,ttill/MLT-roto-tracking,wideioltd/mlt,ttill/MLT-roto-tracking,ttill/MLT-roto-tracking,zzhhui/mlt,gmarco/mlt-orig,gmarco/mlt-orig,mltframework/mlt,mltframework/mlt,wideioltd/mlt,ttill/MLT,zzhhui/mlt,anba8005/mlt,j-b-m/mlt,j-b-m/mlt,ttill/MLT-roto,anba8005/mlt,siddharudh/mlt,mltframework/mlt,mltframework/mlt,zzhhui/mlt,ttill/MLT,xzhavilla/mlt,zzhhui/mlt,siddharudh/mlt,ttill/MLT-roto,anba8005/mlt,mltframework/mlt,j-b-m/mlt,ttill/MLT,xzhavilla/mlt,gmarco/mlt-orig,ttill/MLT,xzhavilla/mlt,ttill/MLT-roto,ttill/MLT,zzhhui/mlt,wideioltd/mlt,siddharudh/mlt,zzhhui/mlt,siddharudh/mlt,gmarco/mlt-orig,ttill/MLT-roto,j-b-m/mlt,j-b-m/mlt,mltframework/mlt,siddharudh/mlt,wideioltd/mlt,j-b-m/mlt,ttill/MLT-roto,siddharudh/mlt,siddharudh/mlt,zzhhui/mlt,xzhavilla/mlt,wideioltd/mlt,xzhavilla/mlt,gmarco/mlt-orig,ttill/MLT,anba8005/mlt,ttill/MLT-roto,anba8005/mlt,anba8005/mlt,xzhavilla/mlt,ttill/MLT,j-b-m/mlt,mltframework/mlt,ttill/MLT-roto-tracking,zzhhui/mlt,siddharudh/mlt,ttill/MLT-roto,mltframework/mlt,gmarco/mlt-orig,gmarco/mlt-orig,j-b-m/mlt,wideioltd/mlt,j-b-m/mlt |
fcb91db238536949ceca5bcbe9c93b61b658240a | src/matchers/EXPMatchers+beIdenticalTo.h | src/matchers/EXPMatchers+beIdenticalTo.h | #import "Expecta.h"
EXPMatcherInterface(beIdenticalTo, (void *expected));
| #import "Expecta.h"
EXPMatcherInterface(_beIdenticalTo, (void *expected));
#if __has_feature(objc_arc)
#define beIdenticalTo(expected) _beIdenticalTo((__bridge void*)expected)
#else
#define beIdenticalTo _beIdenticalTo
#endif
| Fix ARC warning and avoid having to bridge id objects | Fix ARC warning and avoid having to bridge id objects
| C | mit | iguchunhui/expecta,iosdev-republicofapps/expecta,ashfurrow/expecta,ashfurrow/expecta,Lightricks/expecta,specta/expecta,jmoody/expecta,jmburges/expecta,modocache/expecta,jmoody/expecta,suxinde2009/expecta,Bogon/expecta,github/expecta,tonyarnold/expecta,Bogon/expecta,Lightricks/expecta,jmburges/expecta,suxinde2009/expecta,iosdev-republicofapps/expecta,PatrykKaczmarek/expecta,modocache/expecta,tonyarnold/expecta,iosdev-republicofapps/expecta,ashfurrow/expecta,github/expecta,tonyarnold/expecta,PatrykKaczmarek/expecta,PatrykKaczmarek/expecta,tonyarnold/expecta,jmoody/expecta,udemy/expecta,ashfurrow/expecta,jmoody/expecta,iosdev-republicofapps/expecta,udemy/expecta,jmburges/expecta,wessmith/expecta,PatrykKaczmarek/expecta,iguchunhui/expecta,jmburges/expecta,modocache/expecta,modocache/expecta,wessmith/expecta |
20cf8ae478c2712d4c211b49868e334357f05356 | src/include/storage/copydir.h | src/include/storage/copydir.h | /*-------------------------------------------------------------------------
*
* copydir.h
* Header for src/port/copydir.c compatibility functions.
*
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/copydir.h
*
*-------------------------------------------------------------------------
*/
#ifndef COPYDIR_H
#define COPYDIR_H
extern void copydir(char *fromdir, char *todir, bool recurse);
#endif /* COPYDIR_H */
| /*-------------------------------------------------------------------------
*
* copydir.h
* Copy a directory.
*
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/copydir.h
*
*-------------------------------------------------------------------------
*/
#ifndef COPYDIR_H
#define COPYDIR_H
extern void copydir(char *fromdir, char *todir, bool recurse);
#endif /* COPYDIR_H */
| Fix copy-and-pasteo a little more completely. | Fix copy-and-pasteo a little more completely.
copydir.c is no longer in src/port
| C | apache-2.0 | 50wu/gpdb,50wu/gpdb,arcivanov/postgres-xl,pavanvd/postgres-xl,Postgres-XL/Postgres-XL,pavanvd/postgres-xl,techdragon/Postgres-XL,oberstet/postgres-xl,adam8157/gpdb,lisakowen/gpdb,tpostgres-projects/tPostgres,xinzweb/gpdb,ashwinstar/gpdb,pavanvd/postgres-xl,techdragon/Postgres-XL,postmind-net/postgres-xl,tpostgres-projects/tPostgres,ovr/postgres-xl,snaga/postgres-xl,ashwinstar/gpdb,snaga/postgres-xl,tpostgres-projects/tPostgres,lisakowen/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,snaga/postgres-xl,kmjungersen/PostgresXL,postmind-net/postgres-xl,ashwinstar/gpdb,pavanvd/postgres-xl,oberstet/postgres-xl,yazun/postgres-xl,greenplum-db/gpdb,techdragon/Postgres-XL,snaga/postgres-xl,oberstet/postgres-xl,ashwinstar/gpdb,ovr/postgres-xl,xinzweb/gpdb,postmind-net/postgres-xl,lisakowen/gpdb,adam8157/gpdb,kmjungersen/PostgresXL,adam8157/gpdb,jmcatamney/gpdb,yazun/postgres-xl,jmcatamney/gpdb,jmcatamney/gpdb,Postgres-XL/Postgres-XL,postmind-net/postgres-xl,lisakowen/gpdb,Postgres-XL/Postgres-XL,kmjungersen/PostgresXL,greenplum-db/gpdb,adam8157/gpdb,yazun/postgres-xl,xinzweb/gpdb,lisakowen/gpdb,oberstet/postgres-xl,xinzweb/gpdb,greenplum-db/gpdb,50wu/gpdb,ovr/postgres-xl,greenplum-db/gpdb,greenplum-db/gpdb,pavanvd/postgres-xl,lisakowen/gpdb,oberstet/postgres-xl,zeroae/postgres-xl,kmjungersen/PostgresXL,adam8157/gpdb,arcivanov/postgres-xl,techdragon/Postgres-XL,zeroae/postgres-xl,arcivanov/postgres-xl,jmcatamney/gpdb,50wu/gpdb,50wu/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,zeroae/postgres-xl,adam8157/gpdb,snaga/postgres-xl,lisakowen/gpdb,tpostgres-projects/tPostgres,ovr/postgres-xl,greenplum-db/gpdb,Postgres-XL/Postgres-XL,zeroae/postgres-xl,arcivanov/postgres-xl,xinzweb/gpdb,arcivanov/postgres-xl,xinzweb/gpdb,techdragon/Postgres-XL,jmcatamney/gpdb,arcivanov/postgres-xl,kmjungersen/PostgresXL,ovr/postgres-xl,tpostgres-projects/tPostgres,greenplum-db/gpdb,zeroae/postgres-xl,postmind-net/postgres-xl,yazun/postgres-xl,ashwinstar/gpdb,50wu/gpdb,xinzweb/gpdb,xinzweb/gpdb,Postgres-XL/Postgres-XL,adam8157/gpdb,yazun/postgres-xl,50wu/gpdb,ashwinstar/gpdb,lisakowen/gpdb,adam8157/gpdb,50wu/gpdb,ashwinstar/gpdb |
13eecec8a8ed0db9e487a33e9ccaffbc229657eb | src/ib.c | src/ib.c | #include <stdio.h>
#include <stdlib.h>
#include <vl/ib.h>
int main()
{
vl_node nrows = 30;
vl_node ncols = 3;
vl_prob * Pic = malloc(sizeof(vl_prob)*nrows*ncols);
int r,c;
printf("Pic = [");
for(r=0; r<nrows; r++)
{
for(c=0; c<ncols; c++)
{
Pic[r*ncols+c] = rand() % 100;
printf("%f ", Pic[r*ncols+c]);
}
printf("; ...\n");
}
printf("];\n");
printf("IB starting\n");
// parents always has size 2*nrows-1
vl_node * parents = vl_ib(Pic, nrows, ncols);
for(r=0; r<2*nrows-1; r++)
printf("%d => %d\n", r, parents[r]);
free(parents);
free(Pic);
printf("IB done\n");
return 0;
}
| Add a simple IB test program | Add a simple IB test program
| C | bsd-2-clause | vlfeat/vlfeat,hongzhili/vlfeat,mylxiaoyi/vlfeat,j-bo/vlfeat,j-bo/vlfeat,CansenJIANG/vlfeat,hongzhili/vlfeat,erexhepa/vlfeat,hongzhili/vlfeat,cvfish/vlfeat,cvfish/vlfeat,rxl194/vlfeat,CansenJIANG/vlfeat,WangDequan/vlfeat,rxl194/vlfeat,richarddzh/vlfeat,WangDequan/vlfeat,erexhepa/vlfeat,erexhepa/vlfeat,j-bo/vlfeat,CansenJIANG/vlfeat,qubick/vlfeat,vlfeat/vlfeat,qubick/vlfeat,hongzhili/vlfeat,cvfish/vlfeat,mylxiaoyi/vlfeat,CansenJIANG/vlfeat,rxl194/vlfeat,cvfish/vlfeat,hongzhili/vlfeat,mylxiaoyi/vlfeat,mylxiaoyi/vlfeat,richarddzh/vlfeat,vlfeat/vlfeat,j-bo/vlfeat,rxl194/vlfeat,vlfeat/vlfeat,mylxiaoyi/vlfeat,WangDequan/vlfeat,erexhepa/vlfeat,richarddzh/vlfeat,WangDequan/vlfeat,qubick/vlfeat,CansenJIANG/vlfeat,qubick/vlfeat,cvfish/vlfeat,rxl194/vlfeat,richarddzh/vlfeat,erexhepa/vlfeat,WangDequan/vlfeat,vlfeat/vlfeat,hongzhili/vlfeat,vlfeat/vlfeat,mylxiaoyi/vlfeat,qubick/vlfeat,qubick/vlfeat,erexhepa/vlfeat,richarddzh/vlfeat,rxl194/vlfeat,WangDequan/vlfeat,cvfish/vlfeat,CansenJIANG/vlfeat,j-bo/vlfeat,richarddzh/vlfeat |
|
89e735673ae02cbdba08ed6d7b543453cbf34e17 | test/FrontendC/2010-05-31-palignr.c | test/FrontendC/2010-05-31-palignr.c | // RUN: not %llvmgcc -mssse3 -S -o /dev/null %s |& grep "error: mask must be an immediate"
// XFAIL: *
// XTARGET: x86,i386,i686
#include <tmmintrin.h>
extern int i;
int main ()
{
#if defined( __SSSE3__ )
typedef int16_t vSInt16 __attribute__ ((__vector_size__ (16)));
short dtbl[] = {1,2,3,4,5,6,7,8};
vSInt16 *vdtbl = (vSInt16*) dtbl;
vSInt16 v0;
v0 = *vdtbl;
v0 = _mm_alignr_epi8(v0, v0, i);
return 0;
#endif
}
| Add a test for the llvm-gcc commit in r90200. | Add a test for the llvm-gcc commit in r90200.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@105253 91177308-0d34-0410-b5e6-96231b3b80d8
| C | bsd-2-clause | chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,dslab-epfl/asap |
|
435c17a4ba235e82d5b7136e6841e6cb0eb6044e | problem_002.c | problem_002.c | /* Each new term in the Fibonacci sequence is generated by adding the previous
* two terms. By starting with 1 and 2, the first 10 terms will be:
*
* 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
*
* By considering the terms in the Fibonacci sequence whose values do not
* exceed four million, find the sum of the even-valued terms.
*/
#include <stdio.h>
#define LIMIT 4000000
int
main(int argc, char **argv)
{
int prev = 0, next = 1, sum = 0, cur = 0;
do {
cur = prev + next;
if(cur % 2 == 0) {
sum += cur;
}
prev = next;
next = cur;
} while (cur < LIMIT);
printf("%i", sum);
return 0;
}
| Add solution for problem 2 | Add solution for problem 2
| C | bsd-2-clause | skreuzer/euler |
|
5ce583eacdc66fec34b8788793170b3f860f14b5 | ComponentKit/Debug/CKComponentHierarchyDebugHelper.h | ComponentKit/Debug/CKComponentHierarchyDebugHelper.h | /*
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#import <Foundation/Foundation.h>
#import <ComponentKit/CKComponentViewConfiguration.h>
@class CKComponent;
@class UIView;
/**
CKComponentHierarchyDebugHelper allows
*/
@interface CKComponentHierarchyDebugHelper : NSObject
/**
Describe the component hierarchy starting from the window. This recursively searches downwards in the view hierarchy to
find views which have a lifecycle manager, from which we can get the component layout hierarchies.
@return A string with a description of the hierarchy.
*/
+ (NSString *)componentHierarchyDescription;
@end
| /*
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#import <Foundation/Foundation.h>
#import <ComponentKit/CKComponentViewConfiguration.h>
@class CKComponent;
@class UIView;
/**
CKComponentHierarchyDebugHelper allows
*/
@interface CKComponentHierarchyDebugHelper : NSObject
/**
Describe the component hierarchy starting from the window. This recursively searches downwards in the view hierarchy to
find views which have a lifecycle manager, from which we can get the component layout hierarchies.
@return A string with a description of the hierarchy.
*/
+ (NSString *)componentHierarchyDescription NS_EXTENSION_UNAVAILABLE("Recursively describes components using -[UIApplication keyWindow]");
@end
| Mark remaining APIs unsafe in extensions | Mark remaining APIs unsafe in extensions
This is a follow up to #534 that should help us close out #390.
| C | bsd-3-clause | bricooke/componentkit,yiding/componentkit,dshahidehpour/componentkit,eczarny/componentkit,avnerbarr/componentkit,dshahidehpour/componentkit,dshahidehpour/componentkit,bricooke/componentkit,bricooke/componentkit,MDSilber/componentkit,eczarny/componentkit,MDSilber/componentkit,yiding/componentkit,bricooke/componentkit,MDSilber/componentkit,yiding/componentkit,eczarny/componentkit,avnerbarr/componentkit,yiding/componentkit,MDSilber/componentkit,avnerbarr/componentkit,avnerbarr/componentkit |
07e8498f075bab1491508eb17412dfa111d7de03 | src/spatial/codegen/cppgen/resources/datastructures/static/PrettyPrintMacros.h | src/spatial/codegen/cppgen/resources/datastructures/static/PrettyPrintMacros.h | #define KNRM "\x1B[0m"
#define KRED "\x1B[31m"
#define KGRN "\x1B[32m"
#define KYEL "\x1B[33m"
#define KBLU "\x1B[34m"
#define KMAG "\x1B[35m"
#define KCYN "\x1B[36m"
#define KWHT "\x1B[37m"
#define PRINT_RED(...) \
printf("%s", KRED); \
printf(__VA_ARGS__); \
printf("%s", KNRM); \
#define PRINT_GREEN(...) \
printf("%s", KGRN); \
printf(__VA_ARGS__); \
printf("%s", KNRM); \
| Add pretty (color) printing macros. Unused currently. | Add pretty (color) printing macros. Unused currently.
| C | mit | stanford-ppl/spatial-lang,stanford-ppl/spatial-lang,stanford-ppl/spatial-lang,stanford-ppl/spatial-lang,stanford-ppl/spatial-lang |
|
51e169a1422fe902f3b9aa165e7058ea636baf22 | Modules/Common/include/mirtkStatus.h | Modules/Common/include/mirtkStatus.h | /*
* Medical Image Registration ToolKit (MIRTK)
*
* Copyright 2013-2015 Imperial College London
* Copyright 2013-2015 Andreas Schuh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MIRTK_Status_H
#define MIRTK_Status_H
namespace mirtk {
// -----------------------------------------------------------------------------
/// Enumeration of common states for entities such as objective function parameters
enum Status
{
Active,
Passive,
};
} // namespace mirtk
#endif // MIRTK_Status_H
| /*
* Medical Image Registration ToolKit (MIRTK)
*
* Copyright 2013-2015 Imperial College London
* Copyright 2013-2015 Andreas Schuh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MIRTK_Status_H
#define MIRTK_Status_H
namespace mirtk {
// -----------------------------------------------------------------------------
/// Enumeration of common states for entities such as objective function parameters
enum Status
{
Active,
Passive
};
} // namespace mirtk
#endif // MIRTK_Status_H
| Remove needless comma after last enumeration value | style: Remove needless comma after last enumeration value [Common]
| C | apache-2.0 | schuhschuh/MIRTK,BioMedIA/MIRTK,schuhschuh/MIRTK,BioMedIA/MIRTK,stefanpsz/MIRTK,stefanpsz/MIRTK,stefanpsz/MIRTK,schuhschuh/MIRTK,BioMedIA/MIRTK,BioMedIA/MIRTK,schuhschuh/MIRTK,stefanpsz/MIRTK |
ea517d3d489b0b315a1c5fcd8af176423b0a6425 | opensync/plugin/opensync_plugin_connection_internals.h | opensync/plugin/opensync_plugin_connection_internals.h | /*
* libopensync - A synchronization framework
* Copyright (C) 2008 Daniel Gollub <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License 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, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef _OPENSYNC_PLUGIN_CONNECTION_INTERNALS_H_
#define _OPENSYNC_PLUGIN_CONNECTION_INTERNALS_H_
/*! @brief OSyncPluginConnectionType String Map
*
* @ingroup OSyncPluginConnectionInternalsAPI
**/
typedef struct {
OSyncPluginConnectionType type;
const char *string;
} OSyncPluginConnectionTypeString;
const char *osync_plugin_connection_get_type_string(OSyncPluginConnectionType conn_type);
#endif /*_OPENSYNC_PLUGIN_CONNECTION_INTERNALS_H_*/
| Add missing file from previous commit. | Add missing file from previous commit.
git-svn-id: e31799a7ad59d6ea355ca047c69e0aee8a59fcd3@4287 53f5c7ee-bee3-0310-bbc5-ea0e15fffd5e
| C | lgpl-2.1 | luizluca/opensync-luizluca,luizluca/opensync-luizluca |
|
71b7d664f70030e12ccd7f99729f50861fb4e858 | Engine/Entity.h | Engine/Entity.h | #ifndef __ENTITY_H__
#define __ENTITY_H__
#include "ModuleCollision.h"
class Entity
{
public:
Entity() : parent(nullptr) {}
Entity(Entity* parent) : parent(parent) {}
virtual ~Entity() {}
// Entity lifecycle methods
virtual bool Start()
{
return true;
}
virtual bool Start(bool active)
{
this->active = active;
return true;
}
bool Enable()
{
if (!active)
return active = Start();
return true;
}
bool Disable()
{
if (active)
return active = !CleanUp();
return false;
}
virtual void PreUpdate() {}
virtual void Update() {}
virtual void PostUpdate() {}
virtual bool CleanUp()
{
return true;
}
// Callbacks
virtual bool OnCollision(Collider origin, Collider other)
{
return true;
}
private:
bool active = true;
Entity* parent;
};
#endif // __ENTITY_H__
| #ifndef __ENTITY_H__
#define __ENTITY_H__
#include "ModuleCollision.h"
class Entity
{
public:
Entity() : Parent(nullptr) {}
Entity(Entity* parent) : Parent(parent) {}
virtual ~Entity() {}
// Entity lifecycle methods
virtual bool Start()
{
return true;
}
virtual bool Start(bool active)
{
this->_active = active;
return true;
}
bool Enable()
{
if (!_active)
return _active = Start();
return true;
}
bool Disable()
{
if (_active)
return _active = !CleanUp();
return false;
}
virtual void PreUpdate() {}
virtual void Update() {}
virtual void PostUpdate() {}
virtual bool CleanUp()
{
return true;
}
// Callbacks
virtual bool OnCollision(Collider origin, Collider other)
{
return true;
}
public:
Entity* Parent;
private:
bool _active = true;
};
#endif // __ENTITY_H__
| Adjust entity class to naming conventions | Adjust entity class to naming conventions
references #3 | C | mit | jowie94/The-Simpsons-Arcade,jowie94/The-Simpsons-Arcade |
c68037fdc18d4dade36611a4a93dcc3fbbcfa045 | bin/test_date.c | bin/test_date.c | #include <stdio.h>
#include <time.h>
#include <stdlib.h>
int check_date(struct tm *date, time_t time, char *name) {
if( date == NULL ) {
printf("%s(%lld) returned null\n", name, (long long)time);
return 1;
}
else {
printf("%s(%lld): %s\n", name, (long long)time, asctime(date));
return 0;
}
}
int main(int argc, char *argv[]) {
long long number;
time_t time;
struct tm *localdate;
struct tm *gmdate;
if( argc <= 1 ) {
printf("usage: %s <time>\n", argv[0]);
return 1;
}
number = strtoll(argv[1], NULL, 0);
time = (time_t)number;
printf("input: %lld, time: %lld\n", number, (long long)time);
if( time != number ) {
printf("time_t overflowed\n");
return 0;
}
localdate = localtime(&time);
gmdate = gmtime(&time);
check_date(localdate, time, "localtime");
check_date(gmdate, time, "gmtime");
return 0;
}
| #include <stdio.h>
#include <time.h>
#include <stdlib.h>
int check_date(struct tm *date, time_t time, char *name) {
if( date == NULL ) {
printf("%s(%lld) returned null\n", name, (long long)time);
return 1;
}
else {
printf("%s(%lld): %s\n", name, (long long)time, asctime(date));
return 0;
}
}
int main(int argc, char *argv[]) {
long long number;
time_t time;
struct tm *localdate;
struct tm *gmdate;
if( argc <= 1 ) {
printf("usage: %s <time>\n", argv[0]);
return 1;
}
printf("sizeof time_t: %ld, tm.tm_year: %ld\n", sizeof(time_t), sizeof(gmdate->tm_year));
number = strtoll(argv[1], NULL, 0);
time = (time_t)number;
printf("input: %lld, time: %lld\n", number, (long long)time);
if( time != number ) {
printf("time_t overflowed\n");
return 0;
}
localdate = localtime(&time);
gmdate = gmtime(&time);
check_date(localdate, time, "localtime");
check_date(gmdate, time, "gmtime");
return 0;
}
| Print out the size of time_t and tm.tm_year for debugging porpuses. | Print out the size of time_t and tm.tm_year for debugging porpuses.
| C | mit | chromatic/y2038,chromatic/y2038,evalEmpire/y2038,bulk88/y2038,schwern/y2038,chromatic/y2038,foxtacles/y2038,foxtacles/y2038,bulk88/y2038,bulk88/y2038,evalEmpire/y2038,schwern/y2038 |
5c4a5fd8eeef6942ff79b519aa86b195a1e70aaf | Wikipedia/Code/WMFAnalyticsLogging.h | Wikipedia/Code/WMFAnalyticsLogging.h | #import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@protocol WMFAnalyticsLogging <NSObject>
- (NSString*)analyticsName;
@end
NS_ASSUME_NONNULL_END | #import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@protocol WMFAnalyticsContextProviding <NSObject>
- (NSString*)analyticsContext;
@end
@protocol WMFAnalyticsContentTypeProviding <NSObject>
- (NSString*)analyticsContentType;
@end
@protocol WMFAnalyticsViewNameProviding <NSObject>
- (NSString*)analyticsName;
@end
NS_ASSUME_NONNULL_END | Add additional protocols for tracking context, content type, and analytics name | Add additional protocols for tracking context, content type, and analytics name
| C | mit | anirudh24seven/wikipedia-ios,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,bgerstle/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios,bgerstle/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,anirudh24seven/wikipedia-ios,bgerstle/wikipedia-ios,wikimedia/wikipedia-ios,josve05a/wikipedia-ios,anirudh24seven/wikipedia-ios,anirudh24seven/wikipedia-ios,bgerstle/wikipedia-ios,anirudh24seven/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,anirudh24seven/wikipedia-ios,bgerstle/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios,wikimedia/wikipedia-ios,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,anirudh24seven/wikipedia-ios,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,bgerstle/wikipedia-ios,wikimedia/wikipedia-ios,julienbodet/wikipedia-ios,bgerstle/wikipedia-ios,bgerstle/wikipedia-ios,wikimedia/apps-ios-wikipedia |
76f9b29884da7c8ec329979d35db92f4838d6a02 | tests/regression/51-threadjoins/04-assume-recreate.c | tests/regression/51-threadjoins/04-assume-recreate.c | //PARAM: --set ana.activated[+] threadJoins --disable ana.thread.include-node --set ana.thread.domain plain
#include <pthread.h>
#include <assert.h>
int g = 0;
void *t_fun(void *arg) {
g++; // RACE!
return NULL;
}
int main() {
pthread_t id;
pthread_create(&id, NULL, t_fun, NULL);
__goblint_assume_join(id); // should add to must-joined
pthread_create(&id, NULL, t_fun, NULL); // should remove from must-joined again
g++; // RACE!
return 0;
}
| Add threadJoins test where recreated threads should be removed from must-join set | Add threadJoins test where recreated threads should be removed from must-join set
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
a46ad1816174773501de829f4bcf2a2f23690660 | tests/system_tests/test_cases/test_user-defined-type-copyin-copyout-two-members.c | tests/system_tests/test_cases/test_user-defined-type-copyin-copyout-two-members.c | /*
* TEST: Run copyin and copyout on a user-defined type with two members
* DIM: 3
* PRIORITY: 1
*/
#include <stdio.h>
#include "physis/physis.h"
#define N 32
#define ITER 10
struct Point {
float x;
float y;
};
DeclareGrid3D(Point, struct Point);
void check(struct Point *in, struct Point *out) {
int x = 0;
size_t nelms = N*N*N;
for (x = 0; x < nelms; ++x) {
if (in[x].x != out[x].x) {
fprintf(stderr, "Error: x mismatch at %d, in: %f, out: %f\n",
x, in[x].x, out[x].x);
exit(1);
}
if (in[x].y != out[x].y) {
fprintf(stderr, "Error: y mismatch at %d, in: %f, out: %f\n",
x, in[x].y, out[x].y);
exit(1);
}
}
}
int main(int argc, char *argv[]) {
PSInit(&argc, &argv, 3, N, N, N);
PSGrid3DPoint g1 = PSGrid3DPointNew(N, N, N);
size_t nelms = N*N*N;
struct Point *indata = (struct Point *)malloc(
sizeof(struct Point) * nelms);
int i;
for (i = 0; i < nelms; i++) {
indata[i].x = i;
indata[i].y = i+1;
}
struct Point *outdata = (struct Point *)malloc(
sizeof(struct Point) * nelms);
PSGridCopyin(g1, indata);
PSGridCopyout(g1, outdata);
check(indata, outdata);
PSGridFree(g1);
PSFinalize();
free(indata);
free(outdata);
return 0;
}
| Add a new simple test case for user-defined types | Add a new simple test case for user-defined types
| C | bsd-3-clause | naoyam/physis,naoyam/physis,naoyam/physis,naoyam/physis |
|
087a8a1a1072d9917d0a533a8708a488774dc753 | test/CodeGen/debug-info-section-macho.c | test/CodeGen/debug-info-section-macho.c | // Test that clang produces the __apple accelerator tables,
// e.g., __apple_types, correctly.
// RUN: %clang %s -target x86_64-apple-macosx10.13.0 -c -g -o %t-ex
// RUN: llvm-objdump -section-headers %t-ex | FileCheck %s
int main (int argc, char const *argv[]) { return argc; }
// CHECK: __debug_str
// CHECK-NEXT: __debug_abbrev
// CHECK-NEXT: __debug_info
// CHECK-NEXT: __debug_ranges
// CHECK-NEXT: __debug_macinfo
// CHECK-NEXT: __apple_names
// CHECK-NEXT: __apple_objc
// CHECK-NEXT: __apple_namespac
// CHECK-NEXT: __apple_types
| Add a test to check clang produces accelerator tables. | [Darwin] Add a test to check clang produces accelerator tables.
This test was previously in lldb, and was only checking that clang
was emitting the correct section. So, it belongs here and not
in the debugger.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@325850 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,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,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang |
|
83b7ba154c3b7735685315c7dbbf2083945b947c | board.h | board.h | #ifndef __BOARD_H
#define __BOARD_H
#ifdef __cplusplus
extern "C" {
#endif
#define F_OSC0 12000000UL
#define F_OSC1 0UL
#define F_CPU 66000000UL
#define HSBMASK_DEFAULT 0xFFFFFFFF
#define PBAMASK_DEFAULT 0xFFFFFFFF
#define PBBMASK_DEFAULT 0xFFFFFFFF
void init_board(void);
#ifdef __cplusplus
}
#endif
#endif
| #ifndef __BOARD_H
#define __BOARD_H
#ifdef __cplusplus
extern "C" {
#endif
#define ADC_VREF 3.0
#define ADC_BITS 10
#define F_CPU 66000000UL
#define F_OSC0 12000000UL
#define F_OSC1 0UL
#define HSBMASK_DEFAULT 0xFFFFFFFF
#define PBAMASK_DEFAULT 0xFFFFFFFF
#define PBBMASK_DEFAULT 0xFFFFFFFF
void init_board(void);
static inline double cnv2volt(uint16_t cnv)
{
return cnv * (ADC_VREF / (1U << ADC_BITS));
}
#ifdef __cplusplus
}
#endif
#endif
| Add adc settings and a function to calculate the conversion | Add adc settings and a function to calculate the conversion
| C | bsd-3-clause | denravonska/aery32,aery32/aery32,denravonska/aery32,aery32/aery32 |
9c6ef2d2e6fc944267fb3a857d5797afb9efcb06 | queue.c | queue.c | #include "queue.h"
struct Queue
{
size_t head;
size_t tail;
size_t size;
void** e;
};
Queue* Queue_Create(size_t n)
{
Queue* q = (Queue *)malloc(sizeof(Queue));
q->size = n;
q->head = q->tail = 1;
q->e = (void **)malloc(sizeof(void*) * (n + 1));
} | #include "queue.h"
struct Queue
{
size_t head;
size_t tail;
size_t size;
void** e;
};
Queue* Queue_Create(size_t n)
{
Queue* q = (Queue *)malloc(sizeof(Queue));
q->size = n;
q->head = q->tail = 1;
q->e = (void **)malloc(sizeof(void*) * (n + 1));
return q;
} | Add missing return after Queue creation | Add missing return after Queue creation
| C | mit | MaxLikelihood/CADT |
6ae7b4776f1cbafb5703376cb806572667070b8d | libc/sysdeps/linux/common/getrusage.c | libc/sysdeps/linux/common/getrusage.c | /* vi: set sw=4 ts=4: */
/*
* getrusage() for uClibc
*
* Copyright (C) 2000-2004 by Erik Andersen <[email protected]>
*
* GNU Library General Public License (LGPL) version 2 or later.
*/
#include "syscalls.h"
#include <unistd.h>
#include <wait.h>
_syscall2(int, getrusage, int, who, struct rusage *, usage);
| /* vi: set sw=4 ts=4: */
/*
* getrusage() for uClibc
*
* Copyright (C) 2000-2004 by Erik Andersen <[email protected]>
*
* GNU Library General Public License (LGPL) version 2 or later.
*/
#include "syscalls.h"
#include <unistd.h>
#include <wait.h>
_syscall2(int, getrusage, __rusage_who_t, who, struct rusage *, usage);
| Correct type, gcc-3.4.5 fails, thanks nitinkg for reporting/testing | Correct type, gcc-3.4.5 fails, thanks nitinkg for reporting/testing
| C | lgpl-2.1 | joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc |
3951fae51d776d05e871ee5a7beb62fb832985b1 | src/port/pthread-win32.h | src/port/pthread-win32.h | #ifndef __PTHREAD_H
#define __PTHREAD_H
typedef ULONG pthread_key_t;
typedef HANDLE pthread_mutex_t;
typedef int pthread_once_t;
DWORD pthread_self(void);
void pthread_setspecific(pthread_key_t, void *);
void *pthread_getspecific(pthread_key_t);
void pthread_mutex_init(pthread_mutex_t *, void *attr);
void pthread_mutex_lock(pthread_mutex_t *);
/* blocking */
void pthread_mutex_unlock(pthread_mutex_t *);
#endif
| #ifndef __PTHREAD_H
#define __PTHREAD_H
typedef ULONG pthread_key_t;
typedef HANDLE pthread_mutex_t;
typedef int pthread_once_t;
DWORD pthread_self(void);
void pthread_setspecific(pthread_key_t, void *);
void *pthread_getspecific(pthread_key_t);
int pthread_mutex_init(pthread_mutex_t *, void *attr);
int pthread_mutex_lock(pthread_mutex_t *);
/* blocking */
int pthread_mutex_unlock(pthread_mutex_t *);
#endif
| Fix declarations of pthread functions, missed in recent commit. | Fix declarations of pthread functions, missed in recent commit.
| C | agpl-3.0 | tpostgres-projects/tPostgres,50wu/gpdb,jmcatamney/gpdb,Chibin/gpdb,Postgres-XL/Postgres-XL,Postgres-XL/Postgres-XL,ovr/postgres-xl,techdragon/Postgres-XL,Chibin/gpdb,xinzweb/gpdb,adam8157/gpdb,pavanvd/postgres-xl,kmjungersen/PostgresXL,50wu/gpdb,ovr/postgres-xl,lisakowen/gpdb,ovr/postgres-xl,greenplum-db/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,edespino/gpdb,xinzweb/gpdb,edespino/gpdb,postmind-net/postgres-xl,techdragon/Postgres-XL,ashwinstar/gpdb,oberstet/postgres-xl,yuanzhao/gpdb,jmcatamney/gpdb,zeroae/postgres-xl,arcivanov/postgres-xl,jmcatamney/gpdb,adam8157/gpdb,snaga/postgres-xl,50wu/gpdb,50wu/gpdb,arcivanov/postgres-xl,adam8157/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,tpostgres-projects/tPostgres,yazun/postgres-xl,kmjungersen/PostgresXL,arcivanov/postgres-xl,edespino/gpdb,Chibin/gpdb,arcivanov/postgres-xl,xinzweb/gpdb,kmjungersen/PostgresXL,techdragon/Postgres-XL,lisakowen/gpdb,greenplum-db/gpdb,xinzweb/gpdb,xinzweb/gpdb,50wu/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,postmind-net/postgres-xl,oberstet/postgres-xl,postmind-net/postgres-xl,zeroae/postgres-xl,oberstet/postgres-xl,yazun/postgres-xl,zeroae/postgres-xl,Chibin/gpdb,yazun/postgres-xl,yuanzhao/gpdb,ashwinstar/gpdb,Postgres-XL/Postgres-XL,kmjungersen/PostgresXL,adam8157/gpdb,tpostgres-projects/tPostgres,edespino/gpdb,pavanvd/postgres-xl,yazun/postgres-xl,snaga/postgres-xl,ashwinstar/gpdb,Chibin/gpdb,postmind-net/postgres-xl,yuanzhao/gpdb,yuanzhao/gpdb,ashwinstar/gpdb,arcivanov/postgres-xl,Postgres-XL/Postgres-XL,Chibin/gpdb,Postgres-XL/Postgres-XL,edespino/gpdb,lisakowen/gpdb,edespino/gpdb,yuanzhao/gpdb,adam8157/gpdb,jmcatamney/gpdb,lisakowen/gpdb,yuanzhao/gpdb,Chibin/gpdb,greenplum-db/gpdb,lisakowen/gpdb,50wu/gpdb,adam8157/gpdb,pavanvd/postgres-xl,Chibin/gpdb,lisakowen/gpdb,jmcatamney/gpdb,tpostgres-projects/tPostgres,lisakowen/gpdb,edespino/gpdb,techdragon/Postgres-XL,kmjungersen/PostgresXL,greenplum-db/gpdb,Chibin/gpdb,postmind-net/postgres-xl,xinzweb/gpdb,ashwinstar/gpdb,arcivanov/postgres-xl,ashwinstar/gpdb,adam8157/gpdb,snaga/postgres-xl,lisakowen/gpdb,adam8157/gpdb,50wu/gpdb,techdragon/Postgres-XL,yazun/postgres-xl,yuanzhao/gpdb,pavanvd/postgres-xl,oberstet/postgres-xl,greenplum-db/gpdb,tpostgres-projects/tPostgres,edespino/gpdb,oberstet/postgres-xl,xinzweb/gpdb,xinzweb/gpdb,pavanvd/postgres-xl,zeroae/postgres-xl,greenplum-db/gpdb,snaga/postgres-xl,ovr/postgres-xl,ovr/postgres-xl,Chibin/gpdb,50wu/gpdb,snaga/postgres-xl,edespino/gpdb,yuanzhao/gpdb,jmcatamney/gpdb,edespino/gpdb,ashwinstar/gpdb,zeroae/postgres-xl |
9d7343347b61a9e0110b8ba81cdd66b5c5ea0bac | src/sas/readstat_xport.c | src/sas/readstat_xport.c | #include <stdint.h>
#include "readstat_xport.h"
#include "../readstat_bits.h"
char _xport_months[12][4] = {
"JAN", "FEB", "MAR", "APR", "MAY", "JUN",
"JUL", "AUG", "SEP", "OCT", "NOV", "DEC" };
void xport_namestr_bswap(xport_namestr_t *namestr) {
if (!machine_is_little_endian())
return;
namestr->ntype = byteswap2(namestr->ntype);
namestr->nhfun = byteswap2(namestr->nhfun);
namestr->nlng = byteswap2(namestr->nlng);
namestr->nvar0 = byteswap2(namestr->nlng);
namestr->nfl = byteswap2(namestr->nfl);
namestr->nfd = byteswap2(namestr->nfd);
namestr->nfj = byteswap2(namestr->nfj);
namestr->nifl = byteswap2(namestr->nifl);
namestr->nifd = byteswap2(namestr->nifd);
namestr->npos = byteswap4(namestr->npos);
namestr->labeln = byteswap2(namestr->labeln);
}
| #include <stdint.h>
#include "readstat_xport.h"
#include "../readstat_bits.h"
char _xport_months[12][4] = {
"JAN", "FEB", "MAR", "APR", "MAY", "JUN",
"JUL", "AUG", "SEP", "OCT", "NOV", "DEC" };
void xport_namestr_bswap(xport_namestr_t *namestr) {
if (!machine_is_little_endian())
return;
namestr->ntype = byteswap2(namestr->ntype);
namestr->nhfun = byteswap2(namestr->nhfun);
namestr->nlng = byteswap2(namestr->nlng);
namestr->nvar0 = byteswap2(namestr->nvar0);
namestr->nfl = byteswap2(namestr->nfl);
namestr->nfd = byteswap2(namestr->nfd);
namestr->nfj = byteswap2(namestr->nfj);
namestr->nifl = byteswap2(namestr->nifl);
namestr->nifd = byteswap2(namestr->nifd);
namestr->npos = byteswap4(namestr->npos);
namestr->labeln = byteswap2(namestr->labeln);
}
| Fix bug in XPORT byteswapping | Fix bug in XPORT byteswapping
| C | mit | WizardMac/ReadStat,WizardMac/ReadStat |
74046391a491fe30c587685b036c8509d34b9936 | main.c | main.c | #include <unistd.h>
#include <stdlib.h>
#include <sys/socket.h>
int main(void) {
char const *server_path = "/tmp/unix_server_listener"
int listener = socket(PF_UNIX, SOCK_STREAM, 0);
unlink(server_path);
int err = bind(listener, address);
err = listen(listener, 2048);
set listener close-on-fork
int pid = fork();
if (pid > 0) {
// in child
int client = socket(PF_UNIX, SOCK_STREAM, 0);
int err = connect(client, address);
exit(0);
}
if (pid == -1) {
// err
exit(1)
}
int connection = accept(listener);
wait for readability
attempt read
return 0;
}
| Add skeleton of test program | Add skeleton of test program
| C | mit | keithduncan/unix_server |
|
c1db1c5a23c7066d9417ed808b01f452874ff7ed | libexec/ftpd/skey-stuff.c | libexec/ftpd/skey-stuff.c | /* Author: Wietse Venema, Eindhoven University of Technology. */
#include <stdio.h>
#include <pwd.h>
#include <skey.h>
/* skey_challenge - additional password prompt stuff */
char *skey_challenge(name, pwd, pwok)
char *name;
struct passwd *pwd;
int pwok;
{
static char buf[128];
struct skey skey;
/* Display s/key challenge where appropriate. */
if (pwd == 0 || skeychallenge(&skey, pwd->pw_name, buf) != 0)
sprintf(buf, "Password required for %s.", name);
return (buf);
}
| Put skey support to ftpd Reviewed by: Submitted by: guido | Put skey support to ftpd
Reviewed by:
Submitted by: guido
| C | bsd-3-clause | jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase |
|
a512578fdd9e815f9244bc1d5a5fcd30464e8cbc | source/openta/ta_errors.h | source/openta/ta_errors.h | // Public domain. See "unlicense" statement at the end of this file.
#define TA_ERROR_FAILED_TO_PARSE_CMDLINE -1
#define TA_ERROR_FAILED_TO_CREATE_GAME_CONTEXT -2
#define TA_ERROR_INVALID_ARGS -3
| // Public domain. See "unlicense" statement at the end of this file.
typedef int ta_result;
#define TA_SUCCESS 0
#define TA_ERRORS -1
#define TA_INVALID_ARGS -2
#define TA_OUT_OF_MEMORY -3
#define TA_ERROR_FAILED_TO_PARSE_CMDLINE -1
#define TA_ERROR_FAILED_TO_CREATE_GAME_CONTEXT -2
#define TA_ERROR_INVALID_ARGS -3
| Add a few result codes. | Add a few result codes.
| C | mit | mackron/openta,mackron/openta |
c9b72d350872bf0d23d3b7905c7f8169c7f91a8b | reverb/cc/conversions.h | reverb/cc/conversions.h | // Copyright 2019 DeepMind Technologies Limited.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef REVERB_CC_CONVERSIONS_H_
#define REVERB_CC_CONVERSIONS_H_
#include "numpy/arrayobject.h"
#include "tensorflow/core/framework/types.h"
#include "tensorflow/core/framework/tensor.h"
namespace deepmind {
namespace reverb {
namespace pybind {
void ImportNumpy();
tensorflow::Status TensorToNdArray(const tensorflow::Tensor &tensor,
PyObject **out_ndarray);
tensorflow::Status NdArrayToTensor(PyObject *ndarray,
tensorflow::Tensor *out_tensor);
tensorflow::Status GetPyDescrFromDataType(tensorflow::DataType dtype,
PyArray_Descr **out_descr);
} // namespace pybind
} // namespace reverb
} // namespace deepmind
#endif // REVERB_CC_CONVERSIONS_H_
| // Copyright 2019 DeepMind Technologies Limited.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef REVERB_CC_CONVERSIONS_H_
#define REVERB_CC_CONVERSIONS_H_
#include "numpy/arrayobject.h"
#include "tensorflow/core/framework/types.h"
#include "tensorflow/core/framework/tensor.h"
namespace deepmind {
namespace reverb {
namespace pybind {
// One MUST initialize Numpy, e.g. within the Pybind11 module definition before
// calling C Numpy functions.
// See https://pythonextensionpatterns.readthedocs.io/en/latest/cpp_and_numpy.html
void ImportNumpy();
tensorflow::Status TensorToNdArray(const tensorflow::Tensor &tensor,
PyObject **out_ndarray);
tensorflow::Status NdArrayToTensor(PyObject *ndarray,
tensorflow::Tensor *out_tensor);
tensorflow::Status GetPyDescrFromDataType(tensorflow::DataType dtype,
PyArray_Descr **out_descr);
} // namespace pybind
} // namespace reverb
} // namespace deepmind
#endif // REVERB_CC_CONVERSIONS_H_
| Document why `ImportNumpy ` exists and when it should be used. | Document why `ImportNumpy ` exists and when it should be used.
PiperOrigin-RevId: 474532725
Change-Id: I305a57456bcac3186389a733e16d962fcee99dee
| C | apache-2.0 | deepmind/reverb,deepmind/reverb,deepmind/reverb,deepmind/reverb |
f160c0edd74d9f31c936b92c7e7e6b4c9fb6848e | src/engine/scriptwindow.h | src/engine/scriptwindow.h | #ifndef SCRIPTWINDOW_H
#define SCRIPTWINDOW_H
#include <stdint.h>
#include <QHash>
#include <QObject>
#include <QScriptValue>
class QScriptEngine;
class ScriptWindow : public QObject {
Q_OBJECT
public:
explicit ScriptWindow(const QScriptValue &originalWindow, QObject *parent = 0);
QScriptValue toScriptValue();
Q_INVOKABLE int randomInt(int min = 0, int max = INT32_MAX) const;
Q_INVOKABLE int setInterval(const QScriptValue &function, int delay);
Q_INVOKABLE void clearInterval(int timerId);
Q_INVOKABLE int setTimeout(const QScriptValue &function, int delay);
Q_INVOKABLE void clearTimeout(int timerId);
protected:
virtual void timerEvent(QTimerEvent *event);
private:
QScriptEngine *m_engine;
QScriptValue m_originalWindow;
QHash<int, QScriptValue> m_intervalHash;
QHash<int, QScriptValue> m_timeoutHash;
};
#endif // SCRIPTWINDOW_H
| #ifndef SCRIPTWINDOW_H
#define SCRIPTWINDOW_H
#include <QHash>
#include <QObject>
#include <QScriptValue>
class QScriptEngine;
class ScriptWindow : public QObject {
Q_OBJECT
public:
explicit ScriptWindow(const QScriptValue &originalWindow, QObject *parent = 0);
QScriptValue toScriptValue();
Q_INVOKABLE int randomInt(int min = 0, int max = 2147483647) const;
Q_INVOKABLE int setInterval(const QScriptValue &function, int delay);
Q_INVOKABLE void clearInterval(int timerId);
Q_INVOKABLE int setTimeout(const QScriptValue &function, int delay);
Q_INVOKABLE void clearTimeout(int timerId);
protected:
virtual void timerEvent(QTimerEvent *event);
private:
QScriptEngine *m_engine;
QScriptValue m_originalWindow;
QHash<int, QScriptValue> m_intervalHash;
QHash<int, QScriptValue> m_timeoutHash;
};
#endif // SCRIPTWINDOW_H
| Fix compile error on Amazon EC2. | Fix compile error on Amazon EC2.
| C | agpl-3.0 | arendjr/PlainText,arendjr/PlainText,arendjr/PlainText |
2fbd5548c56d6cbeef46248da67cb97455a3a7ec | apps/rldtest/rldtest.c | apps/rldtest/rldtest.c | /*
** Copyright 2002, Manuel J. Petit. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#include <stdio.h>
#include <dlfcn.h>
extern int fib(int);
extern void shared_hello(void);
int
main()
{
void *freston;
void *girlfriend;
shared_hello();
printf("%d %d %d %d %d %d\n", fib(0), fib(1), fib(2), fib(3), fib(4), fib(5));
freston= dlopen("/boot/lib/girlfriend.so", RTLD_LAZY);
girlfriend= dlsym(freston, "girlfriend");
((void(*)(void))girlfriend)();
return 0;
}
| /*
** Copyright 2002, Manuel J. Petit. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#include <stdio.h>
#include <dlfcn.h>
extern int fib(int);
extern void shared_hello(void);
int
main()
{
void *freston;
void *girlfriend;
shared_hello();
printf("%d %d %d %d %d %d\n", fib(0), fib(1), fib(2), fib(3), fib(4), fib(5));
freston= dlopen("/boot/lib/girlfriend.so", RTLD_NOW);
girlfriend= dlsym(freston, "girlfriend");
((void(*)(void))girlfriend)();
return 0;
}
| Fix serious bug. Should be RTLD_NOW... RTLD_LAZY does not work for getting a girlfriend. | Fix serious bug. Should be RTLD_NOW... RTLD_LAZY does not work for getting a girlfriend.
git-svn-id: fb278a52ad97f7fbef074986829f2c6a2a3c4b34@547 c25cc9d1-44fa-0310-b259-ad778cb1d433
| C | bsd-3-clause | dioptre/newos,travisg/newos,siraj/newos,zhouxh1023/newos,siraj/newos,siraj/newos,dioptre/newos,dioptre/newos,siraj/newos,travisg/newos,zhouxh1023/newos,travisg/newos,zhouxh1023/newos |
fe2714923b986bc461b692d45c1b5eb1b469ddc4 | firmware/include/vb2_api.h | firmware/include/vb2_api.h | /* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* APIs between calling firmware and vboot_reference
*
* DO NOT INCLUDE THE HEADERS BELOW DIRECTLY! ONLY INCLUDE THIS FILE!
*/
#ifndef VBOOT_VB2_API_H_
#define VBOOT_VB2_API_H_
/* Standard APIs */
#include "../2lib/include/2api.h"
/*
* Coreboot should not need access to vboot2 internals. But right now it does.
* At least this forces it to do so through a relatively narrow hole so vboot2
* refactoring can continue.
*
* Please do not rip this into a wider hole, or expect this hole to continue.
*
* TODO: Make cleaner APIs to this stuff.
*/
#ifdef NEED_VB20_INTERNALS
#include "../2lib/include/2struct.h"
#endif
#endif /* VBOOT_VB2_API_H_ */
| Add official API header file | vboot2: Add official API header file
This is what other firmware should include. Other firmware must NOT
attempt to include headers from deeper inside the vboot2
implementation; that will likely break as vboot2 is refactored.
BUG=chromium:423882
BRANCH=none
TEST=VBOOT2=1 make runtests
Change-Id: I63638b03bb108296fa5069e7cc32ee9e25183846
Signed-off-by: Randall Spangler <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/233050
Reviewed-by: Bill Richardson <[email protected]>
| C | bsd-3-clause | coreboot/vboot,geekboxzone/mmallow_external_vboot_reference,acorn-marvell/vboot_reference,acorn-marvell/vboot_reference,geekboxzone/mmallow_external_vboot_reference,coreboot/vboot,geekboxzone/mmallow_external_vboot_reference,geekboxzone/mmallow_external_vboot_reference,acorn-marvell/vboot_reference,coreboot/vboot,geekboxzone/mmallow_external_vboot_reference,coreboot/vboot,coreboot/vboot,acorn-marvell/vboot_reference |
|
4ea166194c7eec0262b3e30d9a599ea187a8591e | src/ios/KirinKit/KirinKit/Extensions/GWTServices/NewDatabaseAccessService.h | src/ios/KirinKit/KirinKit/Extensions/GWTServices/NewDatabaseAccessService.h | //
// NewDatabasesImpl.h
// KirinKit
//
// Created by Douglas Hoskins on 04/10/2013.
// Copyright (c) 2013 Future Platforms. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "NSObject+Kirin.h"
#import "KirinGwtServiceStub.h"
#import "NewTransactionService.h"
#import <toNative/DatabaseAccessServiceNative.h>
@interface NewDatabaseAccessService : KirinGwtServiceStub<DatabaseAccessServiceNative>
@property (strong, nonatomic) NSMutableDictionary * DbForId;
@property (strong, nonatomic) NewTransactionService * NewTransactionService;
@end
| //
// NewDatabasesImpl.h
// KirinKit
//
// Created by Douglas Hoskins on 04/10/2013.
// Copyright (c) 2013 Future Platforms. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "NSObject+Kirin.h"
#import "KirinGwtServiceStub.h"
#import "NewTransactionService.h"
#import <toNative/DatabaseAccessServiceNative.h>
#import "KirinSynchronousExecute.h"
@interface NewDatabaseAccessService : KirinGwtServiceStub<DatabaseAccessServiceNative, KirinSynchronousExecute>
@property (strong, nonatomic) NSMutableDictionary * DbForId;
@property (strong, nonatomic) NewTransactionService * NewTransactionService;
@end
| Make KirinGwtServiceStub use KirinSynchronousExecute protocol | [ios] Make KirinGwtServiceStub use KirinSynchronousExecute protocol
| C | apache-2.0 | futureplatforms/Kirin,futureplatforms/Kirin,futureplatforms/Kirin,futureplatforms/Kirin,futureplatforms/Kirin |
56437dfda6512a192e1eb227019c36e83c3df422 | src/common/global_state_annotation.h | src/common/global_state_annotation.h | /// @file
/// @brief Defines global state annotation class.
#ifndef GLOBAL_STATE_ANNOTATION_H
#define GLOBAL_STATE_ANNOTATION_H
namespace fish_annotator {
/// Defines global state information for one image/frame.
struct GlobalStateAnnotation : public Serialization {
/// Constructor.
///
/// @param states Global states of this image/frame.
GlobalStateAnnotation(std::map<std::string, bool> states);
/// Default constructor.
GlobalStateAnnotation();
/// Writes to a property tree.
///
/// @return Property tree constructed from the object.
pt::ptree write() const override final;
/// Reads from a property tree.
///
/// @param tree Property tree to be read.
void read(const pt::ptree &tree);
/// Global states of this image/frame.
std::map<std::string, bool> states_;
};
} // namespace fish_annotator
#endif // GLOBAL_STATE_ANNOTATION_H
| Add global state annotation definitions | Add global state annotation definitions
| C | mit | BGWoodward/FishDetector |
|
b3761005e1bcdcc11051bf45e90a00b1f33cb82e | tests/regression/29-svcomp/27-td3-front-via-destab-infl.c | tests/regression/29-svcomp/27-td3-front-via-destab-infl.c | // PARAM: --set ana.activated[+] var_eq --set ana.activated[+] symb_locks --set ana.activated[+] region --enable ana.sv-comp.enabled --set ana.specification "CHECK( init(main()), LTL(G ! call(reach_error())) )"
// creduced from ldv-linux-4.2-rc1/linux-4.2-rc1.tar.xz-43_2a-drivers--scsi--qla4xxx--qla4xxx.ko-entry_point.cil.out.i
// this program and params are really minimal, which produced a TD3 abort verify error, so don't simplify
int a;
void c();
void b() {
c();
}
unsigned e() {
int d;
if (d)
c();
return;
}
void c() {
int f;
unsigned g = 0;
do {
g = e();
if (a)
return;
do {
f++;
} while (f);
} while (g);
b();
}
int main() {
b();
return 0;
}
| Add minimal creduced case where TD3 abort fails its verify | Add minimal creduced case where TD3 abort fails its verify
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
d88ad4e76c026a8a2a959cacefd456d04ea22601 | solutions/uri/1010/1010.c | solutions/uri/1010/1010.c | #include <math.h>
#include <stdio.h>
int main() {
int a, b;
float c, s = 0.0;
while (scanf("%d %d %f", &a, &b, &c) != EOF) {
s += c * b;
}
printf("VALOR A PAGAR: R$ %.2f\n", s);
}
| Solve Simple Calculate in c | Solve Simple Calculate in c
| C | mit | deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground |
|
8709f4c305854a8e23e6c0fc868b7c9a65827707 | src/String.h | src/String.h | //=============================================================================
// String.h
//=============================================================================
#ifndef SRC_STRING_H_
#define SRC_STRING_H_
#include "AutoReleasePool.h"
#include <string.h>
//-----------------------------------------------------------------------------
STRUCT String {
const string str;
const unsigned long size;
} String;
//-----------------------------------------------------------------------------
String StringOf(const string);
string newstring(AutoReleasePool*, unsigned long size);
String newString(AutoReleasePool*, unsigned long size);
string copystring(AutoReleasePool*, const string, unsigned long size);
String copyString(AutoReleasePool*, const String, unsigned long size);
String appendChar(AutoReleasePool*, const String, const CHAR, unsigned int increaseBy);
string joinstrings(AutoReleasePool*, const string, const string);
String joinStrings(AutoReleasePool*, const String, const String);
String trimStringToSize(AutoReleasePool*, const String);
unsigned int getAllocationCount();
//-----------------------------------------------------------------------------
#endif // SRC_STRING_H_
//----------------------------------------------------------------------------- | //=============================================================================
// String.h
//=============================================================================
#ifndef SRC_STRING_H_
#define SRC_STRING_H_
#include "AutoReleasePool.h"
#include <string.h>
//-----------------------------------------------------------------------------
STRUCT String {
string str;
unsigned long size;
} String;
//-----------------------------------------------------------------------------
String StringOf(const string);
string newstring(AutoReleasePool*, unsigned long size);
String newString(AutoReleasePool*, unsigned long size);
string copystring(AutoReleasePool*, const string, unsigned long size);
String copyString(AutoReleasePool*, const String, unsigned long size);
String appendChar(AutoReleasePool*, const String, const CHAR, unsigned int increaseBy);
string joinstrings(AutoReleasePool*, const string, const string);
String joinStrings(AutoReleasePool*, const String, const String);
String trimStringToSize(AutoReleasePool*, const String);
unsigned int getAllocationCount();
//-----------------------------------------------------------------------------
#endif // SRC_STRING_H_
//----------------------------------------------------------------------------- | Refactor - fix error in gcc compile | Refactor - fix error in gcc compile | C | apache-2.0 | jasonxhill/okavangoc,jasonxhill/okavangoc |
96bc2bb6c95cb61d0039c7da19cd7d172c668aa9 | lib/libmid/errstr.c | lib/libmid/errstr.c | #include "../../include/mid.h"
#include <SDL/SDL_error.h>
#include <stdarg.h>
#include <errno.h>
#include <string.h>
enum { Bufsz = 1024 };
static char curerr[Bufsz + 1];
void seterrstr(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
snprintf(curerr, Bufsz + 1, fmt, ap);
va_end(ap);
}
const char *miderrstr(void){
int err = errno;
if (curerr[0] != '\0') {
static char retbuf[Bufsz + 1];
strncpy(retbuf, curerr, Bufsz);
retbuf[Bufsz] = '\0';
curerr[0] = '\0';
return retbuf;
}
const char *e = SDL_GetError();
if(e[0] != '\0')
return e;
return strerror(err);
}
| #include "../../include/mid.h"
#include <SDL/SDL_error.h>
#include <stdarg.h>
#include <errno.h>
#include <string.h>
enum { Bufsz = 1024 };
static char curerr[Bufsz + 1];
void seterrstr(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vsnprintf(curerr, Bufsz + 1, fmt, ap);
va_end(ap);
}
const char *miderrstr(void){
int err = errno;
if (curerr[0] != '\0') {
static char retbuf[Bufsz + 1];
strncpy(retbuf, curerr, Bufsz);
retbuf[Bufsz] = '\0';
curerr[0] = '\0';
return retbuf;
}
const char *e = SDL_GetError();
if(e[0] != '\0')
return e;
return strerror(err);
}
| Call vsnprintf instead of just snprintf. | Call vsnprintf instead of just snprintf.
| C | mit | velour/mid,velour/mid,velour/mid |
dcf530dd0e811a75191bd0f86e53561db1a8ed44 | config/config-mem.h | config/config-mem.h | /*
* config-mem.h
*
* Copyright (c) 1996, 1997
* Transvirtual Technologies, Inc. All rights reserved.
*
* See the file "license.terms" for information on usage and redistribution
* of this file.
*/
#ifndef __config_mem_h
#define __config_mem_h
#if defined(HAVE_STRING_H)
#include <string.h>
#endif
#if defined(HAVE_MALLOC_H)
#include <malloc.h>
#endif
#if defined(HAVE_ALLOCA_H)
#include <alloca.h>
#endif
#if defined(HAVE_MEMORY_H)
#include <memory.h>
#endif
#if defined(HAVE_MMAP)
#include <sys/mman.h>
#endif
#if !defined(HAVE_MEMCPY)
void bcopy(void*, void*, size_t);
#define memcpy(_d, _s, _n) bcopy((_s), (_d), (_n))
#endif
#if !defined(HAVE_MEMMOVE)
/* use bcopy instead */
#define memmove(to,from,size) bcopy((from),(to),(size))
#endif
#if !defined(HAVE_GETPAGESIZE)
#define getpagesize() 8192
#endif
#endif
| /*
* config-mem.h
*
* Copyright (c) 1996, 1997
* Transvirtual Technologies, Inc. All rights reserved.
*
* See the file "license.terms" for information on usage and redistribution
* of this file.
*/
#ifndef __config_mem_h
#define __config_mem_h
#if defined(HAVE_STRING_H)
#include <string.h>
#endif
#if defined(HAVE_MALLOC_H)
#include <malloc.h>
#endif
#if defined(HAVE_ALLOCA_H)
#include <alloca.h>
#endif
#if defined(HAVE_MEMORY_H)
#include <memory.h>
#endif
#if defined(HAVE_MMAP)
#include <sys/types.h>
#include <sys/mman.h>
#endif
#if !defined(HAVE_MEMCPY)
void bcopy(void*, void*, size_t);
#define memcpy(_d, _s, _n) bcopy((_s), (_d), (_n))
#endif
#if !defined(HAVE_MEMMOVE)
/* use bcopy instead */
#define memmove(to,from,size) bcopy((from),(to),(size))
#endif
#if !defined(HAVE_GETPAGESIZE)
#define getpagesize() 8192
#endif
#endif
| Fix build problem under FreeBSD. | Fix build problem under FreeBSD.
| C | lgpl-2.1 | kaffe/kaffe,kaffe/kaffe,kaffe/kaffe,kaffe/kaffe,kaffe/kaffe |
25d67e3ef084ff3894a235c2ab529f362524b89a | include/nekit/utils/async_io_interface.h | include/nekit/utils/async_io_interface.h | // MIT License
// Copyright (c) 2017 Zhuhao Wang
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#pragma once
#include <boost/asio.hpp>
namespace nekit {
namespace utils {
class AsyncIoInterface {
public:
explicit AsyncIoInterface(boost::asio::io_service& io) : io_{&io} {};
~AsyncIoInterface() = default;
boost::asio::io_service& io() const { return *io_; }
private:
boost::asio::io_service* io_;
};
} // namespace utils
} // namespace nekit
| // MIT License
// Copyright (c) 2017 Zhuhao Wang
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#pragma once
#include <boost/asio.hpp>
namespace nekit {
namespace utils {
class AsyncIoInterface {
public:
virtual ~AsyncIoInterface() = default;
// It must be guaranteed that any `io_context` that will be returned by any
// instances of this interface should not be released before all instances are
// released.
virtual boost::asio::io_context* io() = 0;
};
} // namespace utils
} // namespace nekit
| Make AsyncIoInterface a pure interface | REFACTOR: Make AsyncIoInterface a pure interface
| C | mit | zhuhaow/libnekit,zhuhaow/libnekit,zhuhaow/libnekit,zhuhaow/libnekit |
3281226fa2caa220f9654fa3c6734f56962792a2 | prefix.h | prefix.h | #ifndef KLETCH_MATH_PREFIX_H
#define KLETCH_MATH_PREFIX_H
#include <utility>
#include <tuple>
#include <iostream>
#include <limits>
#include "special_functions.h"
namespace kletch {
#ifdef KLETCH_USE_DOUBLES
typedef double real;
#else
typedef float real;
#endif
template <typename T>
inline constexpr real rl(T number) { return static_cast<real>(number); }
using std::swap;
typedef std::numeric_limits<double> double_limits;
typedef std::numeric_limits<float> float_limits;
typedef std::numeric_limits<real> real_limits;
} // namespace kletch
#endif // KLETCH_MATH_PREFIX_H
| #ifndef KLETCH_MATH_PREFIX_H
#define KLETCH_MATH_PREFIX_H
#include <utility>
#include <tuple>
#include <iostream>
#include <limits>
#include "special_functions.h"
namespace kletch {
#ifdef KLETCH_WITH_DOUBLE
typedef double real;
#else
typedef float real;
#endif
template <typename T>
inline constexpr real rl(T number) { return static_cast<real>(number); }
using std::swap;
typedef std::numeric_limits<double> double_limits;
typedef std::numeric_limits<float> float_limits;
typedef std::numeric_limits<real> real_limits;
} // namespace kletch
#endif // KLETCH_MATH_PREFIX_H
| Make ReferenceFresnelTest th config dependent | Make ReferenceFresnelTest th config dependent
| C | unlicense | mkacz91/math |
642e338cf79c78704ebfa7833fdd148f561921f5 | sw/device/lib/dif/dif_warn_unused_result.h | sw/device/lib/dif/dif_warn_unused_result.h | // Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#ifndef OPENTITAN_SW_DEVICE_LIB_DIF_DIF_WARN_UNUSED_RESULT_H_
#define OPENTITAN_SW_DEVICE_LIB_DIF_DIF_WARN_UNUSED_RESULT_H_
/**
* @file
* @brief Unused Result Warning Macro for DIFs.
*/
// Header Extern Guard (so header can be used from C and C++)
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
/**
* Attribute for functions which return errors that must be acknowledged.
*
* This attribute must be used to mark all DIFs which return an error value of
* some kind, to ensure that callers do not accidentally drop the error on the
* ground.
*/
#define DIF_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // OPENTITAN_SW_DEVICE_LIB_DIF_DIF_WARN_UNUSED_RESULT_H_
| // Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#ifndef OPENTITAN_SW_DEVICE_LIB_DIF_DIF_WARN_UNUSED_RESULT_H_
#define OPENTITAN_SW_DEVICE_LIB_DIF_DIF_WARN_UNUSED_RESULT_H_
/**
* @file
* @brief Unused Result Warning Macro for DIFs.
*/
// Header Extern Guard (so header can be used from C and C++)
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
/**
* Attribute for functions which return errors that must be acknowledged.
*
* This attribute must be used to mark all DIFs which return an error value of
* some kind, to ensure that callers do not accidentally drop the error on the
* ground.
*
* Normally, the standard way to drop such a value on the ground explicitly is
* with the syntax `(void)expr;`, in analogy with the behavior of C++'s
* `[[nodiscard]]` attribute.
* However, GCC does not implement this, so the idiom `if (expr) {}` should be
* used instead, for the time being.
* See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509.
*/
#define DIF_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // OPENTITAN_SW_DEVICE_LIB_DIF_DIF_WARN_UNUSED_RESULT_H_
| Add a comment explaining how to drop an error on the ground | [dif] Add a comment explaining how to drop an error on the ground
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509, which
necessitates doing this in a non-standard, but still portable, manner.
Signed-off-by: Miguel Young de la Sota <[email protected]>
| C | apache-2.0 | lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan |
1e7621d96cb9d0821c61db6f4e3ef36ddc19b0cd | tests/uncompress_fuzzer.c | tests/uncompress_fuzzer.c | /* Derived from zlib fuzzers at http://github.com/google/oss-fuzz/tree/master/projects/zlib,
* see ossfuzz.sh for full license text.
*/
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "miniz.h"
static unsigned char buffer[256 * 1024] = { 0 };
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
unsigned long int buffer_length = sizeof(buffer);
if (Z_OK != uncompress(buffer, &buffer_length, data, size)) return 0;
return 0;
}
| /* Derived from zlib fuzzers at http://github.com/google/oss-fuzz/tree/master/projects/zlib,
* see ossfuzz.sh for full license text.
*/
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "miniz.h"
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
unsigned long int buffer_length = 1;
unsigned char *buffer = NULL;
int z_status = 0;
if (size > 0)
buffer_length *= data[0];
if (size > 1)
buffer_length *= data[1];
buffer = (unsigned char *)malloc(buffer_length);
z_status = uncompress(buffer, &buffer_length, data, size);
free(buffer);
if (Z_OK != z_status)
return 0;
return 0;
}
| Use variable size input buffer in uncompress fuzzer. | Use variable size input buffer in uncompress fuzzer.
| C | mit | richgel999/miniz,richgel999/miniz,richgel999/miniz |
72d3d27dd2b4b15bba30f0b7a56a1255ee09fbdc | tests/regression/02-base/44-malloc_array.c | tests/regression/02-base/44-malloc_array.c | // PARAM: --set ana.int.interval true --enable exp.partition-arrays.enabled
#include<stdlib.h>
#include<assert.h>
int main(void) {
int *r = malloc(5 * sizeof(int));
r[3] = 2;
assert(r[4] == 2);
(* Here we only test our implementation. Concretely, accessing the uninitialised r[4] is undefined behavior.
In our implementation we keep the whole memory allocated by malloc as one Blob and the whole Blob contains 2 after it was assigned to r[3].
This is more useful than keeping the Blob unknown. *)
} | // PARAM: --set ana.int.interval true --enable exp.partition-arrays.enabled
#include<stdlib.h>
#include<assert.h>
int main(void) {
int *r = malloc(5 * sizeof(int));
r[3] = 2;
assert(r[4] == 2);
/* Here we only test our implementation. Concretely, accessing the uninitialised r[4] is undefined behavior.
In our implementation we keep the whole memory allocated by malloc as one Blob and the whole Blob contains 2 after it was assigned to r[3].
This is more useful than keeping the Blob unknown. */
} | Mark the comment in a proper C style | Mark the comment in a proper C style
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
75e54983b2b62ec12e7c62b42dd46b1dd7d3fd96 | brotherKH930.h | brotherKH930.h | #ifndef BROTHERKH930_H_
#define BROTHERKH930_H_
#import "position.h"
/** Pins unsed for interfacing with the BrotherKH930. */
struct PinSetup {
int encoderV1;
int encoderV2;
int encoderBP; // belt-phase
};
/** Pin setup as used by the KniticV2 PCB. */
PinSetup kniticV2Pins();
/**
* Interfact to a brother knitting machine KH930/940.
* The callback will be called on every event (position/direction change).
*/
class BrotherKH930 {
public:
BrotherKH930(const PinSetup pins, void (*callback)(void*), void* context);
int position();
Direction direction();
private:
static void positionCallback(void* context, int pos);
void onChange();
private:
Position *pos;
private:
void (*callback)(void*);
void* callbackContext;
};
#endif
| #ifndef BROTHERKH930_H_
#define BROTHERKH930_H_
#import "position.h"
/** Pins unsed for interfacing with the BrotherKH930. */
struct PinSetup {
int encoderV1;
int encoderV2;
int encoderBP; // belt-phase
};
/** Pin setup as used by the KniticV2 PCB. */
PinSetup kniticV2Pins();
/**
* Interfact to a brother knitting machine KH930/940.
* The callback will be called on every event (position/direction change). The
* callback might be called in a ISR.
*/
class BrotherKH930 {
public:
BrotherKH930(const PinSetup pins, void (*callback)(void*), void* context);
int position();
Direction direction();
private:
static void positionCallback(void* context, int pos);
void onChange();
private:
Position *pos;
private:
void (*callback)(void*);
void* callbackContext;
};
#endif
| Add comment regarding ISR in callback. | Add comment regarding ISR in callback.
| C | apache-2.0 | msiegenthaler/brotherKH930_arduino |
7c686661d65c63f6f518ca81830dd61bd64bfe1f | test/Analysis/uninit-vals-ps.c | test/Analysis/uninit-vals-ps.c | // RUN: clang -checker-simple -verify %s &&
// RUN: clang -checker-simple -analyzer-store-region -verify %s
struct FPRec {
void (*my_func)(int * x);
};
int bar(int x);
int f1_a(struct FPRec* foo) {
int x;
(*foo->my_func)(&x);
return bar(x)+1; // no-warning
}
int f1_b() {
int x;
return bar(x)+1; // expected-warning{{Pass-by-value argument in function is undefined.}}
}
int f2() {
int x;
if (x+1) // expected-warning{{Branch}}
return 1;
return 2;
}
int f2_b() {
int x;
return ((x+1)+2+((x))) + 1 ? 1 : 2; // expected-warning{{Branch}}
}
int f3(void) {
int i;
int *p = &i;
if (*p > 0) // expected-warning{{Branch condition evaluates to an uninitialized value}}
return 0;
else
return 1;
}
| // RUN: clang -checker-simple -verify %s &&
// RUN: clang -checker-simple -analyzer-store-region -verify %s
struct FPRec {
void (*my_func)(int * x);
};
int bar(int x);
int f1_a(struct FPRec* foo) {
int x;
(*foo->my_func)(&x);
return bar(x)+1; // no-warning
}
int f1_b() {
int x;
return bar(x)+1; // expected-warning{{Pass-by-value argument in function is undefined.}}
}
int f2() {
int x;
if (x+1) // expected-warning{{Branch}}
return 1;
return 2;
}
int f2_b() {
int x;
return ((x+1)+2+((x))) + 1 ? 1 : 2; // expected-warning{{Branch}}
}
int f3(void) {
int i;
int *p = &i;
if (*p > 0) // expected-warning{{Branch condition evaluates to an uninitialized value}}
return 0;
else
return 1;
}
int ret_uninit() {
int i;
int *p = &i;
return *p; // expected-warning{{Uninitialized or undefined return value returned to caller.}}
}
| Add checker test case: warn about returning an uninitialized value to the caller. | Add checker test case: warn about returning an uninitialized value to the caller.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@59765 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,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-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,apple/swift-clang |
dcd310e5c86b0a93ab79ac0940c936486106fb6a | osu.Framework/Resources/Shaders/sh_Utils.h | osu.Framework/Resources/Shaders/sh_Utils.h | #define GAMMA 2.2
vec4 toLinear(vec4 colour)
{
return vec4(pow(colour.rgb, vec3(GAMMA)), colour.a);
}
vec4 toSRGB(vec4 colour)
{
return vec4(pow(colour.rgb, vec3(1.0 / GAMMA)), colour.a);
} | #define GAMMA 2.4
float toLinear(float color)
{
return color <= 0.04045 ? (color / 12.92) : pow((color + 0.055) / 1.055, GAMMA);
}
vec4 toLinear(vec4 colour)
{
return vec4(toLinear(colour.r), toLinear(colour.g), toLinear(colour.b), colour.a);
}
float toSRGB(float color)
{
return color < 0.0031308 ? (12.92 * color) : (1.055 * pow(color, 1.0 / GAMMA) - 0.055);
}
vec4 toSRGB(vec4 colour)
{
return vec4(toSRGB(colour.r), toSRGB(colour.g), toSRGB(colour.b), colour.a);
// The following implementation using mix and step may be faster, but stackoverflow indicates it is in fact a lot slower on some GPUs.
//return vec4(mix(colour.rgb * 12.92, 1.055 * pow(colour.rgb, vec3(1.0 / GAMMA)) - vec3(0.055), step(0.0031308, colour.rgb)), colour.a);
} | Convert to sRGB based on the appropriate formulas instead of an approximiate 2.2 gamma correction. | Convert to sRGB based on the appropriate formulas instead of an approximiate 2.2 gamma correction.
| C | mit | EVAST9919/osu-framework,naoey/osu-framework,ZLima12/osu-framework,naoey/osu-framework,paparony03/osu-framework,Nabile-Rahmani/osu-framework,default0/osu-framework,DrabWeb/osu-framework,peppy/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,DrabWeb/osu-framework,RedNesto/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,DrabWeb/osu-framework,Tom94/osu-framework,paparony03/osu-framework,peppy/osu-framework,ppy/osu-framework,Nabile-Rahmani/osu-framework,Tom94/osu-framework,ppy/osu-framework,RedNesto/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,default0/osu-framework |
73499d78a98dd162f774d1be8f6bb0cc10229b92 | include/lldb/Host/Endian.h | include/lldb/Host/Endian.h | //===-- Endian.h ------------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_host_endian_h_
#define liblldb_host_endian_h_
#include "lldb/lldb-enumerations.h"
namespace lldb {
namespace endian {
static union EndianTest
{
uint32_t num;
uint8_t bytes[sizeof(uint32_t)];
} const endianTest = { (uint16_t)0x01020304 };
inline ByteOrder InlHostByteOrder() { return (ByteOrder)endianTest.bytes[0]; }
// ByteOrder const InlHostByteOrder = (ByteOrder)endianTest.bytes[0];
}
}
#endif // liblldb_host_endian_h_
| //===-- Endian.h ------------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_host_endian_h_
#define liblldb_host_endian_h_
#include "lldb/lldb-enumerations.h"
namespace lldb {
namespace endian {
static union EndianTest
{
uint32_t num;
uint8_t bytes[sizeof(uint32_t)];
} const endianTest = { 0x01020304 };
inline ByteOrder InlHostByteOrder() { return (ByteOrder)endianTest.bytes[0]; }
// ByteOrder const InlHostByteOrder = (ByteOrder)endianTest.bytes[0];
}
}
#endif // liblldb_host_endian_h_
| Fix endian test for big-endian hosts | Fix endian test for big-endian hosts
The uint16_t cast truncated the magic value to 0x00000304, making the
first byte 0 (eByteOrderInvalid) on big endian hosts.
Reported by Justin Hibbits.
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@213861 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb |
0b073b52fd838984f2ee34095627b5e95d863c3e | JPetReaderInterface/JPetReaderInterface.h | JPetReaderInterface/JPetReaderInterface.h | /**
* @copyright Copyright 2016 The J-PET Framework Authors. All rights reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may find a copy of the License in the LICENCE file.
*
* 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.
*
* @file JPetReaderInterface.h
*/
#ifndef JPETREADERINTERFACE_H
#define JPETREADERINTERFACE_H
#include <TNamed.h> // for Event typedef
class JPetReaderInterface {
public:
typedef TObject MyEvent;
virtual ~JPetReaderInterface() {;}
virtual MyEvent& getCurrentEvent()=0;
virtual bool nextEvent()=0;
virtual bool firstEvent()=0;
virtual bool lastEvent()=0;
virtual bool nthEvent(int n)=0;
virtual long long getCurrentEventNumber() const =0;
virtual long long getNbOfAllEvents() const =0;
virtual TObject* getObjectFromFile(const char* name)=0;
virtual bool openFileAndLoadData(const char* filename, const char* treename)=0;
virtual void closeFile()=0;
};
#endif /* !JPETREADERINTERFACE_H */
| /**
* @copyright Copyright 2016 The J-PET Framework Authors. All rights reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may find a copy of the License in the LICENCE file.
*
* 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.
*
* @file JPetReaderInterface.h
*/
#ifndef JPETREADERINTERFACE_H
#define JPETREADERINTERFACE_H
#include <TNamed.h> // for Event typedef
class JPetReaderInterface {
public:
typedef TObject MyEvent;
virtual ~JPetReaderInterface() {;}
virtual MyEvent& getCurrentEvent()=0;
virtual bool nextEvent()=0;
virtual bool firstEvent()=0;
virtual bool lastEvent()=0;
virtual bool nthEvent(long long int n)=0;
virtual long long getCurrentEventNumber() const =0;
virtual long long getNbOfAllEvents() const =0;
virtual TObject* getObjectFromFile(const char* name)=0;
virtual bool openFileAndLoadData(const char* filename, const char* treename)=0;
virtual void closeFile()=0;
};
#endif /* !JPETREADERINTERFACE_H */
| Change int to long long | Change int to long long
| C | apache-2.0 | wkrzemien/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework |
ac843efe7bcdc94edf442b210ff70dddc486576e | Problem031/C/solution_1.c | Problem031/C/solution_1.c | /*
* =====================================================================================
*
* Copyright 2015 Manoel Vilela
*
*
* Filename: solution_1.c
*
* Description: Solution for Problem031 of ProjectEuler
*
* Author: Manoel Vilela
* Contact: [email protected]
* Organization: UFPA
* Perfomance: 0.02s | Intel E7400 @ 3.5Ghz
*
* =====================================================================================
**/
#include <stdio.h>
#define N_COINS 8
int different_ways(int money, int *coins, int n_coins) {
int max_coin = money / (*coins);
int n, ways = 0;
for (n = 0; n <= max_coin; n++) {
int new_money = (*coins) * n;
if (n_coins > 1 && new_money < money)
ways += different_ways(money - new_money, coins + 1, n_coins - 1);
if (new_money == money) {
ways++;
break;
}
}
return ways;
}
int main(int argc, char **argv){
int coins[N_COINS] = {200, 100, 50, 20, 10, 5, 2, 1};
int money = 200;
int answer = different_ways(money, coins, N_COINS);
printf("%d\n", answer);
return 0;
} | /*
* =====================================================================================
*
* Copyright 2015 Manoel Vilela
*
*
* Filename: solution_1.c
*
* Description: Solution for Problem031 of ProjectEuler
*
* Author: Manoel Vilela
* Contact: [email protected]
* Organization: UFPA
* Perfomance: 0.02s | Intel E7400 @ 3.5Ghz
*
* =====================================================================================
**/
#include <stdio.h>
int different_ways(int money, int *coins, int n_coins) {
int max_coin = money / (*coins);
int n, ways = 0;
for (n = 0; n <= max_coin; n++) {
int new_money = (*coins) * n;
if (n_coins > 1 && new_money < money)
ways += different_ways(money - new_money, coins + 1, n_coins - 1);
if (new_money == money) {
ways++;
break;
}
}
return ways;
}
int main(int argc, char **argv){
int coins[] = {200, 100, 50, 20, 10, 5, 2, 1};
int lenght = sizeof(coins) / sizeof(int);
int money = 200;
int answer = different_ways(money, coins, lenght);
printf("%d\n", answer);
return 0;
} | Remove the unecessary macro N_COINS to sizeof-way | Remove the unecessary macro N_COINS to sizeof-way
| C | mit | DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler |
b4e508eccf76d11287a40698c2484ab592446cee | ir/be/test/fehler24.c | ir/be/test/fehler24.c | /* The tarval module fails to negate the constant and returns TV_OVERFLOW_BAD
* when optimising the comparison (-x < 0 -> x > 0). It is not expected that
* the negation fails and an assertion while constructing the negated constant
* is triggered */
int f(double x)
{
return -x < 0;
}
int main(void)
{
return 0;
}
| Add a test case where the tarval module generates an unexpected result. | Add a test case where the tarval module generates an unexpected result.
[r14777]
| C | lgpl-2.1 | 8l/libfirm,MatzeB/libfirm,davidgiven/libfirm,killbug2004/libfirm,killbug2004/libfirm,davidgiven/libfirm,8l/libfirm,jonashaag/libfirm,davidgiven/libfirm,davidgiven/libfirm,8l/libfirm,8l/libfirm,killbug2004/libfirm,davidgiven/libfirm,libfirm/libfirm,jonashaag/libfirm,jonashaag/libfirm,libfirm/libfirm,8l/libfirm,libfirm/libfirm,davidgiven/libfirm,MatzeB/libfirm,jonashaag/libfirm,libfirm/libfirm,jonashaag/libfirm,killbug2004/libfirm,MatzeB/libfirm,8l/libfirm,8l/libfirm,killbug2004/libfirm,davidgiven/libfirm,killbug2004/libfirm,MatzeB/libfirm,libfirm/libfirm,MatzeB/libfirm,MatzeB/libfirm,MatzeB/libfirm,jonashaag/libfirm,killbug2004/libfirm,jonashaag/libfirm |
|
8da42ceabc214f68ef11c95249e6e2519c58ae06 | Classes/MoveAbleElemBaseFactory.h | Classes/MoveAbleElemBaseFactory.h | #pragma once
#include "cocos2d.h"
#include "MoveAbleElem.h"
class MoveAbleElemBaseFactory :public cocos2d::Ref
{
protected:
MoveAbleElemBaseFactory() { ; }
public:
virtual ~MoveAbleElemBaseFactory()
{
}
virtual bool init()
{
return true;
}
static MoveAbleElemBaseFactory * create()
{
return nullptr;
}
virtual MoveAbleElem * getMoveAbleElem()
{
return nullptr;
}
virtual void recycleElem(MoveAbleElem * pElem)
{
}
protected:
cocos2d::Vector<MoveAbleElem *> _vUsedElem;
cocos2d::Vector<MoveAbleElem *> _vReadyElem;
private:
};
| Add base factory to produce moveAbleElem | Add base factory to produce moveAbleElem
| C | mit | wjingzhe/A_ParkourJingz,wjingzhe/ParkourJingz,wjingzhe/A_ParkourJingz,wjingzhe/ParkourJingz,wjingzhe/A_ParkourJingz,wjingzhe/ParkourJingz,wjingzhe/ParkourJingz,wjingzhe/A_ParkourJingz,wjingzhe/ParkourJingz,wjingzhe/ParkourJingz,wjingzhe/A_ParkourJingz,wjingzhe/A_ParkourJingz |
|
e0c8d7bc0a14d5b7fb6b528c10b8462eacc18f0e | src/api-mock.h | src/api-mock.h | #ifndef APIMOCK_H
#define APIMOCK_H
#include "core/exceptions.h"
#include "http/httpserver.h"
#include "http/requestdata.h"
#include "http/requestdata.h"
#include "http/statuscodes.h"
#include "routing/routedresourcestrategy.h"
#endif | #ifndef APIMOCK_H
#define APIMOCK_H
#include "core/exceptions.h"
#include "http/httpserver.h"
#include "http/requestdata.h"
#include "http/requestdata.h"
#include "http/statuscodes.h"
#include "routing/config.h"
#include "routing/routedresourcestrategy.h"
#endif | Include route configuration file in main header | Include route configuration file in main header
| C | mit | Lavesson/api-mock,Lavesson/api-mock,Lavesson/api-mock,Lavesson/api-mock |
fb535ccb30845fe0b7bd09caa37a838985b72ff9 | arch/x86/entry/vdso/vdso32/vclock_gettime.c | arch/x86/entry/vdso/vdso32/vclock_gettime.c | #define BUILD_VDSO32
#ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE
#undef CONFIG_OPTIMIZE_INLINING
#endif
#undef CONFIG_X86_PPRO_FENCE
#ifdef CONFIG_X86_64
/*
* in case of a 32 bit VDSO for a 64 bit kernel fake a 32 bit kernel
* configuration
*/
#undef CONFIG_64BIT
#undef CONFIG_X86_64
#undef CONFIG_ILLEGAL_POINTER_VALUE
#undef CONFIG_SPARSEMEM_VMEMMAP
#undef CONFIG_NR_CPUS
#define CONFIG_X86_32 1
#define CONFIG_PAGE_OFFSET 0
#define CONFIG_ILLEGAL_POINTER_VALUE 0
#define CONFIG_NR_CPUS 1
#define BUILD_VDSO32_64
#endif
#include "../vclock_gettime.c"
| #define BUILD_VDSO32
#ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE
#undef CONFIG_OPTIMIZE_INLINING
#endif
#undef CONFIG_X86_PPRO_FENCE
#ifdef CONFIG_X86_64
/*
* in case of a 32 bit VDSO for a 64 bit kernel fake a 32 bit kernel
* configuration
*/
#undef CONFIG_64BIT
#undef CONFIG_X86_64
#undef CONFIG_PGTABLE_LEVELS
#undef CONFIG_ILLEGAL_POINTER_VALUE
#undef CONFIG_SPARSEMEM_VMEMMAP
#undef CONFIG_NR_CPUS
#define CONFIG_X86_32 1
#define CONFIG_PGTABLE_LEVELS 2
#define CONFIG_PAGE_OFFSET 0
#define CONFIG_ILLEGAL_POINTER_VALUE 0
#define CONFIG_NR_CPUS 1
#define BUILD_VDSO32_64
#endif
#include "../vclock_gettime.c"
| Define PGTABLE_LEVELS to 32bit VDSO | x86/vdso32: Define PGTABLE_LEVELS to 32bit VDSO
In case of CONFIG_X86_64, vdso32/vclock_gettime.c fakes a 32-bit
non-PAE kernel configuration by re-defining it to CONFIG_X86_32.
However, it does not re-define CONFIG_PGTABLE_LEVELS leaving it
as 4 levels.
This mismatch leads <asm/pgtable_type.h> to NOT include <asm-generic/
pgtable-nopud.h> and <asm-generic/pgtable-nopmd.h>, which will cause
compile errors when a later patch enhances <asm/pgtable_type.h> to
use PUD_SHIFT and PMD_SHIFT. These -nopud & -nopmd headers define
these SHIFTs for the 32-bit non-PAE kernel.
Fix it by re-defining CONFIG_PGTABLE_LEVELS to 2 levels.
Signed-off-by: Toshi Kani <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Juergen Gross <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Konrad Wilk <[email protected]>
Cc: Robert Elliot <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/1442514264-12475-2-git-send-email-322b9f75d3806917607539efc168804d71b9503d@hpe.com
Signed-off-by: Thomas Gleixner <[email protected]>
| C | mit | KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs |
eff55937ab190391534fc00c0f2c8760728ddb4e | Parser/pgen.h | Parser/pgen.h | /***********************************************************
Copyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The
Netherlands.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior permission.
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
/* Parser generator interface */
extern grammar gram;
extern grammar *meta_grammar PROTO((void));
extern grammar *pgen PROTO((struct _node *));
| /***********************************************************
Copyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The
Netherlands.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior permission.
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
/* Parser generator interface */
extern grammar gram;
extern grammar *meta_grammar PROTO((void));
struct _node;
extern grammar *pgen PROTO((struct _node *));
| Add declaration of struct _node, for scoping reasons. | Add declaration of struct _node, for scoping reasons.
| C | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator |
8801070251ffe70e28e6937b74ccbd57a984c2bc | src/rtpp_ucl.h | src/rtpp_ucl.h | /*
* Copyright (c) 2018 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.
*
*/
/*
* Config parser helper callback function pointer alias
*/
typedef bool (*conf_helper_func)(const ucl_object_t *, const ucl_object_t *,
void *);
/*
* Config parser helper callback map. Maps UCL keys to callback functions that
* parse the key and store the value in the correct struct member
*/
typedef struct conf_helper_callback_map {
const char *conf_key;
conf_helper_func callback;
} conf_helper_map;
struct conf_entry;
bool rtpp_ucl_set_unknown(const ucl_object_t *top,
const ucl_object_t *obj, struct conf_entry *target __unused);
| Add some UCL-related definitions to be shared by the RTPP code. | Add some UCL-related definitions to be shared by the RTPP code.
| C | bsd-2-clause | dsanders11/rtpproxy,dsanders11/rtpproxy,sippy/rtpproxy,sippy/rtpproxy,sippy/rtpproxy,dsanders11/rtpproxy |
|
9c07822b7768dc2974608b3e7501885ab73edfb0 | OctoKit/OCTCommitComment.h | OctoKit/OCTCommitComment.h | //
// OCTCommitComment.h
// OctoKit
//
// Created by Justin Spahr-Summers on 2012-10-02.
// Copyright (c) 2012 GitHub. All rights reserved.
//
#import "OCTObject.h"
// A single comment on a commit.
@interface OCTCommitComment : OCTObject
// The webpage URL for this comment.
@property (nonatomic, copy, readonly) NSURL *HTMLURL;
// The SHA of the commit being commented upon.
@property (nonatomic, copy, readonly) NSString *commitSHA;
// The login of the user who created this comment.
@property (nonatomic, copy, readonly) NSString *commenterLogin;
// The path of the file being commented on.
@property (nonatomic, copy, readonly) NSString *path;
// The body of the commit comment.
@property (nonatomic, copy, readonly) NSString *body;
// The line index in the commit's diff.
@property (nonatomic, copy, readonly) NSNumber *position;
@end
| //
// OCTCommitComment.h
// OctoKit
//
// Created by Justin Spahr-Summers on 2012-10-02.
// Copyright (c) 2012 GitHub. All rights reserved.
//
#import "OCTObject.h"
// A single comment on a commit.
@interface OCTCommitComment : OCTObject
// The webpage URL for this comment.
@property (nonatomic, copy, readonly) NSURL *HTMLURL;
// The SHA of the commit being commented upon.
@property (nonatomic, copy, readonly) NSString *commitSHA;
// The login of the user who created this comment.
@property (nonatomic, copy, readonly) NSString *commenterLogin;
// The path of the file being commented on.
@property (nonatomic, copy, readonly) NSString *path;
// The body of the commit comment.
@property (nonatomic, copy, readonly) NSString *body;
// The line index in the commit's diff. This will be nil if the comment refers
// to the entire commit.
@property (nonatomic, copy, readonly) NSNumber *position;
@end
| Document why position can be nil. | Document why position can be nil.
| C | mit | jonesgithub/octokit.objc,CHNLiPeng/octokit.objc,phatblat/octokit.objc,xantage/octokit.objc,GroundControl-Solutions/octokit.objc,Acidburn0zzz/octokit.objc,yeahdongcn/octokit.objc,daukantas/octokit.objc,phatblat/octokit.objc,leichunfeng/octokit.objc,leichunfeng/octokit.objc,cnbin/octokit.objc,CleanShavenApps/octokit.objc,daemonchen/octokit.objc,cnbin/octokit.objc,jonesgithub/octokit.objc,wrcj12138aaa/octokit.objc,wrcj12138aaa/octokit.objc,xantage/octokit.objc,Palleas/octokit.objc,daukantas/octokit.objc,Acidburn0zzz/octokit.objc,CHNLiPeng/octokit.objc,GroundControl-Solutions/octokit.objc,Palleas/octokit.objc,daemonchen/octokit.objc |
52bbfee69929a102437015caf625a1a79ffe21b1 | arch/mips/common/include/arch.h | arch/mips/common/include/arch.h | /*
Copyright (c) 2016, prpl Foundation
Permission to use, copy, modify, and/or distribute this software for any purpose with or without
fee is hereby granted, provided that the above copyright notice and this permission notice appear
in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
This code was written by Carlos Moratelli at Embedded System Group (GSE) at PUCRS/Brazil.
*/
#ifndef __ARCH_H
#define __ARCH_H
#include <baikal-t1.h>
#endif
| /*
Copyright (c) 2016, prpl Foundation
Permission to use, copy, modify, and/or distribute this software for any purpose with or without
fee is hereby granted, provided that the above copyright notice and this permission notice appear
in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
This code was written by Carlos Moratelli at Embedded System Group (GSE) at PUCRS/Brazil.
*/
#ifndef __ARCH_H
#define __ARCH_H
#include <pic32mz.h>
#endif
| Fix compilation error for pic32mz platform. | Fix compilation error for pic32mz platform.
| C | isc | prplfoundation/prpl-hypervisor,prplfoundation/prpl-hypervisor,prplfoundation/prpl-hypervisor,prplfoundation/prpl-hypervisor,prplfoundation/prpl-hypervisor,prplfoundation/prpl-hypervisor |
2b6d2c0d5992d240fe52e171967e8c1a176b3265 | CookieCrunchAdventure/CookieCrunchAdventure/CookieCrunchAdventure-Bridging-Header.h | CookieCrunchAdventure/CookieCrunchAdventure/CookieCrunchAdventure-Bridging-Header.h | //Skillz dependencies.
#import <MobileCoreServices/MobileCoreServices.h>
#import <PassKit/PassKit.h>
#import <MediaPlayer/MediaPlayer.h>
#import <MessageUI/MessageUI.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <Social/Social.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import <StoreKit/StoreKit.h>
#import <Accounts/Accounts.h>
//Skillz framework.
#import <SkillzSDK-iOS/SKillz.h> | //Skillz dependencies.
#import <MobileCoreServices/MobileCoreServices.h>
#import <PassKit/PassKit.h>
#import <MediaPlayer/MediaPlayer.h>
#import <MessageUI/MessageUI.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <Social/Social.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import <StoreKit/StoreKit.h>
#import <Accounts/Accounts.h>
//Skillz framework.
#import <SkillzSDK-iOS/Skillz.h>
| Fix typo in Skillz bridging header | Fix typo in Skillz bridging header | C | mit | heyx3/Cookie-Crunch-Adventure |
f97b814a589446e5d3481124f56ddb91708fd000 | src/tp_qi.in.h | src/tp_qi.in.h |
//Eventloop->post (with delay = 0)
TRACEPOINT_EVENT(qi_qi, eventloop_post,
TP_ARGS(unsigned int, taskId,
const char*, typeName),
TP_FIELDS(ctf_integer(int, taskId, taskId)
ctf_string(typeName, typeName)
)
)
//Eventloop->async && post with delay
TRACEPOINT_EVENT(qi_qi, eventloop_delay,
TP_ARGS(unsigned int, taskId,
const char*, typeName,
unsigned int, usDelay),
TP_FIELDS(ctf_integer(int, taskId, taskId)
ctf_string(typeName, typeName)
ctf_integer(int, usDelay, usDelay))
)
//task really start
TRACEPOINT_EVENT(qi_qi, eventloop_task_start,
TP_ARGS(unsigned int, taskId),
TP_FIELDS(ctf_integer(int, taskId, taskId))
)
//task stop
TRACEPOINT_EVENT(qi_qi, eventloop_task_stop,
TP_ARGS(unsigned int, taskId),
TP_FIELDS(ctf_integer(int, taskId, taskId))
)
//task has been cancelled before running
TRACEPOINT_EVENT(qi_qi, eventloop_task_cancel,
TP_ARGS(unsigned int, taskId),
TP_FIELDS(ctf_integer(int, taskId, taskId))
)
|
//Eventloop->post (with delay = 0)
TRACEPOINT_EVENT(qi_qi, eventloop_post,
TP_ARGS(unsigned int, taskId,
const char*, typeName),
TP_FIELDS(ctf_integer(int, taskId, taskId)
ctf_string(typeName, typeName)
)
)
//Eventloop->async && post with delay
TRACEPOINT_EVENT(qi_qi, eventloop_delay,
TP_ARGS(unsigned int, taskId,
const char*, typeName,
unsigned int, usDelay),
TP_FIELDS(ctf_integer(int, taskId, taskId)
ctf_string(typeName, typeName)
ctf_integer(int, usDelay, usDelay))
)
//task really start
TRACEPOINT_EVENT(qi_qi, eventloop_task_start,
TP_ARGS(unsigned int, taskId),
TP_FIELDS(ctf_integer(int, taskId, taskId))
)
//task stop
TRACEPOINT_EVENT(qi_qi, eventloop_task_stop,
TP_ARGS(unsigned int, taskId),
TP_FIELDS(ctf_integer(int, taskId, taskId))
)
//task has been cancelled before running
TRACEPOINT_EVENT(qi_qi, eventloop_task_cancel,
TP_ARGS(unsigned int, taskId),
TP_FIELDS(ctf_integer(int, taskId, taskId))
)
//task has been set on error
TRACEPOINT_EVENT(qi_qi, eventloop_task_error,
TP_ARGS(unsigned int, taskId),
TP_FIELDS(ctf_integer(int, taskId, taskId))
)
| Fix compilation of eventloop with probes | Fix compilation of eventloop with probes
Change-Id: Ia885584363de9070200a53acd80d48e3cbeda6fe
Reviewed-on: http://gerrit.aldebaran.lan/48421
Approved: hcuche <[email protected]>
Reviewed-by: hcuche <[email protected]>
Tested-by: hcuche <[email protected]>
| C | bsd-3-clause | aldebaran/libqi,bsautron/libqi,vbarbaresi/libqi,aldebaran/libqi,aldebaran/libqi |
751661b79fcdf36dbb229d704f92b68ab4e62ccc | tests/regression/04-mutex/72-memset_arg_rc.c | tests/regression/04-mutex/72-memset_arg_rc.c | #include <pthread.h>
#include <stdio.h>
#include <string.h>
int g;
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
g++; // RACE!
return NULL;
}
int main(void) {
int x;
pthread_t id;
pthread_create(&id, NULL, t_fun, NULL);
memset(&x, g, sizeof(int)); // RACE!
pthread_join (id, NULL);
return 0;
}
| Add test with immediate int arg read access | Add test with immediate int arg read access
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
3572bcf5c029534b21a2fe61665eacd26380f010 | chapter27/chapter27_ex01.c | chapter27/chapter27_ex01.c | /* Chapter 27, exercise 1: implement versions of strlen(), strcmp() and strcpy()
*/
#include<stddef.h>
#include<stdio.h>
size_t strlen(const char* s)
{
size_t len = 0;
while (*s++) ++len;
return len;
}
int strcmp(const char* s1, const char* s2)
{
const char* p1 = s1;
const char* p2 = s2;
while (*p1 && *p2 && *p1==*p2) {
++p1;
++p2;
}
if (*p1 > *p2)
return 1;
else if (*p1 < *p2)
return -1;
else /* *p1 == *p2 */
return 0;
}
char* strcpy(char* s1, const char* s2)
{
char* p = s1;
while (*s1++ = *s2++);
return p;
}
void test_strcmp(const char* s1, const char* s2)
{
int res = strcmp(s1,s2);
if (res == 0)
printf("'%s' and '%s' are equal\n",s1,s2);
else if (res < 0)
printf("'%s' is before '%s'\n",s1,s2);
else /* res > 0 */
printf("'%s' is after '%s'\n",s1,s2);
}
void test_strcpy(char* s1, const char* s2)
{
printf("Copy '%s' into '%s: ",s2,s1);
strcpy(s1,s2);
printf("%s\n",s1);
}
int main()
{
char* s1 = "This is a string";
size_t l1 = strlen(s1);
printf("Length of '%s': %i\n",s1,l1);
printf("Length of '': %i\n",strlen(""));
printf("\n");
char* s2_1 = "abc";
test_strcmp(s2_1,s2_1);
test_strcmp(s2_1,"");
test_strcmp("",s2_1);
test_strcmp("","");
char* s2_2 = "abcd";
test_strcmp(s2_1,s2_2);
test_strcmp(s2_2,s2_1);
char* s2_3 = "abd";
test_strcmp(s2_2,s2_3);
test_strcmp(s2_1,s2_3);
printf("\n");
char* s3_1 = "ABC";
char* s3_2 = "abc";
char* s3_3 = "ABCD";
test_strcpy(s3_1,s3_2);
test_strcpy(s3_3,s3_2);
test_strcpy(s3_1,"");
test_strcpy("","");
}
| Add Chapter 27, exercise 1 | Add Chapter 27, exercise 1
| C | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp |
|
e9296d41b3b8dd5ecd78597beec0b2caf3ea2648 | include/utilities.h | include/utilities.h | #ifndef UTILITIES_HLT
#define UTILITIES_HLT
#include <deal.II/base/utilities.h>
#include <deal.II/base/smartpointer.h>
#include <typeinfo>
#include <cxxabi.h>
using namespace dealii;
/**
* SmartPointers are usually not used to point to objects created with
* new. However, sometimes this is useful. The distruction of a
* SmartPointer requires to split the step in two parts. This little
* utility does precisely this.
*/
template <typename TYPE>
void smart_delete (SmartPointer<TYPE> &sp) {
if(sp) {
TYPE * p = sp;
sp = 0;
delete p;
}
}
// Anonymous namespace, to hide implementation detail for the type
// function below
namespace {
struct handle {
char* p;
handle(char* ptr) : p(ptr) { }
~handle() {
std::free(p);
}
};
std::string demangle(const char* name) {
int status = -4; // some arbitrary value to eliminate the compiler warning
handle result( abi::__cxa_demangle(name, NULL, NULL, &status) );
return (status==0) ? result.p : name ;
};
}
/**
* Return a human readable name of the type passed as argument.
*/
template <class T>
std::string type(const T& t) {
return demangle(typeid(t).name());
};
#endif
| #ifndef UTILITIES_HLT
#define UTILITIES_HLT
#include <deal.II/base/utilities.h>
#include <deal.II/base/smartpointer.h>
#include <typeinfo>
#include <cxxabi.h>
using namespace dealii;
/**
* SmartPointers are usually not used to point to objects created with
* new. However, sometimes this is useful. The distruction of a
* SmartPointer requires to split the step in two parts. This little
* utility does precisely this.
*/
template <typename TYPE>
void smart_delete (SmartPointer<TYPE> &sp) {
if(sp) {
TYPE * p = sp;
sp = 0;
delete p;
}
}
// Anonymous namespace, to hide implementation detail for the type
// function below
namespace {
struct handle {
char* p;
handle(char* ptr) : p(ptr) { }
~handle() {
delete p;
}
};
std::string demangle(const char* name) {
int status = -4; // some arbitrary value to eliminate the compiler warning
handle result( abi::__cxa_demangle(name, NULL, NULL, &status) );
return (status==0) ? result.p : name ;
};
}
/**
* Return a human readable name of the type passed as argument.
*/
template <class T>
std::string type(const T& t) {
return demangle(typeid(t).name());
};
#endif
| Put delete instead of free | Put delete instead of free
| C | lgpl-2.1 | asartori86/dealii-sak,luca-heltai/deal2lkit,luca-heltai/dealii-sak,luca-heltai/dealii-sak,mathLab/deal2lkit,asartori86/deal2lkit,fsalmoir/dealii-sak,luca-heltai/deal2lkit,nicola-giuliani/dealii-sak,asartori86/dealii-sak,mathLab/deal2lkit,asartori86/deal2lkit,nicola-giuliani/dealii-sak,fsalmoir/dealii-sak |
eb4125b28743ceb509c2d2b1f196adeecdccfca0 | source/gloperate/include/gloperate/capabilities/AbstractTypedRenderTargetCapability.h | source/gloperate/include/gloperate/capabilities/AbstractTypedRenderTargetCapability.h | /******************************************************************************\
* gloperate
*
* Copyright (C) 2014 Computer Graphics Systems Group at the
* Hasso-Plattner-Institut (HPI), Potsdam, Germany.
\******************************************************************************/
#pragma once
#include <gloperate/gloperate_api.h>
#include <gloperate/capabilities/AbstractCapability.h>
#include <gloperate/base/RenderTarget.h>
namespace gloperate {
enum class RenderTargetType {
Color,
Depth,
Normal,
Geometry
};
/**
* @brief
*
*/
class GLOPERATE_API AbstractTypedRenderTargetCapability : public AbstractCapability
{
public:
/**
* @brief
* Constructor
*/
AbstractTypedRenderTargetCapability();
/**
* @brief
* Destructor
*/
virtual ~AbstractTypedRenderTargetCapability();
virtual const RenderTarget & renderTarget(RenderTargetType type) = 0;
virtual bool hasRenderTarget(RenderTargetType type) = 0;
protected:
};
} // namespace gloperate
| /******************************************************************************\
* gloperate
*
* Copyright (C) 2014 Computer Graphics Systems Group at the
* Hasso-Plattner-Institut (HPI), Potsdam, Germany.
\******************************************************************************/
#pragma once
#include <gloperate/gloperate_api.h>
#include <gloperate/capabilities/AbstractCapability.h>
#include <gloperate/base/RenderTarget.h>
namespace gloperate {
enum class RenderTargetType {
Color,
Depth,
Normal,
Geometry,
ObjectID
};
/**
* @brief
*
*/
class GLOPERATE_API AbstractTypedRenderTargetCapability : public AbstractCapability
{
public:
/**
* @brief
* Constructor
*/
AbstractTypedRenderTargetCapability();
/**
* @brief
* Destructor
*/
virtual ~AbstractTypedRenderTargetCapability();
virtual const RenderTarget & renderTarget(RenderTargetType type) = 0;
virtual bool hasRenderTarget(RenderTargetType type) = 0;
protected:
};
} // namespace gloperate
| Add ObjectID to RenderTargetType enum | Add ObjectID to RenderTargetType enum
| C | mit | Beta-Alf/gloperate,lanice/gloperate,Beta-Alf/gloperate,j-o/gloperate,lanice/gloperate,j-o/gloperate,j-o/gloperate,cginternals/gloperate,j-o/gloperate,lanice/gloperate,Beta-Alf/gloperate,p-otto/gloperate,lanice/gloperate,cginternals/gloperate,hpi-r2d2/gloperate,hpicgs/gloperate,Beta-Alf/gloperate,p-otto/gloperate,lanice/gloperate,p-otto/gloperate,hpicgs/gloperate,hpicgs/gloperate,p-otto/gloperate,hpi-r2d2/gloperate,hpicgs/gloperate,p-otto/gloperate,cginternals/gloperate,cginternals/gloperate,hpicgs/gloperate,Beta-Alf/gloperate |
692bb0259b4d9c988841919116dbb8e5216d3b5a | system/platforms/arm-qemu/platform-local.h | system/platforms/arm-qemu/platform-local.h | /**
* @file platform-local.h
*
*/
#ifndef _ARM_QEMU_PLATFORM_LOCAL_H
#define _ARM_QEMU_PLATFORM_LOCAL_H
/*
* The fluke-arm platform has so little memory that the global default
* of 64k for INITSTK is too big. Try something more conservativer.
*/
#define INITSTK (1337)
#endif /* _ARM_QEMU_PLATFORM_LOCAL_H */
| /**
* @file platform-local.h
*
*/
#ifndef _ARM_QEMU_PLATFORM_LOCAL_H
#define _ARM_QEMU_PLATFORM_LOCAL_H
#endif /* _ARM_QEMU_PLATFORM_LOCAL_H */
| Use the default stack size | arm-qeum: Use the default stack size
Because we have a lot more ram than the fluke-arm port had, we can
afford to use the default platform-independent stack size.
| C | bsd-3-clause | robixnai/xinu-arm,robixnai/xinu-arm,robixnai/xinu-arm |
07b877eb5d542876043969148593b456ff1187be | include/llvm/Transforms/PrintModulePass.h | include/llvm/Transforms/PrintModulePass.h | //===- llvm/Transforms/PrintModulePass.h - Printing Pass ---------*- C++ -*--=//
//
// This file defines a simple pass to print out methods of a module as they are
// processed.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TRANSFORMS_PRINTMODULE_H
#define LLVM_TRANSFORMS_PRINTMODULE_H
#include "llvm/Transforms/Pass.h"
#include "llvm/Assembly/Writer.h"
class PrintModulePass : public Pass {
string Banner; // String to print before each method
ostream *Out; // ostream to print on
bool DeleteStream; // Delete the ostream in our dtor?
public:
inline PrintModulePass(const string &B, ostream *o = &cout, bool DS = false)
: Banner(B), Out(o), DeleteStream(DS) {}
~PrintModulePass() {
if (DeleteStream) delete Out;
}
// doPerMethodWork - This pass just prints a banner followed by the method as
// it's processed.
//
bool doPerMethodWork(Method *M) {
(*Out) << Banner << M;
return false;
}
};
#endif
| //===- llvm/Transforms/PrintModulePass.h - Printing Pass ---------*- C++ -*--=//
//
// This file defines a simple pass to print out methods of a module as they are
// processed.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TRANSFORMS_PRINTMODULE_H
#define LLVM_TRANSFORMS_PRINTMODULE_H
#include "llvm/Transforms/Pass.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/Bytecode/Writer.h"
class PrintModulePass : public Pass {
string Banner; // String to print before each method
ostream *Out; // ostream to print on
bool DeleteStream; // Delete the ostream in our dtor?
bool PrintAsBytecode; // Print as bytecode rather than assembly?
public:
inline PrintModulePass(const string &B, ostream *o = &cout, bool DS = false,
bool printAsBytecode = false)
: Banner(B), Out(o), DeleteStream(DS), PrintAsBytecode(printAsBytecode) {}
~PrintModulePass() {
if (DeleteStream) delete Out;
}
// doPerMethodWork - This pass just prints a banner followed by the method as
// it's processed.
//
bool doPerMethodWork(Method *M) {
if (! PrintAsBytecode)
(*Out) << Banner << M;
return false;
}
// doPassFinalization - Virtual method overriden by subclasses to do any post
// processing needed after all passes have run.
//
bool doPassFinalization(Module *M) {
if (PrintAsBytecode)
WriteBytecodeToFile(M, *Out);
return false;
}
};
#endif
| Add option to print as bytecode instead of assembly. | Add option to print as bytecode instead of assembly.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@887 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm |
c67c564520eecf9c8517075b286ec0ac976d07a4 | vespalib/src/vespa/vespalib/util/hw_info.h | vespalib/src/vespa/vespalib/util/hw_info.h | // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "i_hw_info.h"
namespace vespalib {
/*
* class describing some hardware on the machine.
*/
class HwInfo : public IHwInfo
{
bool _spinningDisk;
public:
HwInfo();
virtual ~HwInfo();
virtual bool spinningDisk() const override;
};
}
| // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "i_hw_info.h"
namespace vespalib {
/*
* Class describing some hardware on the machine.
*/
class HwInfo : public IHwInfo
{
bool _spinningDisk;
public:
HwInfo();
virtual ~HwInfo();
virtual bool spinningDisk() const override;
};
}
| Use proper uppercase at start of comment. | Use proper uppercase at start of comment.
| 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 |
1c8d27bccc845ca70eb11c29d5d498bb2371c86a | link-grammar/externs.h | link-grammar/externs.h | /*************************************************************************/
/* Copyright (c) 2004 */
/* Daniel Sleator, David Temperley, and John Lafferty */
/* All rights reserved */
/* */
/* Use of the link grammar parsing system is subject to the terms of the */
/* license set forth in the LICENSE file included with this software. */
/* This license allows free redistribution and use in source and binary */
/* forms, with or without modification, subject to certain conditions. */
/* */
/*************************************************************************/
#ifndef _EXTERNS_H
#define _EXTERNS_H
/* verbosity global is held in utilities.c */
extern int verbosity; /* the verbosity level for error messages */
extern char * debug; /* comma-separated function list to debug */
extern char * test; /* comma-separated function list to debug */
#endif /* _EXTERNS_H */
| /*************************************************************************/
/* Copyright (c) 2004 */
/* Daniel Sleator, David Temperley, and John Lafferty */
/* All rights reserved */
/* */
/* Use of the link grammar parsing system is subject to the terms of the */
/* license set forth in the LICENSE file included with this software. */
/* This license allows free redistribution and use in source and binary */
/* forms, with or without modification, subject to certain conditions. */
/* */
/*************************************************************************/
#ifndef _EXTERNS_H
#define _EXTERNS_H
/* verbosity global is held in utilities.c */
extern int verbosity; /* the verbosity level for error messages */
extern char * debug; /* comma-separated functions/files to debug */
extern char * test; /* comma-separated features to test */
#endif /* _EXTERNS_H */
| Fix global variable description comments. | Fix global variable description comments.
| C | lgpl-2.1 | ampli/link-grammar,ampli/link-grammar,ampli/link-grammar,opencog/link-grammar,opencog/link-grammar,ampli/link-grammar,opencog/link-grammar,ampli/link-grammar,opencog/link-grammar,ampli/link-grammar,linas/link-grammar,linas/link-grammar,ampli/link-grammar,opencog/link-grammar,linas/link-grammar,linas/link-grammar,linas/link-grammar,linas/link-grammar,opencog/link-grammar,opencog/link-grammar,linas/link-grammar,linas/link-grammar,ampli/link-grammar,opencog/link-grammar,ampli/link-grammar,opencog/link-grammar,linas/link-grammar |
7ba2cae8c825baf411488ded7d0eb1e6cc17452d | tests/headers/issue-1554.h | tests/headers/issue-1554.h | // bindgen-flags: --default-enum-style rust_non_exhaustive --raw-line '#![cfg(feature = "nightly")]' --raw-line '#![feature(non_exhaustive)]'
enum Planet {
earth,
mars
};
| // bindgen-flags: --default-enum-style rust_non_exhaustive --rust-target nightly --raw-line '#![cfg(feature = "nightly")]' --raw-line '#![feature(non_exhaustive)]'
enum Planet {
earth,
mars
};
| Add missing --rust-target flags on test case. | Add missing --rust-target flags on test case.
See https://github.com/rust-lang/rust-bindgen/pull/1575#discussion_r293079226
| C | bsd-3-clause | emilio/rust-bindgen,emilio/rust-bindgen,emilio/rust-bindgen,rust-lang/rust-bindgen,emilio/rust-bindgen,emilio/rust-bindgen,rust-lang/rust-bindgen,rust-lang/rust-bindgen,rust-lang/rust-bindgen |
3f2067c6dadb97125994dacc517a4be6f0b67256 | linux/include/stdint.h | linux/include/stdint.h | /*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* @file linux/include/stdint.h
* @brief Define the uintX_t types for the Linux kernel
* @author Didier Barvaux <[email protected]>
*/
#ifndef STDINT_H_
#define STDINT_H_
#ifndef __KERNEL__
# error "for Linux kernel only!"
#endif
#include <linux/types.h>
typedef u_int8_t uint8_t;
typedef u_int16_t uint16_t;
typedef u_int32_t uint32_t;
#endif /* STDINT_H_ */
| /*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* @file linux/include/stdint.h
* @brief Define the uintX_t types for the Linux kernel
* @author Didier Barvaux <[email protected]>
*/
#ifndef STDINT_H_
#define STDINT_H_
#ifndef __KERNEL__
# error "for Linux kernel only!"
#endif
#include <linux/types.h>
#endif /* STDINT_H_ */
| Fix build of the Linux kernel module on ARM. | Fix build of the Linux kernel module on ARM.
| C | lgpl-2.1 | didier-barvaux/rohc,didier-barvaux/rohc,didier-barvaux/rohc,didier-barvaux/rohc,didier-barvaux/rohc |
e59877f76ae37ecdf26d8a17f132dd9541e06886 | blaze/math/proxy/Forward.h | blaze/math/proxy/Forward.h | //=================================================================================================
/*!
// \file blaze/math/proxy/Forward.h
// \brief Header file for all forward declarations for proxies
//
// Copyright (C) 2013 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistribute it and/or modify it under
// the terms of the New (Revised) BSD License. Redistribution and use in source and binary
// forms, with or without modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
// 3. Neither the names of the Blaze development group 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 HOLDER 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 _BLAZE_MATH_PROXY_FORWARD_H_
#define _BLAZE_MATH_PROXY_FORWARD_H_
namespace blaze {
//=================================================================================================
//
// ::blaze NAMESPACE FORWARD DECLARATIONS
//
//=================================================================================================
template< typename, typename > class ComplexProxy;
template< typename, typename > class DefaultProxy;
template< typename, typename > class DenseMatrixProxy;
template< typename, typename > class DenseVectorProxy;
template< typename, typename > class Proxy;
template< typename, typename > class SparseMatrixProxy;
template< typename, typename > class SparseVectorProxy;
} // namespace blaze
#endif
| Add forward declarations for all proxies | Add forward declarations for all proxies
| C | bsd-3-clause | byzhang/blaze,byzhang/blaze,byzhang/blaze |
|
a112b69d8c3f17f3320198e658cefd82324d95ff | src/widgets/external_ip.c | src/widgets/external_ip.c | #include "widgets.h"
#include "external_ip.h"
static int
widget_external_ip_send_update () {
char *external_ip = wkline_curl_request(wkline_widget_external_ip_address);
json_t *json_data_object = json_object();
char *json_payload;
json_object_set_new(json_data_object, "ip", json_string("ip"));
json_payload = json_dumps(json_data_object, 0);
widget_data_t *widget_data = malloc(sizeof(widget_data_t) + 4096);
widget_data->widget = "external_ip";
widget_data->data = json_payload;
g_idle_add((GSourceFunc)update_widget, widget_data);
free(external_ip);
return 0;
}
void
*widget_external_ip () {
for (;;) {
widget_external_ip_send_update();
sleep(600);
}
return 0;
}
| #include "widgets.h"
#include "external_ip.h"
static int
widget_external_ip_send_update () {
char *external_ip = wkline_curl_request(wkline_widget_external_ip_address);
json_t *json_data_object = json_object();
char *json_payload;
json_object_set_new(json_data_object, "ip", json_string(external_ip));
json_payload = json_dumps(json_data_object, 0);
widget_data_t *widget_data = malloc(sizeof(widget_data_t) + 4096);
widget_data->widget = "external_ip";
widget_data->data = json_payload;
g_idle_add((GSourceFunc)update_widget, widget_data);
free(external_ip);
return 0;
}
void
*widget_external_ip () {
for (;;) {
widget_external_ip_send_update();
sleep(600);
}
return 0;
}
| Fix error in external IP widget | Fix error in external IP widget
| C | mit | jhanssen/candybar,Lokaltog/candybar,jhanssen/candybar,Lokaltog/candybar |
1a7d60e5c88c09b3a113436dcac983adedeac2a5 | mediacontrols.h | mediacontrols.h | #pragma once
#include <QtWidgets>
#include <QMediaPlayer>
class MediaControls : public QWidget
{
Q_OBJECT
public:
MediaControls(QWidget *parent = 0);
QMediaPlayer::State state() const;
int volume() const;
bool isMuted();
public slots:
void setState(QMediaPlayer::State state);
void setVolume(int volume);
void setMuted(bool muted);
signals:
void play();
void pause();
void stop();
void next();
void previous();
void changeVolume(int volume);
void changeMuting(bool muting);
private slots:
void playClicked();
void muteClicked();
void onVolumeSliderValueChanged();
private:
QMediaPlayer::State playerState;
bool playerMuted;
QPushButton *playButton;
QPushButton *stopButton;
QPushButton *nextButton;
QPushButton *previousButton;
QPushButton *muteButton;
QSlider *volumeSlider;
};
| #pragma once
#include <QtWidgets>
#include <QMediaPlayer>
class MediaControls : public QWidget
{
Q_OBJECT
public:
MediaControls(QWidget *parent = 0);
QMediaPlayer::State state() const;
int volume() const;
bool isMuted();
public slots:
void setState(QMediaPlayer::State state);
void setVolume(int volume);
void setMuted(bool muted);
signals:
void play();
void pause();
void stop();
void next();
void previous();
void changeVolume(int volume);
void changeMuting(bool muting);
void valueChanged(int);
private slots:
void playClicked();
void muteClicked();
void onVolumeSliderValueChanged();
private:
QMediaPlayer::State playerState;
bool playerMuted;
QPushButton *playButton;
QPushButton *stopButton;
QPushButton *nextButton;
QPushButton *previousButton;
QPushButton *muteButton;
QSlider *volumeSlider;
};
| Add one slot for changed value | Add one slot for changed value
| C | mit | mordegardi/aufision,mordegardi/aufision,mordegardi/aufision |
6a8a0d7dc153b826cc96840d1e98d214883b190d | C/mwt.c | C/mwt.c | #include<stdio.h>
#include<stdlib.h>
int main (int argc, char *argv[]){
if(argc != 3){
printf("Number of parameters should be 2 (filename, cardinality).");
exit(1);
}
//open file and get file length
FILE *file;
file = fopen(argv[1],"r");
if(file == NULL){
printf("File couldn't be opened.");
exit(1);
}
fseek(file, 0, SEEK_END);
int fileLength = ftell(file);
fseek(file, 0, SEEK_SET);
//save data from file to array
char inputStream[fileLength];
//printf("length: %d \n", fileLength);
int i = 0;
int character;
while((character = fgetc(file)) != EOF){
inputStream[i] = character;
i++;
}
/*int j;
for(j=0; j < fileLength; j++){
char a = inputStream[j];
printf("Znak: %c \n", a);
}*/
fclose(file);
}
| Read file and save data to array | Read file and save data to array
| C | mit | marijanaSpajic/multiary_wavelet_tree,marijanaSpajic/multiary_wavelet_tree,marijanaSpajic/multiary_wavelet_tree,marijanaSpajic/multiary_wavelet_tree,marijanaSpajic/multiary_wavelet_tree,marijanaSpajic/multiary_wavelet_tree |
|
443637f6a485f7c9f5e1c4cf393b5fd22a718c69 | src/unit_PARALLEL/chrono_parallel/collision/ChCNarrowphase.h | src/unit_PARALLEL/chrono_parallel/collision/ChCNarrowphase.h | #ifndef CHC_NARROWPHASE_H
#define CHC_NARROWPHASE_H
#include "chrono_parallel/ChParallelDefines.h"
#include "chrono_parallel/ChDataManager.h"
namespace chrono {
namespace collision {
struct ConvexShape {
shape_type type; //type of shape
real3 A; //location
real3 B; //dimensions
real3 C; //extra
quaternion R; //rotation
real3* convex; // pointer to convex data;
};
} // end namespace collision
} // end namespace chrono
#endif
| #ifndef CHC_NARROWPHASE_H
#define CHC_NARROWPHASE_H
#include "chrono_parallel/ChParallelDefines.h"
#include "chrono_parallel/ChDataManager.h"
namespace chrono {
namespace collision {
struct ConvexShape {
shape_type type; //type of shape
real3 A; //location
real3 B; //dimensions
real3 C; //extra
quaternion R; //rotation
real3* convex; // pointer to convex data;
real margin;
ConvexShape():margin(0.04){}
};
} // end namespace collision
} // end namespace chrono
#endif
| Add a collision margin to each shape Margins are one way to improve stability of contacts. Only the GJK solver will use these initially | Add a collision margin to each shape
Margins are one way to improve stability of contacts.
Only the GJK solver will use these initially
| C | bsd-3-clause | jcmadsen/chrono,PedroTrujilloV/chrono,jcmadsen/chrono,Milad-Rakhsha/chrono,hsu/chrono,dariomangoni/chrono,hsu/chrono,projectchrono/chrono,andrewseidl/chrono,projectchrono/chrono,hsu/chrono,projectchrono/chrono,tjolsen/chrono,dariomangoni/chrono,armanpazouki/chrono,rserban/chrono,dariomangoni/chrono,Milad-Rakhsha/chrono,tjolsen/chrono,andrewseidl/chrono,jcmadsen/chrono,Bryan-Peterson/chrono,rserban/chrono,Milad-Rakhsha/chrono,hsu/chrono,projectchrono/chrono,andrewseidl/chrono,jcmadsen/chrono,rserban/chrono,rserban/chrono,PedroTrujilloV/chrono,amelmquist/chrono,amelmquist/chrono,Milad-Rakhsha/chrono,andrewseidl/chrono,hsu/chrono,Milad-Rakhsha/chrono,rserban/chrono,PedroTrujilloV/chrono,jcmadsen/chrono,amelmquist/chrono,Milad-Rakhsha/chrono,PedroTrujilloV/chrono,rserban/chrono,armanpazouki/chrono,andrewseidl/chrono,tjolsen/chrono,amelmquist/chrono,dariomangoni/chrono,armanpazouki/chrono,jcmadsen/chrono,projectchrono/chrono,armanpazouki/chrono,dariomangoni/chrono,Bryan-Peterson/chrono,armanpazouki/chrono,projectchrono/chrono,rserban/chrono,Bryan-Peterson/chrono,tjolsen/chrono,tjolsen/chrono,dariomangoni/chrono,amelmquist/chrono,Bryan-Peterson/chrono,Bryan-Peterson/chrono,PedroTrujilloV/chrono,amelmquist/chrono,armanpazouki/chrono,jcmadsen/chrono |
686a21bf859f955ff8d3d179da64b7a23c0fed44 | test/Preprocessor/macro_paste_spacing2.c | test/Preprocessor/macro_paste_spacing2.c | // RUN: clang-cc %s -E | grep "movl %eax"
#define R1E %eax
#define epilogue(r1) movl r1;
epilogue(R1E)
| // RUN: clang-cc %s -E | grep "movl %eax"
// PR4132
#define R1E %eax
#define epilogue(r1) movl r1 ## E;
epilogue(R1)
| Fix the testcase for PR4132. | Fix the testcase for PR4132.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@70796 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/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,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang |
28fe8ce18f7db33a8dc2b47ad07e6e0da491710f | include/llvm/Bytecode/WriteBytecodePass.h | include/llvm/Bytecode/WriteBytecodePass.h | //===- llvm/Bytecode/WriteBytecodePass.h - Bytecode Writer Pass --*- C++ -*--=//
//
// This file defines a simple pass to write the working module to a file after
// pass processing is completed.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_BYTECODE_WRITEBYTECODEPASS_H
#define LLVM_BYTECODE_WRITEBYTECODEPASS_H
#include "llvm/Pass.h"
#include "llvm/Bytecode/Writer.h"
#include <iostream>
class WriteBytecodePass : public Pass {
std::ostream *Out; // ostream to print on
bool DeleteStream;
public:
inline WriteBytecodePass(std::ostream *o = &std::cout, bool DS = false)
: Out(o), DeleteStream(DS) {
}
const char *getPassName() const { return "Bytecode Writer"; }
inline ~WriteBytecodePass() {
if (DeleteStream) delete Out;
}
bool run(Module &M) {
WriteBytecodeToFile(&M, *Out);
return false;
}
};
#endif
| //===- llvm/Bytecode/WriteBytecodePass.h - Bytecode Writer Pass --*- C++ -*--=//
//
// This file defines a simple pass to write the working module to a file after
// pass processing is completed.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_BYTECODE_WRITEBYTECODEPASS_H
#define LLVM_BYTECODE_WRITEBYTECODEPASS_H
#include "llvm/Pass.h"
#include "llvm/Bytecode/Writer.h"
#include <iostream>
class WriteBytecodePass : public Pass {
std::ostream *Out; // ostream to print on
bool DeleteStream;
public:
WriteBytecodePass() : Out(&std::cout), DeleteStream(false) {}
WriteBytecodePass(std::ostream *o, bool DS = false)
: Out(o), DeleteStream(DS) {
}
inline ~WriteBytecodePass() {
if (DeleteStream) delete Out;
}
bool run(Module &M) {
WriteBytecodeToFile(&M, *Out);
return false;
}
};
#endif
| Add a version of the bytecode writer pass that has a default ctor | Add a version of the bytecode writer pass that has a default ctor
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@3031 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm |
20027ceb284f470cda25d0ae2c35140b381e91c6 | 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 68
#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 69
#endif
| Update Skia milestone to 69 | Update Skia milestone to 69
[email protected]
Bug: skia:
Change-Id: Ifabe4c89c9d0018da5d4f270d4e3fb5790e29bfc
Reviewed-on: https://skia-review.googlesource.com/130120
Reviewed-by: Heather Miller <[email protected]>
Commit-Queue: Heather Miller <[email protected]>
| C | bsd-3-clause | rubenvb/skia,aosp-mirror/platform_external_skia,google/skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,google/skia,rubenvb/skia,aosp-mirror/platform_external_skia,google/skia,Hikari-no-Tenshi/android_external_skia,google/skia,Hikari-no-Tenshi/android_external_skia,google/skia,google/skia,rubenvb/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,google/skia,google/skia,rubenvb/skia,HalCanary/skia-hc,rubenvb/skia,rubenvb/skia,google/skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,HalCanary/skia-hc,HalCanary/skia-hc,rubenvb/skia,rubenvb/skia,HalCanary/skia-hc,HalCanary/skia-hc,HalCanary/skia-hc,rubenvb/skia,rubenvb/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia |
7a61dc2985b7095d1bc413d014ca3c06e5bc4477 | include/sauce/exceptions.h | include/sauce/exceptions.h | #ifndef SAUCE_SAUCE_EXCEPTIONS_H_
#define SAUCE_SAUCE_EXCEPTIONS_H_
#include <stdexcept>
namespace sauce {
/**
* Raised when no binding can be found for a given interface.
*
* TODO sure would be nice to know who..
*/
struct UnboundException:
public std::runtime_error {
UnboundException():
std::runtime_error("Request for unbound interface.") {}
};
}
#endif // ifndef SAUCE_SAUCE_EXCEPTIONS_H_ | #ifndef SAUCE_SAUCE_EXCEPTIONS_H_
#define SAUCE_SAUCE_EXCEPTIONS_H_
#include <string>
#include <stdexcept>
namespace sauce {
/**
* Base class for all sauce exceptions.
*/
struct Exception: std::runtime_error {
Exception(std::string message):
std::runtime_error(message) {}
};
/**
* Raised when no binding can be found for a given interface.
*
* TODO sure would be nice to know who..
*/
struct UnboundException: Exception {
UnboundException():
Exception("Request for unbound interface.") {}
};
/**
* Raised when a cycle is found in the interface's dependencies.
*
* TODO sure would be nice to know what the cycle is..
*/
struct CircularDependencyException: Exception {
CircularDependencyException():
Exception("Request for unbound interface.") {}
};
}
#endif // ifndef SAUCE_SAUCE_EXCEPTIONS_H_ | Add a circular dependency exception. | Add a circular dependency exception.
Also break out an exception base type.
| C | mit | phs/sauce,phs/sauce,phs/sauce,phs/sauce |
8de958ec707f8e8115881ad595ed4d872bc91641 | library/src/main/jni/image/image_decoder.h | library/src/main/jni/image/image_decoder.h | //
// Created by Hippo on 9/13/2016.
//
#ifndef IMAGE_IMAGE_DECODER_H
#define IMAGE_IMAGE_DECODER_H
#include "com_hippo_image_BitmapDecoder.h"
#define IMAGE_CONFIG_INVALID -1;
#define IMAGE_CONFIG_AUTO com_hippo_image_BitmapDecoder_CONFIG_AUTO
#define IMAGE_CONFIG_RGB_565 com_hippo_image_BitmapDecoder_CONFIG_RGB_565
#define IMAGE_CONFIG_RGBA_8888 com_hippo_image_BitmapDecoder_CONFIG_RGBA_8888
inline bool is_explicit_config(int32_t config) {
return config == IMAGE_CONFIG_RGB_565 || config == IMAGE_CONFIG_RGBA_8888;
}
inline uint32_t get_depth_for_config(int32_t config) {
switch (config) {
case IMAGE_CONFIG_RGB_565:
return 2;
case IMAGE_CONFIG_RGBA_8888:
return 4;
default:
return 0;
}
}
#endif //IMAGE_IMAGE_DECODER_H
| //
// Created by Hippo on 9/13/2016.
//
#ifndef IMAGE_IMAGE_DECODER_H
#define IMAGE_IMAGE_DECODER_H
#include "com_hippo_image_BitmapDecoder.h"
#define IMAGE_CONFIG_INVALID -1;
#define IMAGE_CONFIG_AUTO com_hippo_image_BitmapDecoder_CONFIG_AUTO
#define IMAGE_CONFIG_RGB_565 com_hippo_image_BitmapDecoder_CONFIG_RGB_565
#define IMAGE_CONFIG_RGBA_8888 com_hippo_image_BitmapDecoder_CONFIG_RGBA_8888
static inline bool is_explicit_config(int32_t config) {
return config == IMAGE_CONFIG_RGB_565 || config == IMAGE_CONFIG_RGBA_8888;
}
static inline uint32_t get_depth_for_config(int32_t config) {
switch (config) {
case IMAGE_CONFIG_RGB_565:
return 2;
case IMAGE_CONFIG_RGBA_8888:
return 4;
default:
return 0;
}
}
#endif //IMAGE_IMAGE_DECODER_H
| Fix undefined references in linker | Fix undefined references in linker
| C | apache-2.0 | seven332/Image,seven332/Image,seven332/Image |
d6975e54dee6c652d4dd10fe62c3c29241c967f2 | demos/FPL_FFMpeg/defines.h | demos/FPL_FFMpeg/defines.h | #pragma once
#define PRINT_QUEUE_INFOS 0
#define PRINT_FRAME_UPLOAD_INFOS 0
#define PRINT_MEMORY_STATS 0
#define PRINT_FRAME_DROPS 0
#define PRINT_VIDEO_REFRESH 0
#define PRINT_VIDEO_DELAY 0
#define PRINT_CLOCKS 0
#define PRINT_PTS 0
#define PRINT_FPS 0
// Rendering mode (Hardware or Software)
#define USE_HARDWARE_RENDERING 1
// Hardware rendering
#define USE_GLSL_IMAGE_FORMAT_DECODING 1 // Use GLSL to decode image planes (Much faster than software decoding)
#define USE_GL_PBO 1 // Use OpenGL Pixel Buffer Objects (Faster CPU -> GPU transfer)
#define USE_GL_BLENDING 1 // Use OpenGL Blending (Only useful to disable, when debugging text rendering)
#define USE_GL_RECTANGLE_TEXTURES 1 // Use GL_TEXTURE_RECTANGLE instead of GL_TEXTURE_2D
// Software rendering
#define USE_FLIP_V_PICTURE_IN_SOFTWARE 0 // We need to detect this, when to flip and when not to flip
// Global
#define USE_FFMPEG_STATIC_LINKING 0 // Use static or runtime linking of FFMPEG (Useful to test if function signatures has been changed)
#define USE_FFMPEG_SOFTWARE_CONVERSION 1 // Convert video frames using sws_scale or using our own implementation, which is limited to type AV_PIX_FMT_YUV420P
| #pragma once
#define PRINT_QUEUE_INFOS 0
#define PRINT_FRAME_UPLOAD_INFOS 0
#define PRINT_MEMORY_STATS 0
#define PRINT_FRAME_DROPS 0
#define PRINT_VIDEO_REFRESH 0
#define PRINT_VIDEO_DELAY 0
#define PRINT_CLOCKS 0
#define PRINT_PTS 0
#define PRINT_FPS 0
// Rendering mode (Hardware or Software)
#define USE_HARDWARE_RENDERING 1
// Hardware rendering
#define USE_GLSL_IMAGE_FORMAT_DECODING 1 // Use GLSL to decode image planes (Much faster than software decoding)
#define USE_GL_PBO 1 // Use OpenGL Pixel Buffer Objects (Faster CPU -> GPU transfer)
#define USE_GL_BLENDING 1 // Use OpenGL Blending (Only useful to disable, when debugging text rendering)
#define USE_GL_RECTANGLE_TEXTURES 1 // Use GL_TEXTURE_RECTANGLE instead of GL_TEXTURE_2D
// Software rendering
#define USE_FLIP_V_PICTURE_IN_SOFTWARE 0 // We need to detect this, when to flip and when not to flip
// Global
#define USE_FFMPEG_STATIC_LINKING 0 // Use static or runtime linking of FFMPEG (Useful to test if function signatures has been changed)
#define USE_FFMPEG_SOFTWARE_CONVERSION 0 // Convert video frames using sws_scale or using our own implementation, which is limited to type AV_PIX_FMT_YUV420P
| Disable ffmpeg software conversion in define | Disable ffmpeg software conversion in define
| C | mit | f1nalspace/final_game_tech,f1nalspace/final_game_tech,f1nalspace/final_game_tech |
93da664c36b47e478b7f52e1510a24d73f4f8d1d | runtime/src/chplexit.c | runtime/src/chplexit.c | #include <stdio.h>
#include <stdlib.h>
#include "chpl_rt_utils_static.h"
#include "chpl-comm.h"
#include "chplexit.h"
#include "chpl-mem.h"
#include "chplmemtrack.h"
#include "chplrt.h"
#include "gdb.h"
#undef exit
static void chpl_exit_common(int status, int all) {
fflush(stdout);
fflush(stderr);
if (status != 0) {
gdbShouldBreakHere();
}
if (all) {
chpl_comm_barrier("chpl_comm_exit_all");
chpl_comm_stopPollingTask();
chpl_task_exit();
chpl_reportMemInfo();
chpl_mem_exit();
chpl_comm_exit_all(status);
} else {
chpl_mem_exit();
chpl_comm_exit_any(status);
}
exit(status);
}
void chpl_exit_all(int status) {
chpl_exit_common(status, 1);
}
void chpl_exit_any(int status) {
chpl_exit_common(status, 0);
}
| #include <stdio.h>
#include <stdlib.h>
#include "chpl_rt_utils_static.h"
#include "chpl-comm.h"
#include "chplexit.h"
#include "chpl-mem.h"
#include "chplmemtrack.h"
#include "chplrt.h"
#include "gdb.h"
#undef exit
static void chpl_exit_common(int status, int all) {
fflush(stdout);
fflush(stderr);
if (status != 0) {
gdbShouldBreakHere();
}
if (all) {
chpl_comm_barrier("chpl_exit_common");
chpl_comm_stopPollingTask();
chpl_task_exit();
chpl_reportMemInfo();
chpl_mem_exit();
chpl_comm_exit_all(status);
} else {
chpl_mem_exit();
chpl_comm_exit_any(status);
}
exit(status);
}
void chpl_exit_all(int status) {
chpl_exit_common(status, 1);
}
void chpl_exit_any(int status) {
chpl_exit_common(status, 0);
}
| Clarify the debug message that may be generated by the chpl_comm_barrier() call in chpl_exit_common(). | Clarify the debug message that may be generated by the
chpl_comm_barrier() call in chpl_exit_common().
git-svn-id: 88467cb1fb04b8a755be7e1ee1026be4190196ef@19217 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
| C | apache-2.0 | chizarlicious/chapel,hildeth/chapel,chizarlicious/chapel,sungeunchoi/chapel,sungeunchoi/chapel,hildeth/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,chizarlicious/chapel,CoryMcCartan/chapel,hildeth/chapel,hildeth/chapel,chizarlicious/chapel,chizarlicious/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,sungeunchoi/chapel,sungeunchoi/chapel,chizarlicious/chapel,CoryMcCartan/chapel,hildeth/chapel,CoryMcCartan/chapel,hildeth/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,chizarlicious/chapel,CoryMcCartan/chapel,hildeth/chapel,sungeunchoi/chapel |
31555bbf1bd79b4e8ea404c719c1441123ecbb04 | src/SenseKit/Logging.h | src/SenseKit/Logging.h | #ifndef LOGGING_H
#define LOGGING_H
#ifndef __ANDROID__
#define ELPP_STACKTRACE_ON_CRASH
#endif
#define ELPP_NO_DEFAULT_LOG_FILE
#include "vendor/easylogging++.h"
#define INITIALIZE_LOGGING INITIALIZE_EASYLOGGINGPP
namespace sensekit {
void initialize_logging(const char* logFilePath);
}
#endif /* LOGGING_H */
| #ifndef LOGGING_H
#define LOGGING_H
#ifdef __ANDROID__
#define ELPP_DISABLE_DEFAULT_CRASH_HANDLING
#else // not android
#define ELPP_STACKTRACE_ON_CRASH
#endif
#define ELPP_NO_DEFAULT_LOG_FILE
#include "vendor/easylogging++.h"
#define INITIALIZE_LOGGING INITIALIZE_EASYLOGGINGPP
namespace sensekit {
void initialize_logging(const char* logFilePath);
}
#endif /* LOGGING_H */
| Disable logger crash handling on Android | Disable logger crash handling on Android
| C | apache-2.0 | orbbec/astra,orbbec/astra,orbbec/astra,orbbec/astra,orbbec/astra |
c1028e5d6d7a039b3499f2d63f7242943331ac74 | tests/test_stack_using_array.c | tests/test_stack_using_array.c | #include <check.h>
#include "../src/stack_using_array/stack.h"
stack st;
void setup() {
init(&st);
}
void teardown() {
}
START_TEST( test_push_pop_normal_ops )
{
push( &st, 10 );
push( &st, 12 );
ck_assert_int_eq( pop( &st ), 12 );
ck_assert_int_eq( pop( &st ), 10 );
}
END_TEST
START_TEST( test_pop_underflow )
{
push( &st, 12 );
ck_assert_int_eq( pop( &st ), 12 );
ck_assert_int_eq( pop( &st ), -2 );
}
END_TEST
START_TEST( test_push_overflow )
{
push( &st, 2 );
push( &st, 3 );
push( &st, 4 );
push( &st, 5 );
push( &st, 6 );
ck_assert_int_eq( push( &st, 7 ), -3 );
}
END_TEST
START_TEST( test_null_pointer )
{
ck_assert_int_eq( init( NULL ), -1 );
ck_assert_int_eq( push( NULL, 10 ), -1 );
ck_assert_int_eq( pop( NULL ), -1 );
ck_assert_int_eq( peek( NULL ), -1 );
}
END_TEST
Suite * stack_suite(void)
{
Suite *s;
TCase *tc_core, *tc_abnormal;
s = suite_create("Stack");
/* Core test case */
tc_core = tcase_create("Core");
/* Abnormal test case */
tc_abnormal = tcase_create("Abnormal");
tcase_add_checked_fixture(tc_core, setup, teardown);
tcase_add_checked_fixture(tc_abnormal, setup, teardown);
tcase_add_test(tc_core, test_push_pop_normal_ops);
tcase_add_test(tc_abnormal, test_push_overflow);
tcase_add_test(tc_abnormal, test_pop_underflow);
tcase_add_test(tc_abnormal, test_null_pointer);
suite_add_tcase(s, tc_core);
suite_add_tcase(s, tc_abnormal);
return s;
}
int main()
{
int number_failed;
Suite *s;
SRunner *sr;
s = stack_suite();
sr = srunner_create(s);
srunner_run_all(sr, CK_NORMAL);
number_failed = srunner_ntests_failed(sr);
srunner_free(sr);
return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
| Test for stack using array | Test for stack using array
| C | mit | TejasR/data-structures-in-c,TejasR/data-structures-in-c |
|
11beae99eafcb134fa72ec4a952a1d0dc07203d1 | src/log_queue.h | src/log_queue.h | #pragma once
#include <cstddef>
#include <condition_variable>
#include <mutex>
#include <queue>
namespace log {
template<typename T>
class LogQueue final {
public:
explicit LogQueue(size_t capacity) : m_capacity(capacity) {}
~LogQueue() = default;
LogQueue(const LogQueue&) = delete;
LogQueue& operator=(const LogQueue&) = delete;
void Push(T&& element) {
std::unique_lock<std::mutex> lock(m_mutex);
while (m_queue.size() + 1 > m_capacity) { // is full
m_notfull.wait(lock);
}
m_queue.push(std::move(element));
m_notempty.notify_one();
}
void Pop(T* element) {
std::unique_lock<std::mutex> lock(m_mutex);
while (m_queue.empty()) { // is empty
m_notempty.wait(lock);
}
if (element != nullptr) {
*element = std::move(m_queue.front());
}
m_queue.pop();
m_notfull.notify_one();
}
private:
const size_t m_capacity;
std::queue<T> m_queue;
std::mutex m_mutex;
std::condition_variable m_notfull;
std::condition_variable m_notempty;
};
} // namespace log
| #pragma once
#include <cstddef>
#include <condition_variable>
#include <mutex>
#include <queue>
namespace log {
template<typename T>
class LogQueue final {
public:
explicit LogQueue(size_t capacity) : m_capacity(capacity) {}
~LogQueue() = default;
LogQueue(const LogQueue&) = delete;
LogQueue& operator=(const LogQueue&) = delete;
void Push(T&& element) {
std::unique_lock<std::mutex> lock(m_mutex);
while (isFull()) {
m_notfull.wait(lock);
}
bool wasEmpty = isEmpty();
m_queue.push(std::move(element));
if (wasEmpty) {
m_notempty.notify_one();
}
}
void Pop(T* element) {
std::unique_lock<std::mutex> lock(m_mutex);
while (isEmpty()) {
m_notempty.wait(lock);
}
bool wasFull = isFull();
if (element != nullptr) {
*element = std::move(m_queue.front());
}
m_queue.pop();
if (wasFull) {
m_notfull.notify_one();
}
}
private:
const size_t m_capacity;
std::queue<T> m_queue;
std::mutex m_mutex;
std::condition_variable m_notfull;
std::condition_variable m_notempty;
bool isEmpty() {
return m_queue.empty();
}
bool isFull() {
return m_queue.size() + 1 > m_capacity;
}
};
} // namespace log
| Decrease the number of notify_one calls | optimize: Decrease the number of notify_one calls
| C | mit | yksz/cpp-logger,yksz/cpp-logger |
a21cdb843767cc21a1b371105883c735784c8793 | include/asm-generic/string.h | include/asm-generic/string.h | #ifndef __CR_ASM_GENERIC_STRING_H__
#define __CR_ASM_GENERIC_STRING_H__
#include "compiler.h"
#ifndef HAS_BUILTIN_MEMCPY
static always_inline void *builtin_memcpy(void *to, const void *from, unsigned int n)
{
int i;
unsigned char *cto = to;
const unsigned char *cfrom = from;
for (i = 0; i < n; ++i, ++cto, ++cfrom) {
*cto = *cfrom;
}
return to;
}
#endif
#endif /* __CR_ASM_GENERIC_STRING_H__ */
| #ifndef __CR_ASM_GENERIC_STRING_H__
#define __CR_ASM_GENERIC_STRING_H__
#include "compiler.h"
#ifndef HAS_BUILTIN_MEMCPY
static always_inline void *builtin_memcpy(void *to, const void *from, unsigned int n)
{
int i;
unsigned char *cto = to;
const unsigned char *cfrom = from;
for (i = 0; i < n; ++i, ++cto, ++cfrom) {
*cto = *cfrom;
}
return to;
}
#endif
#ifndef HAS_BUILTIN_MEMCMP
static always_inline int builtin_memcmp(const void *cs, const void *ct, size_t count)
{
const unsigned char *su1, *su2;
int res = 0;
for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--)
if ((res = *su1 - *su2) != 0)
break;
return res;
}
#endif
#ifndef HAS_BUILTIN_STRCMP
static always_inline int builtin_strcmp(const char *cs, const char *ct)
{
unsigned char c1, c2;
while (1) {
c1 = *cs++;
c2 = *ct++;
if (c1 != c2)
return c1 < c2 ? -1 : 1;
if (!c1)
break;
}
return 0;
}
#endif
#endif /* __CR_ASM_GENERIC_STRING_H__ */
| Add builtin_memcpy, builtin_memcmp generic helpers | asm: Add builtin_memcpy, builtin_memcmp generic helpers
Will need them in pie code soon.
Signed-off-by: Cyrill Gorcunov <[email protected]>
Signed-off-by: Pavel Emelyanov <[email protected]>
| C | lgpl-2.1 | efiop/criu,biddyweb/criu,svloyso/criu,efiop/criu,KKoukiou/criu-remote,KKoukiou/criu-remote,marcosnils/criu,kawamuray/criu,ldu4/criu,eabatalov/criu,efiop/criu,gablg1/criu,eabatalov/criu,AuthenticEshkinKot/criu,rentzsch/criu,svloyso/criu,svloyso/criu,wtf42/criu,ldu4/criu,biddyweb/criu,eabatalov/criu,AuthenticEshkinKot/criu,LK4D4/criu,eabatalov/criu,sdgdsffdsfff/criu,fbocharov/criu,tych0/criu,KKoukiou/criu-remote,sdgdsffdsfff/criu,tych0/criu,gonkulator/criu,tych0/criu,kawamuray/criu,LK4D4/criu,kawamuray/criu,gonkulator/criu,marcosnils/criu,rentzsch/criu,LK4D4/criu,kawamuray/criu,LK4D4/criu,sdgdsffdsfff/criu,marcosnils/criu,gablg1/criu,efiop/criu,ldu4/criu,KKoukiou/criu-remote,biddyweb/criu,sdgdsffdsfff/criu,rentzsch/criu,rentzsch/criu,svloyso/criu,tych0/criu,gonkulator/criu,LK4D4/criu,KKoukiou/criu-remote,AuthenticEshkinKot/criu,sdgdsffdsfff/criu,AuthenticEshkinKot/criu,wtf42/criu,LK4D4/criu,kawamuray/criu,gonkulator/criu,AuthenticEshkinKot/criu,ldu4/criu,gonkulator/criu,gablg1/criu,gonkulator/criu,eabatalov/criu,kawamuray/criu,wtf42/criu,gablg1/criu,gablg1/criu,marcosnils/criu,fbocharov/criu,biddyweb/criu,biddyweb/criu,marcosnils/criu,rentzsch/criu,fbocharov/criu,wtf42/criu,wtf42/criu,efiop/criu,svloyso/criu,gablg1/criu,wtf42/criu,KKoukiou/criu-remote,AuthenticEshkinKot/criu,ldu4/criu,rentzsch/criu,tych0/criu,efiop/criu,biddyweb/criu,fbocharov/criu,sdgdsffdsfff/criu,ldu4/criu,fbocharov/criu,marcosnils/criu,svloyso/criu,tych0/criu,fbocharov/criu,eabatalov/criu |
cf3241c5db6a161453b0127499b2c30c1ee9bd02 | cpu/native/dev/uart1.h | cpu/native/dev/uart1.h | /*
Copied from mc1322x/dev/cpu.
This file exists as a work-around for the hardware dependant calls
to slip_arch_init.
Current the prototype for slip_arch_init is slip_arch_init(urb)
and a typical call is something like
slip_arch_init(BAUD2URB(115200))
BAUD2UBR is hardware specific, however. Furthermore, for the sky
platform it's typically defined with #include "dev/uart1.h" (see
rpl-boarder-router/slip-bridge.c), a sky specific file. dev/uart1.h
includes msp430.h which includes the sky contiki-conf.h which
defines BAUD2UBR.
To me, the correct think to pass is simply the baudrate and have the
hardware specific conversion happen inside slip_arch_init.
Notably, most implementations just ignore the passed parameter
anyway. (except AVR)
*/
#ifndef DEV_UART1_H
#define DEV_UART1_H
#define BAUD2UBR(x) x
#endif
| Add file needed for rpl border router | Add file needed for rpl border router
| C | bsd-3-clause | MohamedSeliem/contiki,arurke/contiki,bluerover/6lbr,arurke/contiki,bluerover/6lbr,MohamedSeliem/contiki,MohamedSeliem/contiki,MohamedSeliem/contiki,MohamedSeliem/contiki,arurke/contiki,MohamedSeliem/contiki,arurke/contiki,MohamedSeliem/contiki,arurke/contiki,arurke/contiki,bluerover/6lbr,bluerover/6lbr,bluerover/6lbr,arurke/contiki,bluerover/6lbr,bluerover/6lbr |
|
08d9391c8f90f0c5c997bd3ab41517774dd582f3 | src/dtkComposer/dtkComposerSceneNodeLeaf.h | src/dtkComposer/dtkComposerSceneNodeLeaf.h | /* dtkComposerSceneNodeLeaf.h ---
*
* Author: Julien Wintz
* Copyright (C) 2008-2011 - Julien Wintz, Inria.
* Created: Fri Feb 3 12:34:45 2012 (+0100)
* Version: $Id$
* Last-Updated: Thu Feb 16 14:47:09 2012 (+0100)
* By: Julien Wintz
* Update #: 10
*/
/* Commentary:
*
*/
/* Change log:
*
*/
#ifndef DTKCOMPOSERSCENENODELEAF_H
#define DTKCOMPOSERSCENENODELEAF_H
#include "dtkComposerSceneNode.h"
class dtkComposerNode;
class dtkComposerSceneNodeLeafPrivate;
class dtkComposerSceneNodeLeaf : public dtkComposerSceneNode
{
public:
dtkComposerSceneNodeLeaf(void);
~dtkComposerSceneNodeLeaf(void);
public:
void wrap(dtkComposerNode *node);
public:
void layout(void);
public:
void resize(qreal width, qreal height);
public:
QRectF boundingRect(void) const;
public:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
private:
dtkComposerSceneNodeLeafPrivate *d;
};
#endif
| /* dtkComposerSceneNodeLeaf.h ---
*
* Author: Julien Wintz
* Copyright (C) 2008-2011 - Julien Wintz, Inria.
* Created: Fri Feb 3 12:34:45 2012 (+0100)
* Version: $Id$
* Last-Updated: Thu May 31 09:45:52 2012 (+0200)
* By: tkloczko
* Update #: 11
*/
/* Commentary:
*
*/
/* Change log:
*
*/
#ifndef DTKCOMPOSERSCENENODELEAF_H
#define DTKCOMPOSERSCENENODELEAF_H
#include "dtkComposerExport.h"
#include "dtkComposerSceneNode.h"
class dtkComposerNode;
class dtkComposerSceneNodeLeafPrivate;
class DTKCOMPOSER_EXPORT dtkComposerSceneNodeLeaf : public dtkComposerSceneNode
{
public:
dtkComposerSceneNodeLeaf(void);
~dtkComposerSceneNodeLeaf(void);
public:
void wrap(dtkComposerNode *node);
public:
void layout(void);
public:
void resize(qreal width, qreal height);
public:
QRectF boundingRect(void) const;
public:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
private:
dtkComposerSceneNodeLeafPrivate *d;
};
#endif
| Add export rules for scene node leaf. | Add export rules for scene node leaf.
| C | bsd-3-clause | d-tk/dtk,d-tk/dtk,NicolasSchnitzler/dtk,rdebroiz/dtk,d-tk/dtk,rdebroiz/dtk,rdebroiz/dtk,d-tk/dtk,rdebroiz/dtk,d-tk/dtk,NicolasSchnitzler/dtk,NicolasSchnitzler/dtk,NicolasSchnitzler/dtk,d-tk/dtk |
8bcfa4182e71abb82bc7b45b91b61c5a6e431923 | src/password.c | src/password.c |
#include <string.h>
#include <openssl/sha.h>
#include "password.h"
void key_from_password(const char *a_password, char *a_key)
{
unsigned char digest[256 / 8] = {0}; // SHA 256 uses 256/8 bytes.
int i;
SHA256((const unsigned char *)a_password, strlen(a_password), digest);
for (i = 0; i < 40872; i++) {
SHA256(digest, 32, digest);
}
memcpy(a_key, digest, sizeof(digest));
}
void key_hash(const char *a_key, char *a_hash)
{
unsigned char digest[256 / 8];
int i;
memcpy(digest, a_key, sizeof(digest));
for (i = 0; i < 30752; i++) {
SHA256(digest, 32, digest);
}
memcpy(a_hash, digest, sizeof(digest));
}
|
#include <string.h>
#include <openssl/sha.h>
#include "password.h"
void key_from_password(const char *a_password, char *a_key)
{
unsigned char digest[256 / 8] = {0}; // SHA 256 uses 256/8 bytes.
int i;
SHA256((const unsigned char *)a_password, strlen(a_password), digest);
for (i = 0; i < 40872; i++) {
SHA256(digest, 32, digest);
}
memcpy(a_key, digest, sizeof(digest));
}
void key_hash(const char *a_key, char *a_hash)
{
unsigned char digest[256 / 8];
int i;
memcpy(digest, a_key, sizeof(digest));
for (i = 0; i < 30752; i++) {
SHA256(digest, 32, digest);
}
memcpy(a_hash, digest, sizeof(digest));
}
| Convert tabs to spaces and indent | Convert tabs to spaces and indent
| C | mit | falsovsky/FiSH-irssi |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.