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
61e404e36c914476938db67d873a0df32c6c3a9c
test/CodeGen/ppc64-varargs-struct.c
test/CodeGen/ppc64-varargs-struct.c
// REQUIRES: ppc64-registered-target // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s #include <stdarg.h> struct x { long a; double b; }; void testva (int n, ...) { va_list ap; struct x t = va_arg (ap, struct x); // CHECK: bitcast i8* %ap.cur{{[0-9]*}} to %struct.x* // CHECK: bitcast %struct.x* %t to i8* // CHECK: bitcast %struct.x* %{{[0-9]+}} to i8* // CHECK: call void @llvm.memcpy __int128_t u = va_arg (ap, __int128_t); // CHECK: ptrtoint i8* %ap.cur{{[0-9]*}} to i64 // CHECK: add i64 %{{[0-9]+}}, 15 // CHECK: and i64 %{{[0-9]+}}, 4294967280 // CHECK: inttoptr i64 %{{[0-9]+}} to i8* int v = va_arg (ap, int); // CHECK: ptrtoint i8* %ap.cur{{[0-9]*}} to i64 // CHECK: add i64 %{{[0-9]+}}, 4 // CHECK: inttoptr i64 %{{[0-9]+}} to i8* // CHECK: bitcast i8* %{{[0-9]+}} to i32* }
Add a test case for r156143, which enabled general varargs support for the 64-bit PPC SVR4 ABI.
Add a test case for r156143, which enabled general varargs support for the 64-bit PPC SVR4 ABI. The test verifies passing of structures, items with 16-byte alignment, and small items that are passed right-justified in the parameter save area slot. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@165245 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
3ebee2620729cf2aae63f98ef3a41c3245844e3f
tests/regression/11-heap/14-list_entry_rc-unroll.c
tests/regression/11-heap/14-list_entry_rc-unroll.c
// PARAM: --disable ana.mutex.disjoint_types --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --set ana.malloc.unique_address_count 1 // Copied from 06-symbeq/14-list_entry_rc, proven safe thanks to unique address #include<pthread.h> #include<stdlib.h> #include<stdio.h> #define list_entry(ptr, type, member) \ ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) pthread_mutexattr_t mutexattr; struct s { int datum; pthread_mutex_t mutex; int list; } *A; void init (struct s *p, int x) { p->datum = x; pthread_mutex_init(&p->mutex, &mutexattr); } void update (int *p) { struct s *s = list_entry(p, struct s, list); pthread_mutex_lock(&s->mutex); s++; // Not actual race: https://gitlab.com/sosy-lab/benchmarking/sv-benchmarks/-/issues/1354 s->datum++; // NORACE pthread_mutex_unlock(&s->mutex); // no UB because ERRORCHECK } void *t_fun(void *arg) { update(&A->list); return NULL; } int main () { pthread_mutexattr_init(&mutexattr); pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_ERRORCHECK); pthread_t t1; A = malloc(2 * sizeof(struct s)); init(A,666); init(&A[1],999); // extra element for s++ in update pthread_create(&t1, NULL, t_fun, NULL); update(&A->list); return 0; }
Add 06-symbeq/14-list_entry_rc version where alloc unrolling gives enough precision
Add 06-symbeq/14-list_entry_rc version where alloc unrolling gives enough precision
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
00055df70f34b1ec9e2b669a96cba6ec78a9305a
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 59 #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 60 #endif
Update Skia milestone to 60
Update Skia milestone to 60 BUG=skia: Change-Id: I1354ff96f5ff62c02af1d9cf39f0a971da077b17 Reviewed-on: https://skia-review.googlesource.com/13465 Reviewed-by: Heather Miller <[email protected]> Commit-Queue: Heather Miller <[email protected]>
C
bsd-3-clause
HalCanary/skia-hc,google/skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,google/skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,google/skia,rubenvb/skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,rubenvb/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,rubenvb/skia,rubenvb/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,google/skia,google/skia,rubenvb/skia,rubenvb/skia,HalCanary/skia-hc,HalCanary/skia-hc,HalCanary/skia-hc,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,aosp-mirror/platform_external_skia
918002b7cc42d465dc80d2313e31d8fbfeef3712
include/ethdrivers/intel.h
include/ethdrivers/intel.h
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the GNU General Public License version 2. Note that NO WARRANTY is provided. * See "LICENSE_GPLv2.txt" for details. * * @TAG(NICTA_GPL) */ #include <platsupport/io.h> /** * This function initialises the hardware * @param[in] io_ops A structure containing os specific data and * functions. * @param[in] bar0 Where pci bar0 has been mapped into our vspace * @return A reference to the ethernet drivers state. */ struct eth_driver* ethif_e82580_init(ps_io_ops_t io_ops, void *bar0); /** * This function initialises the hardware * @param[in] io_ops A structure containing os specific data and * functions. * @param[in] bar0 Where pci bar0 has been mapped into our vspace * @return A reference to the ethernet drivers state. */ struct eth_driver* ethif_e82574_init(ps_io_ops_t io_ops, void *bar0);
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the GNU General Public License version 2. Note that NO WARRANTY is provided. * See "LICENSE_GPLv2.txt" for details. * * @TAG(NICTA_GPL) */ #ifndef ETHIF_INTEL_H #define ETHIF_INTEL_H #include <platsupport/io.h> /** * This function initialises the hardware * @param[in] io_ops A structure containing os specific data and * functions. * @param[in] bar0 Where pci bar0 has been mapped into our vspace * @return A reference to the ethernet drivers state. */ struct eth_driver* ethif_e82580_init(ps_io_ops_t io_ops, void *bar0); /** * This function initialises the hardware * @param[in] io_ops A structure containing os specific data and * functions. * @param[in] bar0 Where pci bar0 has been mapped into our vspace * @return A reference to the ethernet drivers state. */ struct eth_driver* ethif_e82574_init(ps_io_ops_t io_ops, void *bar0); #endif
Add missing header file guards
Add missing header file guards
C
bsd-2-clause
agacek/util_libs,agacek/util_libs,agacek/util_libs,agacek/util_libs
e6be97cf303bd7289c4403c254bd24a72684c3f8
libSpinWaveGenie/include/SpinWaveGenie/Memory.h
libSpinWaveGenie/include/SpinWaveGenie/Memory.h
#include <cstddef> #include <memory> #include <type_traits> #include <utility> #if (!defined(__clang__) && !defined(_MSC_VER) && __GNUC__ == 4 && __GNUC_MINOR__ < 9) namespace std { template <class T> struct _Unique_if { typedef unique_ptr<T> _Single_object; }; template <class T> struct _Unique_if<T[]> { typedef unique_ptr<T[]> _Unknown_bound; }; template <class T, size_t N> struct _Unique_if<T[N]> { typedef void _Known_bound; }; template <class T, class... Args> typename _Unique_if<T>::_Single_object make_unique(Args &&... args) { return unique_ptr<T>(new T(std::forward<Args>(args)...)); } template <class T> typename _Unique_if<T>::_Unknown_bound make_unique(size_t n) { typedef typename remove_extent<T>::type U; return unique_ptr<T>(new U[n]()); } template <class T, class... Args> typename _Unique_if<T>::_Known_bound make_unique(Args &&...) = delete; } #endif
Add alternative implementation of memory.h
Add alternative implementation of memory.h
C
bsd-3-clause
peterfpeterson/SpinWaveGenie,peterfpeterson/SpinWaveGenie,peterfpeterson/SpinWaveGenie
eb87f015b651e163be9767e7272535e7463332ff
ext/osl/rbosl_move.h
ext/osl/rbosl_move.h
#ifndef RBOSL_MOVE_H #define RBOSL_MOVE_H #include "ruby.h" #include <osl/move.h> extern VALUE cMove; using namespace osl; #ifdef __cplusplus extern "C" { #endif extern void Init_move(VALUE mOsl); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* RBOSL_MOVE_H */
#ifndef RBOSL_MOVE_H #define RBOSL_MOVE_H #include "ruby.h" #include <osl/move.h> extern VALUE cMove; #ifdef __cplusplus extern "C" { #endif extern void Init_move(VALUE mOsl); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* RBOSL_MOVE_H */
Remove a needless using namespace
Remove a needless using namespace
C
mit
myokoym/ruby-osl,myokoym/ruby-osl,myokoym/ruby-osl
f0e36f8cbabd17c08aeea7f0a4adf45ae698ecf3
control.c
control.c
#include <stdio.h> #include <string.h> #include <math.h> struct Packet { unsigned int status: 1; unsigned int group: 2; unsigned int plug: 2; }; unsigned int packet_to_binary(struct Packet packet) { unsigned int binary = (packet.status << 7); binary |= ((packet.group & 0x3) << 2); binary |= (packet.plug & 0x3); return binary & 0xFF; } void binary_to_packet(struct Packet *packet, unsigned int binary) { packet->status = (binary >> 7); packet->group = (binary >> 2) & 0x3; packet->plug = binary & 0x3; } void printBinary(int num, int digits) { int shift = digits - 1; int current = pow(2, shift); while (current > 0) { printf("%d", ((num & current) >> shift) & 1); shift--; current /= 2; } printf("\n"); }
Add basic packet handling code
Add basic packet handling code
C
agpl-3.0
jackwilsdon/lightcontrol,jackwilsdon/lightcontrol
75482dd2ba967e3295976f786a88d9da4948a3a3
tests/regression/36-apron/07-problem-pointer.c
tests/regression/36-apron/07-problem-pointer.c
// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy extern int __VERIFIER_nondet_int(); void change(int *p) { (*p)++; } int g; int main() { int c = __VERIFIER_nondet_int(); g = 3; // Globals are not tracked by apron for now assert(g != 3); // FAIL assert(g == 3); int a = 5; int *p = &a; // after this apron should put a to top because pointers are not tracked change(p); assert(a - 6 == 0); return 0; }
// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy extern int __VERIFIER_nondet_int(); void change(int *p) { (*p)++; } int g; int main() { int c = __VERIFIER_nondet_int(); g = 3; // Globals are not tracked by apron for now assert(g != 3); // FAIL assert(g == 3); int a = 5; int *p = &a; // after this apron should put a to top because pointers are not tracked change(p); assert(a == 5); //FAIL assert(a - 6 == 0); return 0; }
Add test exhibiting problematic issue
Add test exhibiting problematic issue
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
8a4faca9d5432f6f1fe81cd05450ea5c173e3554
src/bin/e_widget_iconsel.h
src/bin/e_widget_iconsel.h
/* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ #ifdef E_TYPEDEFS #else #ifndef E_WIDGET_BUTTON_H #define E_WIDGET_BUTTON_H EAPI Evas_Object *e_widget_iconsel_add(Evas *evas, Evas_Object *icon, Evas_Coord minw, Evas_Coord minh, void (*func) (void *data, void *data2), void *data, void *data2); EAPI Evas_Object *e_widget_iconsel_add_from_file(Evas *evas, char *icon, Evas_Coord minw, Evas_Coord minh, void (*func) (void *data, void *data2), void *data, void *data2); EAPI void e_widget_iconsel_select_callback_add(Evas_Object *obj, void (*func)(Evas_Object *obj, char *file, void *data), void *data); #endif #endif
/* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ #ifdef E_TYPEDEFS #else #ifndef E_WIDGET_ICONSEL_H #define E_WIDGET_ICONSEL_H EAPI Evas_Object *e_widget_iconsel_add(Evas *evas, Evas_Object *icon, Evas_Coord minw, Evas_Coord minh, char **file); EAPI Evas_Object *e_widget_iconsel_add_from_file(Evas *evas, char *icon, Evas_Coord minw, Evas_Coord minh, char **file); EAPI void e_widget_iconsel_select_callback_add(Evas_Object *obj, void (*func)(Evas_Object *obj, char *file, void *data), void *data); #endif #endif
Correct define for this file. Fix function declarations.
Correct define for this file. Fix function declarations. git-svn-id: 0f3f1c46c6da7ffd142db61e503a7ff63af3a195@18291 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
C
bsd-2-clause
jordemort/e17,jordemort/e17,jordemort/e17
d8e29e5b07a0c9939cef51b5188b6df38fb9abc0
chrome/browser/history/web_history_service_factory.h
chrome/browser/history/web_history_service_factory.h
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_ #define CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_ #include "base/memory/singleton.h" #include "chrome/browser/profiles/profile.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" namespace history { class WebHistoryService; } // Used for creating and fetching a per-profile instance of the // WebHistoryService. class WebHistoryServiceFactory : public BrowserContextKeyedServiceFactory { public: // Get the singleton instance of the factory. static WebHistoryServiceFactory* GetInstance(); // Get the WebHistoryService for |profile|, creating one if needed. static history::WebHistoryService* GetForProfile(Profile* profile); protected: // Overridden from BrowserContextKeyedServiceFactory. KeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const override; private: friend struct DefaultSingletonTraits<WebHistoryServiceFactory>; explicit WebHistoryServiceFactory(); ~WebHistoryServiceFactory() override; DISALLOW_COPY_AND_ASSIGN(WebHistoryServiceFactory); }; #endif // CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_ #define CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_ #include "base/memory/singleton.h" #include "chrome/browser/profiles/profile.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" namespace history { class WebHistoryService; } // Used for creating and fetching a per-profile instance of the // WebHistoryService. class WebHistoryServiceFactory : public BrowserContextKeyedServiceFactory { public: // Get the singleton instance of the factory. static WebHistoryServiceFactory* GetInstance(); // Get the WebHistoryService for |profile|, creating one if needed. static history::WebHistoryService* GetForProfile(Profile* profile); protected: // Overridden from BrowserContextKeyedServiceFactory. KeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const override; private: friend struct DefaultSingletonTraits<WebHistoryServiceFactory>; WebHistoryServiceFactory(); ~WebHistoryServiceFactory() override; DISALLOW_COPY_AND_ASSIGN(WebHistoryServiceFactory); }; #endif // CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_
Remove explicit from zero-parameter constructor
Remove explicit from zero-parameter constructor Explicit in zero-parameter constructor does not effect so it can be removed. Remove explicit from WebHistoryServiceFactory constructor in chrome/browser/history/web_history_service_factory.h Review URL: https://codereview.chromium.org/1311533005 Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#346580}
C
bsd-3-clause
CapOM/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend
9f7344e6d253edb47a863a527bbffdb3e0d839e7
Programs/sys_prog_windows.h
Programs/sys_prog_windows.h
/* * BRLTTY - A background process providing access to the Linux console (when in * text mode) for a blind person using a refreshable braille display. * * Copyright (C) 1995-2004 by The BRLTTY Team. All rights reserved. * * BRLTTY comes with ABSOLUTELY NO WARRANTY. * * This is free software, placed under the terms of the * GNU General Public License, as published by the Free Software * Foundation. Please see the file COPYING for details. * * Web Page: http://mielke.cc/brltty/ * * This software is maintained by Dave Mielke <[email protected]>. */ char * getProgramPath (void) { CHAR path[MAX_PATH]; DWORD length = GetModuleFileName(GetModuleHandle(NULL), path, sizeof(path)); while (length > 0) if (path[--length] == '\\') path[length] = '/'; return strdupWrapper(path); }
/* * BRLTTY - A background process providing access to the Linux console (when in * text mode) for a blind person using a refreshable braille display. * * Copyright (C) 1995-2004 by The BRLTTY Team. All rights reserved. * * BRLTTY comes with ABSOLUTELY NO WARRANTY. * * This is free software, placed under the terms of the * GNU General Public License, as published by the Free Software * Foundation. Please see the file COPYING for details. * * Web Page: http://mielke.cc/brltty/ * * This software is maintained by Dave Mielke <[email protected]>. */ char * getProgramPath (void) { char *path = NULL; HMODULE handle; if ((handle = GetModuleHandle(NULL))) { size_t size = 0X80; char *buffer = NULL; while (1) { buffer = reallocWrapper(buffer, size<<=1); { DWORD length = GetModuleFileName(handle, buffer, size); if (!length) { LogWindowsError("GetModuleFileName"); break; } if (length < size) { buffer[length] = 0; path = strdupWrapper(buffer); while (length > 0) if (path[--length] == '\\') path[length] = '/'; break; } } } free(buffer); } else { LogWindowsError("GetModuleHandle"); } return path; }
Remove the use of PATH_MAX from the Windows implementation of getProgramPath(). (dm)
Remove the use of PATH_MAX from the Windows implementation of getProgramPath(). (dm) git-svn-id: 30a5f035a20f1bc647618dbad7eea2a951b61b7c@1287 91a5dbb7-01b9-0310-9b5f-b28072856b6e
C
lgpl-2.1
brltty/brltty,brltty/brltty,brltty/brltty,brltty/brltty,brltty/brltty,brltty/brltty
962be8ec763c4787bf00ccc06ac21d12467ffe7c
renderer/intersection_data.h
renderer/intersection_data.h
/* * Contains the information about an intersection. * Author: Dino Wernli */ #ifndef INTERSECTIONDATA_H_ #define INTERSECTIONDATA_H_ #include "scene/element.h" #include "scene/material.h" #include "util/point3.h" #include "util/ray.h" struct IntersectionData { // Builds a new struct for this specific ray. The ray is necessary in order to // initialize "t" to the maximum "t" allowed by the ray. IntersectionData(const Ray& ray) : t(ray.max_t()), element(NULL), material(NULL) {} Scalar t; Point3 position; Vector3 normal; const Element* element; const Material* material; }; #endif /* INTERSECTIONDATA_H_ */
/* * Contains the information about an intersection. * Author: Dino Wernli */ #ifndef INTERSECTIONDATA_H_ #define INTERSECTIONDATA_H_ #include "scene/element.h" #include "scene/material.h" #include "util/point3.h" #include "util/ray.h" struct IntersectionData { // Builds a new struct for this specific ray. The ray is necessary in order to // initialize "t" to the maximum "t" allowed by the ray. IntersectionData(const Ray& ray) : t(ray.max_t()), element(NULL), material(NULL) {} bool Intersected() const { return element != NULL; } Scalar t; Point3 position; Vector3 normal; const Element* element; const Material* material; }; #endif /* INTERSECTIONDATA_H_ */
Add intersected query to data.
Add intersected query to data.
C
mit
dinowernli/raytracer,dinowernli/raytracer,dinowernli/raytracer,dinowernli/raytracer
9fd7f1825289ff5e80ea03c2caf9859e3a214e42
src/net/include/scy/net/dns.h
src/net/include/scy/net/dns.h
/// // // LibSourcey // Copyright (c) 2005, Sourcey <https://sourcey.com> // // SPDX-License-Identifier: LGPL-2.1+ // /// @addtogroup net /// @{ #ifndef SCY_Net_DNS_H #define SCY_Net_DNS_H #include "scy/net/net.h" #include "scy/net/address.h" #include "scy/request.h" #include "scy/logger.h" #include "scy/util.h" namespace scy { namespace net { /// DNS utilities. namespace dns { inline auto resolve(const std::string& host, int port, std::function<void(int,const net::Address&)> callback, uv::Loop* loop = uv::defaultLoop()) { return uv::createRequest<uv::GetAddrInfoReq>([&](const uv::GetAddrInfoEvent& event) { if (event.status) { LWarn("Cannot resolve DNS for ", host, ": ", uv_strerror(event.status)) callback(event.status, net::Address{}); } else callback(event.status, net::Address{event.addr->ai_addr, 16}); }).resolve(host, port, loop); } } // namespace dns } // namespace net } // namespace scy #endif // SCY_Net_DNS_H /// @\}
/// // // LibSourcey // Copyright (c) 2005, Sourcey <https://sourcey.com> // // SPDX-License-Identifier: LGPL-2.1+ // /// @addtogroup net /// @{ #ifndef SCY_Net_DNS_H #define SCY_Net_DNS_H #include "scy/net/net.h" #include "scy/net/address.h" #include "scy/request.h" #include "scy/logger.h" #include "scy/util.h" namespace scy { namespace net { /// DNS utilities. namespace dns { inline auto resolve(const std::string& host, int port, std::function<void(int,const net::Address&)> callback, uv::Loop* loop = uv::defaultLoop()) { return uv::createRequest<uv::GetAddrInfoReq>([&](const uv::GetAddrInfoEvent& event) { if (event.status) { LWarn("Cannot resolve DNS for ", host, ": ", uv_strerror(event.status)) callback(event.status, net::Address{}); } else callback(event.status, net::Address{event.addr->ai_addr, event.addr->ai_addrlen}); }).resolve(host, port, loop); } } // namespace dns } // namespace net } // namespace scy #endif // SCY_Net_DNS_H /// @\}
Fix hardcoded address length (IPv6 address are > 16 in length)
Fix hardcoded address length (IPv6 address are > 16 in length)
C
lgpl-2.1
sourcey/libsourcey,sourcey/libsourcey,sourcey/libsourcey,sourcey/libsourcey
ec58d9e3ac445e96413d10957c2e2488a695e784
test/CodeGen/clear_cache.c
test/CodeGen/clear_cache.c
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s char buffer[32] = "This is a largely unused buffer"; // __builtin___clear_cache always maps to @llvm.clear_cache, but what // each back-end produces is different, and this is tested in LLVM int main() { __builtin___clear_cache(buffer, buffer+32); // CHECK: @llvm.clear_cache(i8* getelementptr {{.*}}, i8* getelementptr {{.*}} (i8* getelementptr {{.*}} 32)) return 0; }
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s char buffer[32] = "This is a largely unused buffer"; // __builtin___clear_cache always maps to @llvm.clear_cache, but what // each back-end produces is different, and this is tested in LLVM int main() { __builtin___clear_cache(buffer, buffer+32); // CHECK: @llvm.clear_cache(i8* getelementptr inbounds ({{.*}}, i8* getelementptr inbounds (i8* getelementptr inbounds ({{.*}} 32)) return 0; }
Update test case to be compatible with auto-migration to new getelementptr syntax coming in the near future
Update test case to be compatible with auto-migration to new getelementptr syntax coming in the near future The first change won't touch GEPOperators such as these, but the update script only identifies them by the leading '(' after getelementptr or 'getelementptr inbounds', so update this test to at least have those features to allow auto-migrating. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@229198 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
becac250828d4310614afe74480b9ed2a533c1f6
inc/m_util.h
inc/m_util.h
/*********************************** LICENSE **********************************\ * Copyright 2017 Morphux * * * * 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 M_UTIL # define M_UTIL # include <stdint.h> # include <sys/types.h> # include <sys/stat.h> # include <morphux.h> /*! * \brief Delete a directory recursively * * \param[in] dir Path of the directory to delete * * \return true on success, false on failure */ bool recursive_delete(const char *dir); #endif /* M_UTIL */
/*********************************** LICENSE **********************************\ * Copyright 2017 Morphux * * * * 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 M_UTIL # define M_UTIL # include <stdint.h> # include <sys/types.h> # include <sys/stat.h> # include <morphux.h> # define STR_OR_EMPTY(str) (str ? str : "") # define STR_NULL_OR_EMPTY(str) (str == NULL || (str != NULL && *str == '\0')) /*! * \brief Delete a directory recursively * * \param[in] dir Path of the directory to delete * * \return true on success, false on failure */ bool recursive_delete(const char *dir); #endif /* M_UTIL */
Add safe string macro checking
Add(Utils): Add safe string macro checking
C
apache-2.0
Morphux/lib,Morphux/lib
ae711dcfdf89c67492d604879a13d21dc55e44dc
tests/regression/04-mutex/73-simple_nr_spinlock.c
tests/regression/04-mutex/73-simple_nr_spinlock.c
#include <pthread.h> #include <stdio.h> int myglobal; pthread_spinlock_t spinlock1; pthread_spinlock_t spinlock2; void *t_fun(void *arg) { pthread_spin_lock(&spinlock1); myglobal=myglobal+1; // NORACE pthread_spin_unlock(&spinlock1); return NULL; } int main(void) { pthread_t id; pthread_create(&id, NULL, t_fun, NULL); pthread_spin_lock(&spinlock1); myglobal=myglobal+1; // NORACE pthread_spin_unlock(&spinlock1); pthread_join (id, NULL); return 0; }
#include <pthread.h> #include <stdio.h> #ifdef __APPLE__ int main(void) { // OS X has no spin_lock int x =5; //NORACE } #else int myglobal; pthread_spinlock_t spinlock1; pthread_spinlock_t spinlock2; void *t_fun(void *arg) { pthread_spin_lock(&spinlock1); myglobal=myglobal+1; // NORACE pthread_spin_unlock(&spinlock1); return NULL; } int main(void) { pthread_t id; pthread_create(&id, NULL, t_fun, NULL); pthread_spin_lock(&spinlock1); myglobal=myglobal+1; // NORACE pthread_spin_unlock(&spinlock1); pthread_join (id, NULL); return 0; } #endif
Work around Mac not having `pthread_spinlock`
Work around Mac not having `pthread_spinlock`
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
b340587e68b479e52039f800d7c60abd417e1975
arch/powerpc/sysdev/mpc5xxx_clocks.c
arch/powerpc/sysdev/mpc5xxx_clocks.c
/** * mpc5xxx_get_bus_frequency - Find the bus frequency for a device * @node: device node * * Returns bus frequency (IPS on MPC512x, IPB on MPC52xx), * or 0 if the bus frequency cannot be found. */ #include <linux/kernel.h> #include <linux/of_platform.h> #include <linux/export.h> #include <asm/mpc5xxx.h> unsigned long mpc5xxx_get_bus_frequency(struct device_node *node) { struct device_node *np; const unsigned int *p_bus_freq = NULL; of_node_get(node); while (node) { p_bus_freq = of_get_property(node, "bus-frequency", NULL); if (p_bus_freq) break; np = of_get_parent(node); of_node_put(node); node = np; } of_node_put(node); return p_bus_freq ? *p_bus_freq : 0; } EXPORT_SYMBOL(mpc5xxx_get_bus_frequency);
/** * mpc5xxx_get_bus_frequency - Find the bus frequency for a device * @node: device node * * Returns bus frequency (IPS on MPC512x, IPB on MPC52xx), * or 0 if the bus frequency cannot be found. */ #include <linux/kernel.h> #include <linux/of_platform.h> #include <linux/export.h> #include <asm/mpc5xxx.h> unsigned long mpc5xxx_get_bus_frequency(struct device_node *node) { const unsigned int *p_bus_freq = NULL; of_node_get(node); while (node) { p_bus_freq = of_get_property(node, "bus-frequency", NULL); if (p_bus_freq) break; node = of_get_next_parent(node); } of_node_put(node); return p_bus_freq ? *p_bus_freq : 0; } EXPORT_SYMBOL(mpc5xxx_get_bus_frequency);
Use of_get_next_parent to simplify code
powerpc/mpc5xxx: Use of_get_next_parent to simplify code of_get_next_parent can be used to simplify the while() loop and avoid the need of a temp variable. Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
C
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
5395ef04e96e5db3e86b11d362a9566d779a590d
test/CodeGen/bitfield.c
test/CodeGen/bitfield.c
// RUN: clang %s -emit-llvm -o - > %t1 // RUN: grep "shl i32 %tmp, 19" %t1 && // RUN: grep "ashr i32 %tmp1, 19" %t1 && // RUN: grep "shl i16 %tmp4, 1" %t1 && // RUN: grep "lshr i16 %tmp5, 9" %t1 && // RUN: grep "and i32 %tmp, -8192" %t1 && // RUN: grep "and i16 %tmp5, -32513" %t1 && // RUN: grep "getelementptr (i32\* bitcast (.struct.STestB2\* @stb2 to i32\*), i32 1)" %t1 // Test bitfield access struct STestB1 { int a:13; char b; unsigned short c:7;} stb1; struct STestB2 { short a[3]; int b:15} stb2; int f() { return stb1.a + stb1.b + stb1.c; } void g() { stb1.a = -40; stb1.b = 10; stb1.c = 15; } int h() { return stb2.a[1] + stb2.b; } void i(){ stb2.a[2] = -40; stb2.b = 10; }
// RUN: clang %s -emit-llvm -o - > %t1 // RUN: grep "shl i32 .*, 19" %t1 && // RUN: grep "ashr i32 .*, 19" %t1 && // RUN: grep "shl i16 .*, 1" %t1 && // RUN: grep "lshr i16 .*, 9" %t1 && // RUN: grep "and i32 .*, -8192" %t1 && // RUN: grep "and i16 .*, -32513" %t1 && // RUN: grep "getelementptr (i32\* bitcast (.struct.STestB2\* @stb2 to i32\*), i32 1)" %t1 // Test bitfield access struct STestB1 { int a:13; char b; unsigned short c:7;} stb1; struct STestB2 { short a[3]; int b:15} stb2; int f() { return stb1.a + stb1.b + stb1.c; } void g() { stb1.a = -40; stb1.b = 10; stb1.c = 15; } int h() { return stb2.a[1] + stb2.b; } void i(){ stb2.a[2] = -40; stb2.b = 10; }
Make this test actually pass, in addition to the previous patch which made it work.
Make this test actually pass, in addition to the previous patch which made it work. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@52382 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
01913372e8b7a8314cba41c329464bc3d355b477
modules/acct_rtcp_hep/_acct_rtcp_hep_config.h
modules/acct_rtcp_hep/_acct_rtcp_hep_config.h
static struct hep_ctx ctx = { .initfails = 0, .hints = {{ 0 }}, .capt_host = "10.0.0.1", .capt_port = "9060", .hints = {{ .ai_socktype = SOCK_DGRAM }}, .capt_id = 101, .hep_version = 3, .usessl = 0, .pl_compress = 0, .sendPacketsCount = 0 };
static struct hep_ctx ctx = { .initfails = 0, .hints = {{ .ai_socktype = SOCK_DGRAM }}, .capt_host = "10.0.0.1", .capt_port = "9060", .capt_id = 101, .hep_version = 3, .usessl = 0, .pl_compress = 0, .sendPacketsCount = 0 };
Move .hints definition in place.
Move .hints definition in place.
C
bsd-2-clause
dsanders11/rtpproxy,dsanders11/rtpproxy,sippy/rtpproxy,sippy/rtpproxy,sippy/rtpproxy,dsanders11/rtpproxy
467a9220714dbd8a03e7bd058c3ee062e2256ad3
gp11/tests/gp11-test.h
gp11/tests/gp11-test.h
#ifndef TESTGP11HELPERS_H_ #define TESTGP11HELPERS_H_ #include "gp11.h" #define FAIL_RES(res, e) do { \ g_assert ((res) ? FALSE : TRUE); \ g_assert ((e) && (e)->message && "error should be set"); \ g_clear_error (&e); \ } while (0) #define SUCCESS_RES(res, err) do { \ if (!(res)) g_printerr ("error: %s\n", err && err->message ? err->message : ""); \ g_assert ((res) ? TRUE : FALSE && "should have succeeded"); \ g_clear_error (&err); \ } while(0) #define WAIT_UNTIL(cond) \ while(!cond) g_main_iteration (TRUE); #endif /*TESTGP11HELPERS_H_*/
#ifndef TESTGP11HELPERS_H_ #define TESTGP11HELPERS_H_ #include "gp11.h" #define FAIL_RES(res, e) do { \ g_assert ((res) ? FALSE : TRUE); \ g_assert ((e) && (e)->message && "error should be set"); \ g_clear_error (&e); \ } while (0) #define SUCCESS_RES(res, err) do { \ if (!(res)) g_printerr ("error: %s\n", err && err->message ? err->message : ""); \ g_assert ((res) ? TRUE : FALSE && "should have succeeded"); \ g_clear_error (&err); \ } while(0) #define WAIT_UNTIL(cond) \ while(!cond) g_main_context_iteration (NULL, TRUE); #endif /*TESTGP11HELPERS_H_*/
Remove usage of deprecated glib stuff.
Remove usage of deprecated glib stuff. * configure.in: * gp11/tests/gp11-test.h: * common/gkr-location.c: Remove usage of deprecated glib stuff. svn path=/trunk/; revision=1362
C
lgpl-2.1
Distrotech/gcr,Distrotech/gcr,stefwalter/gcr,stefwalter/gcr,stefwalter/gcr,Distrotech/gcr,stefwalter/gcr,Distrotech/gcr
5e575839c8ac91262a171e51e3c188532d8802b9
init/main.c
init/main.c
/* * Common kernel entry point. */ #include <multiboot.h> #include <types.h> /* * This function is called by the architecture-specific boot proceedure, and * defines the entry to the euclid kernel. */ int k_main(struct multiboot *mboot, u32 stack); int k_main(struct multiboot *mboot, u32 stack) { /* For now let's just push a value to EAX (x86). */ return (int)0xABCDEFCC; }
Add a common kernel entry point
init: Add a common kernel entry point
C
mit
ChrisCummins/euclid,ChrisCummins/euclid,ChrisCummins/euclid
a261efe40af92ed1548d50a9997469ce5b4eab14
src/csapex_remote/include/csapex/io/session_client.h
src/csapex_remote/include/csapex/io/session_client.h
#ifndef SESSION_CLIENT_H #define SESSION_CLIENT_H /// PROJECT #include <csapex/io/session.h> /// SYSTEM #include <boost/asio.hpp> namespace csapex { class SessionClient : public Session { public: SessionClient(const std::string& ip, int port); ~SessionClient() override; std::string getDescription() const override; void run() override; void shutdown() override; bool isRunning() const override; private: boost::asio::io_service io_service; boost::asio::ip::tcp::socket socket_impl; boost::asio::ip::tcp::resolver resolver; boost::asio::ip::tcp::resolver::iterator resolver_iterator; bool io_service_running_; std::string ip_; int port_; }; } // namespace csapex #endif // SESSION_CLIENT_H
#ifndef SESSION_CLIENT_H #define SESSION_CLIENT_H /// PROJECT #include <csapex/io/session.h> /// SYSTEM #include <boost/asio.hpp> #include <boost/version.hpp> namespace csapex { class SessionClient : public Session { public: SessionClient(const std::string& ip, int port); ~SessionClient() override; std::string getDescription() const override; void run() override; void shutdown() override; bool isRunning() const override; private: boost::asio::io_service io_service; boost::asio::ip::tcp::socket socket_impl; boost::asio::ip::tcp::resolver resolver; #if (BOOST_VERSION / 100000) >= 1 && (BOOST_VERSION / 100 % 1000) >= 66 boost::asio::ip::tcp::resolver::endpoint_type resolver_iterator; #else // deprecated in boost 1.66 boost::asio::ip::tcp::resolver::iterator resolver_iterator; #endif bool io_service_running_; std::string ip_; int port_; }; } // namespace csapex #endif // SESSION_CLIENT_H
Fix depracted boost asio types
Fix depracted boost asio types
C
bsd-3-clause
cogsys-tuebingen/csapex,cogsys-tuebingen/csapex,cogsys-tuebingen/csapex,cogsys-tuebingen/csapex
6e5e7e6aef66653731d79e23d3cf46f464216687
src/engine/utils/include/halley/utils/type_traits.h
src/engine/utils/include/halley/utils/type_traits.h
#pragma once #include <type_traits> namespace Halley { // is_detected_v is based on https://en.cppreference.com/w/cpp/experimental/is_detected namespace detail { template<template<class...> class Expr, class... Args> std::false_type is_detected_impl(...); template<template<class...> class Expr, class... Args> std::true_type is_detected_impl(std::void_t<Expr<Args...>>*); } template<template<class...> class Expr, class... Args> using is_detected = decltype(detail::is_detected_impl<Expr, Args...>(nullptr)); template<template<class...> class Expr, class... Args> constexpr bool is_detected_v = is_detected<Expr, Args...>::value; }
#pragma once #include <type_traits> namespace Halley { // is_detected_v is based on https://en.cppreference.com/w/cpp/experimental/is_detected struct nonesuch { ~nonesuch() = delete; nonesuch(nonesuch const&) = delete; void operator=(nonesuch const&) = delete; }; namespace detail { template <class Default, class AlwaysVoid, template<class...> class Op, class... Args> struct detector { using value_t = std::false_type; using type = Default; }; template <class Default, template<class...> class Op, class... Args> struct detector<Default, std::void_t<Op<Args...>>, Op, Args...> { using value_t = std::true_type; using type = Op<Args...>; }; } template <template<class...> class Op, class... Args> using is_detected = typename detail::detector<nonesuch, void, Op, Args...>::value_t; template<template<class...> class Expr, class... Args> constexpr bool is_detected_v = is_detected<Expr, Args...>::value; }
Replace implementation of is_detected with one that works with gcc
Replace implementation of is_detected with one that works with gcc
C
apache-2.0
amzeratul/halley,amzeratul/halley,amzeratul/halley
40042b55d410a8c0adfb7a5b1ee27c55a72a731d
src/clientversion.h
src/clientversion.h
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning and copyright year // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 9 #define CLIENT_VERSION_REVISION 3 #define CLIENT_VERSION_BUILD 0 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true // Copyright year (2009-this) // Todo: update this when changing our copyright comments in the source #define COPYRIGHT_YEAR 2013 // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! #define STRINGIZE(X) DO_STRINGIZE(X) #define DO_STRINGIZE(X) #X #endif // CLIENTVERSION_H
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning and copyright year // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 9 #define CLIENT_VERSION_REVISION 5 #define CLIENT_VERSION_BUILD 0 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true // Copyright year (2009-this) // Todo: update this when changing our copyright comments in the source #define COPYRIGHT_YEAR 2014 // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! #define STRINGIZE(X) DO_STRINGIZE(X) #define DO_STRINGIZE(X) #X #endif // CLIENTVERSION_H
Update client version to 0.9.5
Update client version to 0.9.5
C
mit
coinkeeper/2015-06-22_18-49_unobtanium,unobtanium-official/Unobtanium,unobtanium-official/Unobtanium,coinkeeper/2015-06-22_18-49_unobtanium,coinkeeper/2015-06-22_18-49_unobtanium,coinkeeper/2015-06-22_18-49_unobtanium,unobtanium-official/Unobtanium,coinkeeper/2015-06-22_18-49_unobtanium,unobtanium-official/Unobtanium,coinkeeper/2015-06-22_18-49_unobtanium,unobtanium-official/Unobtanium,unobtanium-official/Unobtanium
6fc8ed69f82ff21ee5e0d43971da884c2fb00e71
tests/regression/36-octapron/17-traces-rpb-litmus.c
tests/regression/36-octapron/17-traces-rpb-litmus.c
// PARAM: --sets ana.activated[+] octApron #include <pthread.h> #include <assert.h> int g = 42; // matches write in t_fun pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&A); pthread_mutex_lock(&B); g = 42; pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); return NULL; } int main(void) { int r, t; pthread_t id; pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&A); pthread_mutex_lock(&B); if (r) { g = 17; pthread_mutex_unlock(&B); // publish to g#prot pthread_mutex_lock(&B); } // locally written g is only in one branch, g == g#prot should be forgotten! t = g; assert(t == 17); // UNKNOWN! pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); return 0; }
Add relational protection-based litmus test
Add relational protection-based litmus test
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
68722936310358dbba2342366e72f0777c2d0ab5
clacksd/src/transport-server/cl_discovery_thread.c
clacksd/src/transport-server/cl_discovery_thread.c
#include <syslog.h> #include "cl_discovery.h" #include "cl_discovery_thread.h" void * start_discovery(void * args) { syslog(LOG_INFO, "started discovery thread"); for (;;) { continue; } }
#include <stdlib.h> #include <syslog.h> #include "cl_discovery.h" #include "cl_discovery_thread.h" void * start_discovery(void * args) { syslog(LOG_INFO, "started discovery thread"); for (;;) { struct CL_Discovery_Transport *discovered_transport = malloc(sizeof(struct CL_Discovery_Transport)); wait_for_transport(discovered_transport); } }
Call into the discovery function and wait for someone to say hi
Call into the discovery function and wait for someone to say hi
C
mit
jamessnee/clacks,jamessnee/clacks,jamessnee/clacks
d7ff518be4c835e1af2fc80ae8c877460648ab71
Code/BasicFilters/otbLocalGradientVectorImageFilter.h
Code/BasicFilters/otbLocalGradientVectorImageFilter.h
/*========================================================================= Program: ORFEO Toolbox Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. See OTBCopyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef __otbLocalGradientVectorImageFilter_h #define __otbLocalGradientVectorImageFilter_h #include "otbUnaryFunctorNeighborhoodVectorImageFilter.h" #include <itkNumericTraits.h> namespace otb { namespace Functor { /** \class LocalGradientOperator * \brief Performs the calculation of LocalGradient derivation */ template < class TInput, class TOutput > class LocalGradientOperator { public: LocalGradientOperator() { } virtual ~LocalGradientOperator() { } TOutput operator() ( const TInput & input ) { /* * it is assumed that input and output have the same size */ unsigned int length = input.GetPixel(0).Size(); TOutput output ( length ); for ( unsigned int i = 0; i < length; i++ ) { output[i] = static_cast<typename TOutput::ValueType>( input.GetPixel(4)[i] - input.GetPixel(5)[i] / 2. - input.GetPixel(7)[i] / 2. ); } return output; } }; // end of functor class } // end of namespace Functor /** \class LocalGradientVectorImageFilter * \brief Implements the 3x3 Local Gradient to be processed on a vector image */ template < class TInputImage, class TOutputImage > class ITK_EXPORT LocalGradientVectorImageFilter : public UnaryFunctorNeighborhoodVectorImageFilter< TInputImage, TOutputImage, Functor::LocalGradientOperator< typename itk::ConstNeighborhoodIterator<TInputImage>, typename TOutputImage::PixelType > > { public: /** Standart class typedefs */ typedef LocalGradientVectorImageFilter Self; typedef UnaryFunctorNeighborhoodVectorImageFilter< TInputImage, TOutputImage, Functor::LocalGradientOperator< typename itk::ConstNeighborhoodIterator<TInputImage>, typename TOutputImage::PixelType > > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Creation through object factory macro */ itkTypeMacro(LocalGradientVectorImageFilter, ImageToImageFilter); protected: LocalGradientVectorImageFilter() { } virtual ~LocalGradientVectorImageFilter() { } private: LocalGradientVectorImageFilter( const Self & ); // Not implemented void operator=( const Self & ); // Not implemented }; // end of class } // end of namespace otb #endif // __otbLocalGradientVectorImageFilter_h
ADD Local Gardient (really high pass)
ADD Local Gardient (really high pass)
C
apache-2.0
orfeotoolbox/OTB,orfeotoolbox/OTB,orfeotoolbox/OTB,orfeotoolbox/OTB,orfeotoolbox/OTB,orfeotoolbox/OTB
9dfc4f8efb20c07e111c556843f914376187ba13
src/plugins/find/searchresultcolor.h
src/plugins/find/searchresultcolor.h
#ifndef SEARCHRESULTCOLOR_H #define SEARCHRESULTCOLOR_H #include <QColor> namespace Find { namespace Internal { struct SearchResultColor{ QColor textBackground; QColor textForeground; QColor highlightBackground; QColor highlightForeground; }; } // namespace Internal } // namespace Find #endif // SEARCHRESULTCOLOR_H
#ifndef SEARCHRESULTCOLOR_H #define SEARCHRESULTCOLOR_H #include <QColor> namespace Find { namespace Internal { class SearchResultColor{ public: QColor textBackground; QColor textForeground; QColor highlightBackground; QColor highlightForeground; }; } // namespace Internal } // namespace Find #endif // SEARCHRESULTCOLOR_H
Fix warning about struct/class mismatch
Fix warning about struct/class mismatch Change-Id: I832ea6ebf078e533623fb748809dd71b5abfb645 Reviewed-by: Eike Ziller <[email protected]>
C
lgpl-2.1
danimo/qt-creator,darksylinc/qt-creator,kuba1/qtcreator,amyvmiwei/qt-creator,martyone/sailfish-qtcreator,xianian/qt-creator,amyvmiwei/qt-creator,maui-packages/qt-creator,darksylinc/qt-creator,xianian/qt-creator,richardmg/qtcreator,colede/qtcreator,danimo/qt-creator,duythanhphan/qt-creator,kuba1/qtcreator,duythanhphan/qt-creator,danimo/qt-creator,AltarBeastiful/qt-creator,amyvmiwei/qt-creator,Distrotech/qtcreator,danimo/qt-creator,AltarBeastiful/qt-creator,martyone/sailfish-qtcreator,maui-packages/qt-creator,martyone/sailfish-qtcreator,xianian/qt-creator,danimo/qt-creator,duythanhphan/qt-creator,maui-packages/qt-creator,malikcjm/qtcreator,xianian/qt-creator,omniacreator/qtcreator,darksylinc/qt-creator,martyone/sailfish-qtcreator,darksylinc/qt-creator,xianian/qt-creator,Distrotech/qtcreator,martyone/sailfish-qtcreator,xianian/qt-creator,AltarBeastiful/qt-creator,amyvmiwei/qt-creator,kuba1/qtcreator,Distrotech/qtcreator,farseerri/git_code,xianian/qt-creator,darksylinc/qt-creator,AltarBeastiful/qt-creator,amyvmiwei/qt-creator,colede/qtcreator,AltarBeastiful/qt-creator,richardmg/qtcreator,colede/qtcreator,richardmg/qtcreator,farseerri/git_code,duythanhphan/qt-creator,darksylinc/qt-creator,richardmg/qtcreator,malikcjm/qtcreator,xianian/qt-creator,AltarBeastiful/qt-creator,martyone/sailfish-qtcreator,malikcjm/qtcreator,maui-packages/qt-creator,danimo/qt-creator,AltarBeastiful/qt-creator,colede/qtcreator,maui-packages/qt-creator,omniacreator/qtcreator,farseerri/git_code,malikcjm/qtcreator,colede/qtcreator,Distrotech/qtcreator,Distrotech/qtcreator,malikcjm/qtcreator,Distrotech/qtcreator,darksylinc/qt-creator,martyone/sailfish-qtcreator,kuba1/qtcreator,amyvmiwei/qt-creator,duythanhphan/qt-creator,farseerri/git_code,kuba1/qtcreator,kuba1/qtcreator,farseerri/git_code,kuba1/qtcreator,farseerri/git_code,omniacreator/qtcreator,amyvmiwei/qt-creator,farseerri/git_code,maui-packages/qt-creator,richardmg/qtcreator,omniacreator/qtcreator,omniacreator/qtcreator,richardmg/qtcreator,omniacreator/qtcreator,AltarBeastiful/qt-creator,danimo/qt-creator,kuba1/qtcreator,Distrotech/qtcreator,malikcjm/qtcreator,richardmg/qtcreator,amyvmiwei/qt-creator,xianian/qt-creator,duythanhphan/qt-creator,farseerri/git_code,kuba1/qtcreator,danimo/qt-creator,duythanhphan/qt-creator,danimo/qt-creator,martyone/sailfish-qtcreator,colede/qtcreator,darksylinc/qt-creator,maui-packages/qt-creator,martyone/sailfish-qtcreator,colede/qtcreator,omniacreator/qtcreator,malikcjm/qtcreator
612ff9b7e8e738c3a1a267d477ad7a39488fc97e
src/ccutil/tprintf.h
src/ccutil/tprintf.h
/********************************************************************** * File: tprintf.h * Description: Trace version of printf - portable between UX and NT * Author: Phil Cheatle * * (C) Copyright 1995, Hewlett-Packard Ltd. ** 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 TESSERACT_CCUTIL_TPRINTF_H #define TESSERACT_CCUTIL_TPRINTF_H #include "params.h" // for BOOL_VAR_H #include <tesseract/export.h> // for TESS_API namespace tesseract { // Disable some log messages by setting log_level > 0. extern INT_VAR_H(log_level); // Main logging function. extern TESS_API void tprintf( // Trace printf const char *format, ...); // Message } // namespace tesseract #endif // define TESSERACT_CCUTIL_TPRINTF_H
/********************************************************************** * File: tprintf.h * Description: Trace version of printf - portable between UX and NT * Author: Phil Cheatle * * (C) Copyright 1995, Hewlett-Packard Ltd. ** 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 TESSERACT_CCUTIL_TPRINTF_H #define TESSERACT_CCUTIL_TPRINTF_H #include "params.h" // for BOOL_VAR_H #include <tesseract/export.h> // for TESS_API namespace tesseract { // Disable some log messages by setting log_level > 0. extern TESS_API INT_VAR_H(log_level); // Main logging function. extern TESS_API void tprintf( // Trace printf const char *format, ...); // Message } // namespace tesseract #endif // define TESSERACT_CCUTIL_TPRINTF_H
Fix sw build error by using TESS_API for global variable log_level
Fix sw build error by using TESS_API for global variable log_level Signed-off-by: Stefan Weil <[email protected]>
C
apache-2.0
amitdo/tesseract,UB-Mannheim/tesseract,amitdo/tesseract,stweil/tesseract,amitdo/tesseract,tesseract-ocr/tesseract,UB-Mannheim/tesseract,stweil/tesseract,tesseract-ocr/tesseract,amitdo/tesseract,tesseract-ocr/tesseract,stweil/tesseract,tesseract-ocr/tesseract,UB-Mannheim/tesseract,amitdo/tesseract,stweil/tesseract,UB-Mannheim/tesseract,stweil/tesseract,tesseract-ocr/tesseract,UB-Mannheim/tesseract
02c6405e8736dbfcfbc8d2c8290fb4f3f7a063f1
src/util/countdown_latch.h
src/util/countdown_latch.h
// Copyright (c) 2013, Cloudera, inc. // // This is a C++ implementation of the Java CountDownLatch // class. // See http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/CountDownLatch.html #ifndef KUDU_UTIL_COUNTDOWN_LATCH_H #define KUDU_UTIL_COUNTDOWN_LATCH_H #include <boost/noncopyable.hpp> #include <boost/thread/mutex.hpp> namespace kudu { class CountDownLatch : boost::noncopyable { public: // Initialize the latch with the given initial count. CountDownLatch(int count) : count_(count) {} // Decrement the count of this latch. // If the new count is zero, then all waiting threads are woken up. // If the count is already zero, this has no effect. void CountDown() { boost::lock_guard<boost::mutex> lock(lock_); if (count_ == 0) { return; } if (--count_ == 0) { // Latch has triggered. cond_.notify_all(); } } // Wait until the count on the latch reaches zero. // If the count is already zero, this returns immediately. void Wait() { boost::unique_lock<boost::mutex> lock(lock_); while (count_ > 0) { cond_.wait(lock); } } // Wait on the latch for the given duration of time. // Return true if the latch reaches 0 within the given // timeout. Otherwise false. // // For example: // latch.TimedWait(boost::posix_time::milliseconds(100)); template<class TimeDuration> bool TimedWait(TimeDuration const &relative_time) { return TimedWait(boost::get_system_time() + relative_time); } // Wait on the latch until the given system time. // Return true if the latch reaches 0 within the given // timeout. Otherwise false. bool TimedWait(const boost::system_time &time_until) { boost::unique_lock<boost::mutex> lock(lock_); while (count_ > 0) { if (!cond_.timed_wait(lock, time_until)) { return false; } } return true; } uint64_t count() const { return count_; } private: mutable boost::mutex lock_; boost::condition_variable cond_; uint64_t count_; }; } // namespace kudu #endif
Add a CountDownLatch class like Java's
util: Add a CountDownLatch class like Java's This is handy in multi-threaded tests.
C
apache-2.0
andrwng/kudu,helifu/kudu,EvilMcJerkface/kudu,cloudera/kudu,helifu/kudu,cloudera/kudu,InspurUSA/kudu,andrwng/kudu,cloudera/kudu,EvilMcJerkface/kudu,EvilMcJerkface/kudu,helifu/kudu,andrwng/kudu,helifu/kudu,cloudera/kudu,cloudera/kudu,InspurUSA/kudu,cloudera/kudu,InspurUSA/kudu,EvilMcJerkface/kudu,EvilMcJerkface/kudu,InspurUSA/kudu,EvilMcJerkface/kudu,andrwng/kudu,InspurUSA/kudu,andrwng/kudu,helifu/kudu,helifu/kudu,andrwng/kudu,EvilMcJerkface/kudu,helifu/kudu,InspurUSA/kudu,andrwng/kudu,InspurUSA/kudu,cloudera/kudu,helifu/kudu,helifu/kudu,InspurUSA/kudu,EvilMcJerkface/kudu,cloudera/kudu,cloudera/kudu,InspurUSA/kudu,andrwng/kudu,andrwng/kudu,EvilMcJerkface/kudu
9af81a685e627783b65a9346fa02270a5b59b304
include/llvm/iOperators.h
include/llvm/iOperators.h
//===-- llvm/iBinary.h - Binary Operator node definitions --------*- C++ -*--=// // // This file contains the declarations of all of the Binary Operator classes. // //===----------------------------------------------------------------------===// #ifndef LLVM_IBINARY_H #define LLVM_IBINARY_H #include "llvm/InstrTypes.h" //===----------------------------------------------------------------------===// // Classes to represent Binary operators //===----------------------------------------------------------------------===// // // All of these classes are subclasses of the BinaryOperator class... // class AddInst : public BinaryOperator { public: AddInst(Value *S1, Value *S2, const string &Name = "") : BinaryOperator(Instruction::Add, S1, S2, Name) { } virtual string getOpcode() const { return "add"; } }; class SubInst : public BinaryOperator { public: SubInst(Value *S1, Value *S2, const string &Name = "") : BinaryOperator(Instruction::Sub, S1, S2, Name) { } virtual string getOpcode() const { return "sub"; } }; class SetCondInst : public BinaryOperator { BinaryOps OpType; public: SetCondInst(BinaryOps opType, Value *S1, Value *S2, const string &Name = ""); virtual string getOpcode() const; }; #endif
//===-- llvm/iBinary.h - Binary Operator node definitions --------*- C++ -*--=// // // This file contains the declarations of all of the Binary Operator classes. // //===----------------------------------------------------------------------===// #ifndef LLVM_IBINARY_H #define LLVM_IBINARY_H #include "llvm/InstrTypes.h" //===----------------------------------------------------------------------===// // Classes to represent Binary operators //===----------------------------------------------------------------------===// // // All of these classes are subclasses of the BinaryOperator class... // class GenericBinaryInst : public BinaryOperator { const char *OpcodeString; public: GenericBinaryInst(unsigned Opcode, Value *S1, Value *S2, const char *OpcodeStr, const string &Name = "") : BinaryOperator(Opcode, S1, S2, Name) { OpcodeString = OpcodeStr; } virtual string getOpcode() const { return OpcodeString; } }; class SetCondInst : public BinaryOperator { BinaryOps OpType; public: SetCondInst(BinaryOps opType, Value *S1, Value *S2, const string &Name = ""); virtual string getOpcode() const; }; #endif
Make a new GenericBinaryInst class, instead of providing lots of silly little classes.
Make a new GenericBinaryInst class, instead of providing lots of silly little classes. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@82 91177308-0d34-0410-b5e6-96231b3b80d8
C
bsd-2-clause
dslab-epfl/asap,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,chubbymaggie/asap
68b97b56e8c77a8010f181efcae3f41afa3d5002
MatrixSDK/Crypto/SecretStorage/MXSecretStorage_Private.h
MatrixSDK/Crypto/SecretStorage/MXSecretStorage_Private.h
/* Copyright 2020 The Matrix.org Foundation C.I.C 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. */ #import "MXSecretStorage.h" @class MXSession; NS_ASSUME_NONNULL_BEGIN @interface MXSecretStorage () /** Constructor. @param mxSession the related 'MXSession' instance. */ - (instancetype)initWithMatrixSession:(MXSession *)mxSession processingQueue:(dispatch_queue_t)processingQueue; @end NS_ASSUME_NONNULL_END
/* Copyright 2020 The Matrix.org Foundation C.I.C 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. */ #import "MXSecretStorage.h" @class MXSession; @class MXEncryptedSecretContent; NS_ASSUME_NONNULL_BEGIN @interface MXSecretStorage () /** Constructor. @param mxSession the related 'MXSession' instance. */ - (instancetype)initWithMatrixSession:(MXSession *)mxSession processingQueue:(dispatch_queue_t)processingQueue; - (nullable MXEncryptedSecretContent *)encryptedZeroStringWithPrivateKey:(NSData*)privateKey iv:(nullable NSData*)iv error:(NSError**)error; - (nullable MXEncryptedSecretContent *)encryptSecret:(NSString*)unpaddedBase64Secret withSecretId:(nullable NSString*)secretId privateKey:(NSData*)privateKey iv:(nullable NSData*)iv error:(NSError**)error; - (nullable NSString *)decryptSecretWithSecretId:(NSString*)secretId secretContent:(MXEncryptedSecretContent*)secretContent withPrivateKey:(NSData*)privateKey error:(NSError**)error; @end NS_ASSUME_NONNULL_END
Make aes-hmac-sha2 encryption methods from `MXSecretStorage` available in SDK
Make aes-hmac-sha2 encryption methods from `MXSecretStorage` available in SDK
C
apache-2.0
matrix-org/matrix-ios-sdk,matrix-org/matrix-ios-sdk,matrix-org/matrix-ios-sdk,matrix-org/matrix-ios-sdk,matrix-org/matrix-ios-sdk
38f3323037de22bb0089d08be27be01196e7148b
include/asm-generic/page.h
include/asm-generic/page.h
#ifndef _ASM_GENERIC_PAGE_H #define _ASM_GENERIC_PAGE_H #ifdef __KERNEL__ #ifndef __ASSEMBLY__ #include <linux/log2.h> /* * non-const pure 2^n version of get_order * - the arch may override these in asm/bitops.h if they can be implemented * more efficiently than using the arch log2 routines * - we use the non-const log2() instead if the arch has defined one suitable */ #ifndef ARCH_HAS_GET_ORDER static inline __attribute__((const)) int __get_order(unsigned long size, int page_shift) { #if BITS_PER_LONG == 32 && defined(ARCH_HAS_ILOG2_U32) int order = __ilog2_u32(size) - page_shift; return order >= 0 ? order : 0; #elif BITS_PER_LONG == 64 && defined(ARCH_HAS_ILOG2_U64) int order = __ilog2_u64(size) - page_shift; return order >= 0 ? order : 0; #else int order; size = (size - 1) >> (page_shift - 1); order = -1; do { size >>= 1; order++; } while (size); return order; #endif } #endif /** * get_order - calculate log2(pages) to hold a block of the specified size * @n - size * * calculate allocation order based on the current page size * - this can be used to initialise global variables from constant data */ #define get_order(n) \ ( \ __builtin_constant_p(n) ? \ ((n < (1UL << PAGE_SHIFT)) ? 0 : ilog2(n) - PAGE_SHIFT) : \ __get_order(n, PAGE_SHIFT) \ ) #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ #endif /* _ASM_GENERIC_PAGE_H */
#ifndef _ASM_GENERIC_PAGE_H #define _ASM_GENERIC_PAGE_H #ifdef __KERNEL__ #ifndef __ASSEMBLY__ #include <linux/compiler.h> /* Pure 2^n version of get_order */ static __inline__ __attribute_const__ int get_order(unsigned long size) { int order; size = (size - 1) >> (PAGE_SHIFT - 1); order = -1; do { size >>= 1; order++; } while (size); return order; } #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ #endif /* _ASM_GENERIC_PAGE_H */
Revert "[PATCH] LOG2: Alter get_order() so that it can make use of ilog2() on a constant"
Revert "[PATCH] LOG2: Alter get_order() so that it can make use of ilog2() on a constant" This reverts commit 39d61db0edb34d60b83c5e0d62d0e906578cc707. The commit was buggy in multiple ways: - the conversion to ilog2() was incorrect to begin with - it tested the wrong #defines, so on all architectures but FRV you'd never see the bug except for constant arguments. - the new "get_order()" macro used its arguments multiple times, and didn't even parenthesize them properly - despite the comments, it was not true that you could use it for constant initializers, since not all architectures even use the generic page.h header file. All of the problems are individually fixable, but it all boils down to: better just revert it, and re-do it from scratch. Cc: David Howells <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
C
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs
712c6cef810aa3c6635a677bc9eef7dd8e7cc599
tests/regression/02-base/93-ad-struct-offset.c
tests/regression/02-base/93-ad-struct-offset.c
// SKIP #include <assert.h> struct str{ int a; char c; }; int main(){ struct str a; char* ca = (char*) &a; void *ptr = &ca[4]; void *ptr2 = &a.c; int z = 1; // Alginment of struct fields, and thus result of the equality check here is implementation defined. if(ptr == ptr2){ z = 1; } else { z = 2; } // Aaccording to the C standard (section 6.2.8 in the C11 standard), // the alignment of fields in structs is implementation defined. // When compiling with GCC, the following check as an assert happens to hold. __goblint_check(z==1); //UNKNOWN! }
Add skipped regression test that exposes unsoundness when comparing addresses with integer and field offset.
Add skipped regression test that exposes unsoundness when comparing addresses with integer and field offset.
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
237c88f631c428a2a6afa4927a02c2f84939025c
Source/NSManagedObject+HYPURI.h
Source/NSManagedObject+HYPURI.h
@import CoreData; @interface NSManagedObject (HYPURI) - (NSString *)hyp_URI; @end
@import CoreData; @interface NSManagedObject (HYPURI) - (NSString *)hyp_URI; + (NSManagedObject *)managedObjectWithURI:(NSString *)URI inContext:(NSManagedObjectContext *)context; @end
Add method to retrieve object using an URI
Add method to retrieve object using an URI
C
mit
hyperoslo/NSManagedObject-HYPURI
6520b60844230204cf736f17b814d95b6c0e249b
webkit/glue/screen_info.h
webkit/glue/screen_info.h
// Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this // source code is governed by a BSD-style license that can be found in the // LICENSE file. #ifndef WEBKIT_GLUE_SCREEN_INFO_H_ #define WEBKIT_GLUE_SCREEN_INFO_H_ #include "base/gfx/rect.h" namespace webkit_glue { struct ScreenInfo { int depth; int depth_per_component; bool is_monochrome; gfx::Rect rect; gfx::Rect available_rect; }; } // namespace webkit_glue #endif // WEBKIT_GLUE_SCREEN_INFO_H_
Add missing file. Oops :(
Add missing file. Oops :( TBR=dglazkov Review URL: http://codereview.chromium.org/8789 git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@4338 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
C
bsd-3-clause
wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser
cc954580aab4e44ec294c878306060778fb29af1
Source/UnrealEnginePython/Public/UnrealEnginePython.h
Source/UnrealEnginePython/Public/UnrealEnginePython.h
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. #pragma once #include "ModuleManager.h" DECLARE_LOG_CATEGORY_EXTERN(LogPython, Log, All); class UNREALENGINEPYTHON_API FUnrealEnginePythonModule : public IModuleInterface { public: bool PythonGILAcquire(); void PythonGILRelease(); virtual void StartupModule() override; virtual void ShutdownModule() override; void RunString(char *); void RunFile(char *); void RunFileSandboxed(char *); private: void *ue_python_gil; // used by console void *main_dict; void *local_dict; }; struct FScopePythonGIL { FScopePythonGIL() { #if defined(UEPY_THREADING) UnrealEnginePythonModule = FModuleManager::LoadModuleChecked<FUnrealEnginePythonModule>("UnrealEnginePython"); safeForRelease = UnrealEnginePythonModule.PythonGILAcquire(); #endif } ~FScopePythonGIL() { #if defined(UEPY_THREADING) if (safeForRelease) { UnrealEnginePythonModule.PythonGILRelease(); } #endif } FUnrealEnginePythonModule UnrealEnginePythonModule; bool safeForRelease; };
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. #pragma once #include "ModuleManager.h" DECLARE_LOG_CATEGORY_EXTERN(LogPython, Log, All); class UNREALENGINEPYTHON_API FUnrealEnginePythonModule : public IModuleInterface { public: bool PythonGILAcquire(); void PythonGILRelease(); virtual void StartupModule() override; virtual void ShutdownModule() override; void RunString(char *); void RunFile(char *); void RunFileSandboxed(char *); private: void *ue_python_gil; // used by console void *main_dict; void *local_dict; void *main_module; }; struct FScopePythonGIL { FScopePythonGIL() { #if defined(UEPY_THREADING) UnrealEnginePythonModule = FModuleManager::LoadModuleChecked<FUnrealEnginePythonModule>("UnrealEnginePython"); safeForRelease = UnrealEnginePythonModule.PythonGILAcquire(); #endif } ~FScopePythonGIL() { #if defined(UEPY_THREADING) if (safeForRelease) { UnrealEnginePythonModule.PythonGILRelease(); } #endif } FUnrealEnginePythonModule UnrealEnginePythonModule; bool safeForRelease; };
Revert "Revert "Add support for the Python Stdout Log""
Revert "Revert "Add support for the Python Stdout Log"" This reverts commit 32671bbd7b2134d5d1912225eb47bb368ee3e7ab.
C
mit
getnamo/UnrealEnginePython,Orav/UnrealEnginePython,20tab/UnrealEnginePython,getnamo/UnrealEnginePython,Orav/UnrealEnginePython,kitelightning/UnrealEnginePython,getnamo/UnrealEnginePython,kitelightning/UnrealEnginePython,20tab/UnrealEnginePython,20tab/UnrealEnginePython,kitelightning/UnrealEnginePython,kitelightning/UnrealEnginePython,Orav/UnrealEnginePython,getnamo/UnrealEnginePython,kitelightning/UnrealEnginePython,Orav/UnrealEnginePython,20tab/UnrealEnginePython,20tab/UnrealEnginePython,getnamo/UnrealEnginePython
798e1889b6743be7d18a944a46442468004c8ed5
2DXngine.Test/src/Integration_Tiled/TiledFixture.h
2DXngine.Test/src/Integration_Tiled/TiledFixture.h
#pragma once #include "gtest\gtest.h" #include "../pugixml/src/pugixml.hpp" #include <Integrations\Tiled\Parsers\TileMapParser.h> #include <Integrations\Tiled\DataStructures\TiledMap.h> class TiledFixture : public ::testing::Test { protected: virtual void SetUp() { pugi::xml_document doc; auto parseResult = doc.load_file("./Content/TestMap.tmx"); auto parser = TileMapParser(); this->_parsedMap = parser.parse(doc.child("map")); } virtual void TearDown() { delete _parsedMap; } TiledMap * _parsedMap; };
#pragma once #include "gtest\gtest.h" #include "../pugixml/src/pugixml.hpp" #include <Integrations\Tiled\Parsers\TileMapParser.h> #include <Integrations\Tiled\DataStructures\TiledMap.h> #include "../../../2DXngine.Core/src/ContentManagement/AssetPath.h" class TiledFixture : public ::testing::Test { protected: virtual void SetUp() { AssetPath path = AssetPath::create("Content\\TestMap.tmx"); pugi::xml_document doc; auto parseResult = doc.load_file(path.get_fullPath().c_str()); auto parser = TileMapParser(); this->_parsedMap = parser.parse(doc.child("map")); } virtual void TearDown() { delete _parsedMap; } TiledMap * _parsedMap; };
Fix path to map xml
EDIT: Fix path to map xml
C
mit
Harunx9/2DXngine,Harunx9/2DXngine,Harunx9/2DXngine
f5a38eb8883ac9a838b2db4a7bbffa244931da4e
ObjectiveRocks/RocksDBMergeOperator.h
ObjectiveRocks/RocksDBMergeOperator.h
// // RocksDBMergeOperator.h // ObjectiveRocks // // Created by Iska on 07/12/14. // Copyright (c) 2014 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> @interface RocksDBMergeOperator : NSObject + (instancetype)operatorWithName:(NSString *)name andBlock:(id (^)(id key, id existingValue, id value))block; + (instancetype)operatorWithName:(NSString *)name partialMergeBlock:(NSString * (^)(id key, NSString *leftOperand, NSString *rightOperand))partialMergeBlock fullMergeBlock:(id (^)(id key, id existingValue, NSArray *operandList))fullMergeBlock; @end
// // RocksDBMergeOperator.h // ObjectiveRocks // // Created by Iska on 07/12/14. // Copyright (c) 2014 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> /** A Merge operator is an atomic Read-Modify-Write operation in RocksDB. */ @interface RocksDBMergeOperator : NSObject /** Initializes a new instance of an associative merge operator. @discussion This Merge Operator can be use for associative data: * The merge operands are formatted the same as the Put values, AND * It is okay to combine multiple operands into one (as long as they are in the same order) @param name The name of the merge operator. @param block The block that merges the existing and new values for the given key. @return A newly-initialized instance of the Merge Operator. */ + (instancetype)operatorWithName:(NSString *)name andBlock:(id (^)(id key, id existingValue, id value))block; /** Initializes a new instance of a generic merge operator. @discussion If either of the two associativity constraints do not hold, then the Generic Merge Operator could be used. The Generic Merge Operator has two methods, PartialMerge, FullMerge: * PartialMerge: used to combine two-merge operands (if possible). If the client-specified operator can logically handle “combining” two merge-operands into a single operand, the semantics for doing so should be provided in this method, which should then return a non-nil object. If `nil` is returned, then it means that the two merge-operands couldn’t be combined into one. * FullMerge: this function is given an existingValue and a list of operands that have been stacked. The client-specified MergeOperator should then apply the operands one-by-one and return the resulting object. If `nil` is returned, then this indicates a failure, i.e. corrupted data, errors ... etc. @param name The name of the merge operator. @param partialMergeBlock The block to perform a partial merge. @param fullMergeBlock The block to perform the full merge. @return A newly-initialized instance of the Merge Operator. */ + (instancetype)operatorWithName:(NSString *)name partialMergeBlock:(NSString * (^)(id key, NSString *leftOperand, NSString *rightOperand))partialMergeBlock fullMergeBlock:(id (^)(id key, id existingValue, NSArray *operandList))fullMergeBlock; @end
Add source code documentation for the Merge Operator class
Add source code documentation for the Merge Operator class
C
mit
iabudiab/ObjectiveRocks,iabudiab/ObjectiveRocks,iabudiab/ObjectiveRocks,iabudiab/ObjectiveRocks
1b1421b65b363e29db2d022f2bff39cef99efc5a
AppKit/DataViewController/AKTableViewCellAdapter.h
AppKit/DataViewController/AKTableViewCellAdapter.h
// // AKTableViewCellAdapter.h // AppKit // // Created by Zijiao Liu on 12/20/15. // Copyright © 2015 Zijiao Liu. All rights reserved. // #import "AKTableViewConfiguration.h" #import "AKTableViewCell.h" @interface AKTableViewCellAdapter : NSObject <AKTableViewConfiguration> - (CGFloat)dataViewController:(nonnull AKDataViewController *)dataViewController item:(nonnull id<NSObject>)item groupStyle:(AKTableViewCellGroupStyle)groupStyle seperatorEnabled:(BOOL)seperatorEnabled heightForRowAtIndexPath:(nonnull NSIndexPath *)indexPath; @end
// // AKTableViewCellAdapter.h // AppKit // // Created by Zijiao Liu on 12/20/15. // Copyright © 2015 Zijiao Liu. All rights reserved. // #import "AKTableViewConfiguration.h" #import "AKTableViewCell.h" @interface AKTableViewCellAdapter : NSObject <AKTableViewConfiguration> - (CGFloat)dataViewController:(nonnull AKDataViewController *)dataViewController item:(nonnull id<NSObject>)item heightForRowAtIndexPath:(nonnull NSIndexPath *)indexPath NS_UNAVAILABLE; - (CGFloat)dataViewController:(nonnull AKDataViewController *)dataViewController item:(nonnull id<NSObject>)item groupStyle:(AKTableViewCellGroupStyle)groupStyle seperatorEnabled:(BOOL)seperatorEnabled heightForRowAtIndexPath:(nonnull NSIndexPath *)indexPath; @end
Disable a method in adapter
Disable a method in adapter
C
apache-2.0
lingguang1997/AppKit
7b3e6a03279e775974dd43f7ff643f170fc08d1c
Stripe/STPLocalizationUtils.h
Stripe/STPLocalizationUtils.h
// // STPLocalizedStringUtils.h // Stripe // // Created by Brian Dorfman on 8/11/16. // Copyright © 2016 Stripe, Inc. All rights reserved. // #import <Foundation/Foundation.h> #define STPLocalizedString(key, comment) \ [STPLocalizationUtils localizedStripeStringForKey:(key)] @interface STPLocalizationUtils : NSObject /** Acts like NSLocalizedString but tries to find the string in the Stripe bundle first if possible. */ + (nonnull NSString *)localizedStripeStringForKey:(nonnull NSString *)key; @end
// // STPLocalizationUtils.h // Stripe // // Created by Brian Dorfman on 8/11/16. // Copyright © 2016 Stripe, Inc. All rights reserved. // #import <Foundation/Foundation.h> @interface STPLocalizationUtils : NSObject /** Acts like NSLocalizedString but tries to find the string in the Stripe bundle first if possible. */ + (nonnull NSString *)localizedStripeStringForKey:(nonnull NSString *)key; @end static inline NSString * _Nonnull STPLocalizedString(NSString* _Nonnull key, NSString * _Nullable __unused comment) { return [STPLocalizationUtils localizedStripeStringForKey:key]; }
Change to use inline function instead of macro.
Change to use inline function instead of macro. This makes FauxPas's localization checks work properly.
C
mit
stripe/stripe-ios,NewAmsterdamLabs/stripe-ios,stripe/stripe-ios,fbernardo/stripe-ios,fbernardo/stripe-ios,stripe/stripe-ios,stripe/stripe-ios,stripe/stripe-ios,NewAmsterdamLabs/stripe-ios,fbernardo/stripe-ios,NewAmsterdamLabs/stripe-ios,stripe/stripe-ios,NewAmsterdamLabs/stripe-ios,fbernardo/stripe-ios
db053d481db41887771dccc52a61b7123f5011a2
BRScroller/BRScrollerUtilities.c
BRScroller/BRScrollerUtilities.c
// // BRScrollerUtilities.c // BRScroller // // Created by Matt on 7/11/13. // Copyright (c) 2013 Blue Rocket. Distributable under the terms of the Apache License, Version 2.0. // #include "BRScrollerUtilities.h" #if !defined(MIN) #define MIN(A,B) ((A) < (B) ? (A) : (B)) #endif inline bool BRFloatsAreEqual(CGFloat a, CGFloat b) { const CGFloat d = a - b; return (d < 0 ? -d : d) < 1e-4; } inline CGSize BRAspectSizeToFit(CGSize aSize, CGSize maxSize) { CGFloat scale = 1.0; if ( aSize.width > 0.0 && aSize.height > 0.0 ) { CGFloat dw = maxSize.width / aSize.width; CGFloat dh = maxSize.height / aSize.height; scale = dw < dh ? dw : dh; } return CGSizeMake(MIN(floorf(maxSize.width), ceilf(aSize.width * scale)), MIN(floorf(maxSize.height), ceilf(aSize.height * scale))); }
// // BRScrollerUtilities.c // BRScroller // // Created by Matt on 7/11/13. // Copyright (c) 2013 Blue Rocket. Distributable under the terms of the Apache License, Version 2.0. // #include "BRScrollerUtilities.h" #include <math.h> #include <sys/param.h> inline bool BRFloatsAreEqual(CGFloat a, CGFloat b) { const CGFloat d = a - b; return (d < 0 ? -d : d) < 1e-4; } inline CGSize BRAspectSizeToFit(CGSize aSize, CGSize maxSize) { CGFloat scale = 1.0; if ( aSize.width > 0.0 && aSize.height > 0.0 ) { CGFloat dw = maxSize.width / aSize.width; CGFloat dh = maxSize.height / aSize.height; scale = dw < dh ? dw : dh; } return CGSizeMake(MIN(floorf(maxSize.width), ceilf(aSize.width * scale)), MIN(floorf(maxSize.height), ceilf(aSize.height * scale))); }
Fix includes to just what is needed.
Fix includes to just what is needed.
C
apache-2.0
Blue-Rocket/BRScroller,Blue-Rocket/BRScroller
b912fb63cd043f653cdba9abe0b5a1c4b5ebb9c0
RxHyperdrive/RxHyperdrive.h
RxHyperdrive/RxHyperdrive.h
// // RxHyperdrive.h // RxHyperdrive // // Created by Kyle Fuller on 13/09/2015. // Copyright © 2015 Cocode. All rights reserved. // #import <Cocoa/Cocoa.h> //! Project version number for RxHyperdrive. FOUNDATION_EXPORT double RxHyperdriveVersionNumber; //! Project version string for RxHyperdrive. FOUNDATION_EXPORT const unsigned char RxHyperdriveVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <RxHyperdrive/PublicHeader.h>
// // RxHyperdrive.h // RxHyperdrive // // Created by Kyle Fuller on 13/09/2015. // Copyright © 2015 Cocode. All rights reserved. // @import Foundation; //! Project version number for RxHyperdrive. FOUNDATION_EXPORT double RxHyperdriveVersionNumber; //! Project version string for RxHyperdrive. FOUNDATION_EXPORT const unsigned char RxHyperdriveVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <RxHyperdrive/PublicHeader.h>
Use Foundation in the umbrella header
Use Foundation in the umbrella header
C
mit
kylef/RxHyperdrive,kylef/RxHyperdrive
bbc8175c39f85465475c9f96048d8107848e3e6f
include/clang/Serialization/ASTSerializationListener.h
include/clang/Serialization/ASTSerializationListener.h
//===- ASTSerializationListener.h - Decl/Type PCH Write Events -*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the ASTSerializationListener class, which is notified // by the ASTWriter when an entity is serialized. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_FRONTEND_AST_SERIALIZATION_LISTENER_H #define LLVM_CLANG_FRONTEND_AST_SERIALIZATION_LISTENER_H #include "llvm/System/DataTypes.h" namespace clang { class PreprocessedEntity; /// \brief Listener object that receives callbacks when certain kinds of /// entities are serialized. class ASTSerializationListener { public: virtual ~ASTSerializationListener(); /// \brief Callback invoked whenever a preprocessed entity is serialized. /// /// This callback will only occur when the translation unit was created with /// a detailed preprocessing record. /// /// \param Entity The entity that has been serialized. /// /// \param Offset The offset (in bits) of this entity in the resulting /// AST file. virtual void SerializedPreprocessedEntity(PreprocessedEntity *Entity, uint64_t Offset) = 0; }; } #endif
Add missing file from last commit
Add missing file from last commit git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@120397 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,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
9451ae2576903f202a8fe6a065eb83a3aaa24de8
seccure/test/test_gcrypt.c
seccure/test/test_gcrypt.c
/* * test_gcrypt - Copyright 2009 Slide, Inc. * * 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 */ #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <glib.h> #include <gcrypt.h> void __test_mpi_scan() { const char *order = "ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"; char *outbuf; gcry_mpi_t point = gcry_mpi_new(0); int rc = 0; int n = 0; rc = gcry_mpi_scan(&point, GCRYMPI_FMT_HEX, order, 0, NULL); g_assert(rc == 0); fprintf(stderr, "OUT %s : %d\n", outbuf, n); } int main(int argc, char **argv) { int rc = 0; g_test_init(&argc, &argv, NULL); /* * Test some basic mpi operations */ g_test_add_func("/mpi/scan", __test_mpi_scan); rc = g_test_run(); fflush(stderr); return rc; }
Add a simple test to play with libgcrypt
Add a simple test to play with libgcrypt
C
lgpl-2.1
rtyler/PyECC,rtyler/PyECC,slideinc/PyECC,slideinc/PyECC
eda89b4fcfe6a529d2194cf54546a814731b67bc
bindings/muen/muen-yield.c
bindings/muen/muen-yield.c
/* * Copyright (c) 2017 Contributors as noted in the AUTHORS file * * This file is part of Solo5, a sandboxed execution environment. * * 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. */ #include "../bindings.h" #include "muen-net.h" bool solo5_yield(uint64_t deadline) { bool rc = false; do { if (muen_net_pending_data()) { rc = true; break; } __asm__ __volatile__("pause"); } while (solo5_clock_monotonic() < deadline); if (muen_net_pending_data()) { rc = true; } return rc; }
/* * Copyright (c) 2017 Contributors as noted in the AUTHORS file * * This file is part of Solo5, a sandboxed execution environment. * * 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. */ #include "../bindings.h" #include "muen-net.h" void solo5_yield(solo5_time_t deadline, solo5_handle_set_t *ready_set) { solo5_handle_set_t tmp_ready_set = 0; do { for (solo5_handle_t i = 0U; i < MFT_MAX_ENTRIES; ++i) { if (muen_net_pending_data(i)) tmp_ready_set |= 1UL << i; } if (tmp_ready_set > 0) break; __asm__ __volatile__("pause"); } while (solo5_clock_monotonic() < deadline); if (ready_set) *ready_set = tmp_ready_set; }
Rework solo5_yield to support multiple devices
muen: Rework solo5_yield to support multiple devices
C
isc
mato/solo5,mato/solo5,Solo5/solo5,Solo5/solo5,mato/solo5
0c4431765bbcdc19826068ce34c2de2b2fca22d5
src/items.h
src/items.h
/*------------------------------------------------------------------------------ | NuCTex | items.h | Author | Benjamin A - Nullsrc | Created | 17 January, 2016 | Changed | 17 January, 2016 |------------------------------------------------------------------------------- | Overview | Declare item structures used in the code \-----------------------------------------------------------------------------*/ #ifndef NULLSRC_ITEMS_HEADER #define NULLSRC_ITEMS_HEADER typedef struct Item { char* name; char* description; int id; float size; float weight; int strength; int agility; int intelligence; int charisma; } Item; typedef struct Inventory { item[26]; } Inventory;
Add definition for item structs
Add definition for item structs
C
mit
Nullsrc/nuctex,Nullsrc/nuctex
e1829b05d441cd768a52ceb81af3a906ee6c219c
src/payload/setup-object.h
src/payload/setup-object.h
#ifndef RCR_LEVEL1PAYLOAD_SETUP_H_ #define RCR_LEVEL1PAYLOAD_SETUP_H_ #if defined(ARDUINO) && ARDUINO >= 100 #include "arduino.h" #else #include "WProgram.h" #endif namespace rcr { namespace level1payload { // Setup the object. Swallow any errors. template<typename T> inline void setup_object(T& obj, const char* error_message, const char* success_message) { if (!obj.begin()) { Serial.println(error_message); // Swallow the error. Fault tolerance is required. } else { Serial.println(success_message); } Serial.println(); } } // namespace level1_payload } // namespace rcr #endif // RCR_LEVEL1PAYLOAD_SETUP_H_
#ifndef RCR_LEVEL1PAYLOAD_SETUP_H_ #define RCR_LEVEL1PAYLOAD_SETUP_H_ #if defined(ARDUINO) && ARDUINO >= 100 #include "arduino.h" #else #include "WProgram.h" #endif namespace rcr { namespace level1payload { // Setup the object. Swallow any errors. template<typename T, typename TArg> inline void setup_object(T& obj, TArg arg, const char* display_name) { if (!obj.begin(arg)) { Serial.print("ERROR: "); Serial.print(display_name); Serial.println(" could not be found or setup."); // Swallow the error. Fault tolerance is required. } else { Serial.print("Success: "); Serial.print(display_name); Serial.println(" ready."); } Serial.println(); } template<typename T> inline void setup_object(T& obj, const char* display_name) { if (!obj.begin()) { Serial.print("ERROR: "); Serial.print(display_name); Serial.println(" could not be found or setup."); // Swallow the error. Fault tolerance is required. } else { Serial.print("Success: "); Serial.print(display_name); Serial.println(" ready."); } Serial.println(); } } // namespace level1_payload } // namespace rcr #endif // RCR_LEVEL1PAYLOAD_SETUP_H_
Add template overload for begin() arguments
Add template overload for begin() arguments
C
mit
nolanholden/payload-level1-rocket,nolanholden/geovis,nolanholden/geovis,nolanholden/geovis
cb808fbb23fbfcac41b9436a92d4a223b4d01fda
views/view_constants.h
views/view_constants.h
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef VIEWS_VIEW_CONSTANTS_H_ #define VIEWS_VIEW_CONSTANTS_H_ #pragma once #include "views/views_export.h" namespace views { // Size (width or height) within which the user can hold the mouse and the // view should scroll. extern const int kAutoscrollSize; // Time in milliseconds to autoscroll by a row. This is used during drag and // drop. extern const int kAutoscrollRowTimerMS; // Used to determine whether a drop is on an item or before/after it. If a drop // occurs kDropBetweenPixels from the top/bottom it is considered before/after // the item, otherwise it is on the item. VIEWS_EXPORT extern const int kDropBetweenPixels; } // namespace views #endif // VIEWS_VIEW_CONSTANTS_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef VIEWS_VIEW_CONSTANTS_H_ #define VIEWS_VIEW_CONSTANTS_H_ #pragma once #include "views/views_export.h" namespace views { // Size (width or height) within which the user can hold the mouse and the // view should scroll. VIEWS_EXPORT extern const int kAutoscrollSize; // Time in milliseconds to autoscroll by a row. This is used during drag and // drop. VIEWS_EXPORT extern const int kAutoscrollRowTimerMS; // Used to determine whether a drop is on an item or before/after it. If a drop // occurs kDropBetweenPixels from the top/bottom it is considered before/after // the item, otherwise it is on the item. VIEWS_EXPORT extern const int kDropBetweenPixels; } // namespace views #endif // VIEWS_VIEW_CONSTANTS_H_
Add VIEWS_EXPORT to autoscroll constants.
Add VIEWS_EXPORT to autoscroll constants. Referenced by browser/bookmarks/bookmark_drop_info.cc, fixes link when in component and incremental linking on Windows. BUG= TEST=Links in Component build mode Review URL: http://codereview.chromium.org/7741017 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@98281 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
yitian134/chromium,ropik/chromium,yitian134/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,gavinp/chromium,adobe/chromium,ropik/chromium,yitian134/chromium,yitian134/chromium,ropik/chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,adobe/chromium,gavinp/chromium,ropik/chromium,adobe/chromium,gavinp/chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,gavinp/chromium,ropik/chromium,gavinp/chromium,adobe/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,adobe/chromium
cc7b316872403c586627bd909bb596801e4a67cf
test/clear-similar-keys.c
test/clear-similar-keys.c
#include "sphia-test.h" // See #51 static void test_clear_similar_keys() { sphia_set(sphia, "key-1", "hello world"); sphia_set(sphia, "key-10", "hello world"); assert(2 == sphia_count(sphia)); assert(0 == sphia_clear(sphia)); assert(0 == sphia_count(sphia)); } TEST(test_clear_similar_keys);
#include "sphia-test.h" // See #51 static void test_clear_similar_keys() { sphia_set(sphia, "key-1", "hello world"); sphia_set(sphia, "key-10", "hello world"); sphia_set(sphia, "00000000", "hello world"); sphia_set(sphia, "000000000", "hello world"); assert(4 == sphia_count(sphia)); assert(0 == sphia_clear(sphia)); assert(0 == sphia_count(sphia)); } TEST(test_clear_similar_keys);
Update clear test to use keys longer than 8 chars
Update clear test to use keys longer than 8 chars
C
mit
sphia/sphia,sphia/sphia,sphia/sphia
b2a14a335095b42f02edabdf96bdf6480da2c9f7
tests/regression/13-privatized/67-pthread_cond_wait.c
tests/regression/13-privatized/67-pthread_cond_wait.c
#include<pthread.h> #include<stdio.h> #include<unistd.h> #include <assert.h> int g; pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t cond = PTHREAD_COND_INITIALIZER; void* f1(void* ptr) { pthread_mutex_lock(&mut); g = 1; pthread_cond_wait(&cond,&mut); assert(g == 0); // TODO (no cond-flow support) printf("g is %i", g); g = 0; pthread_mutex_unlock(&mut); } void* f2(void* ptr) { pthread_mutex_lock(&mut); assert(g == 0); //UNKNOWN! g = 0; pthread_cond_signal(&cond); pthread_mutex_unlock(&mut); } int main(int argc, char const *argv[]) { pthread_t t1; pthread_t t2; pthread_create(&t1,NULL,f1,NULL); sleep(1); pthread_create(&t2,NULL,f2,NULL); pthread_join(t1, NULL); pthread_join(t2, NULL); return 0; }
#include<pthread.h> #include<stdio.h> #include<unistd.h> #include <assert.h> int g; pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t cond = PTHREAD_COND_INITIALIZER; void* f1(void* ptr) { pthread_mutex_lock(&mut); g = 1; pthread_cond_wait(&cond,&mut); assert(g == 0); // TODO (no cond-flow support) printf("g is %i", g); g = 0; pthread_mutex_unlock(&mut); return NULL; } void* f2(void* ptr) { pthread_mutex_lock(&mut); assert(g == 0); //UNKNOWN! g = 0; pthread_cond_signal(&cond); pthread_mutex_unlock(&mut); return NULL; } int main(int argc, char const *argv[]) { pthread_t t1; pthread_t t2; pthread_create(&t1,NULL,f1,NULL); sleep(1); pthread_create(&t2,NULL,f2,NULL); pthread_join(t1, NULL); pthread_join(t2, NULL); return 0; }
Add missing return to 13/67
Add missing return to 13/67
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
40559fbb000bece563eb4b8c0fba875990ddf083
libcef_dll/cef_macros.h
libcef_dll/cef_macros.h
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. #ifndef CEF_LIBCEF_DLL_CEF_MACROS_H_ #define CEF_LIBCEF_DLL_CEF_MACROS_H_ #pragma once #ifdef BUILDING_CEF_SHARED #include "base/macros.h" #else // !BUILDING_CEF_SHARED // A macro to disallow the copy constructor and operator= functions // This should be used in the private: declarations for a class #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&); \ void operator=(const TypeName&) #endif // !BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CEF_MACROS_H_ // Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. #ifndef CEF_LIBCEF_DLL_CEF_MACROS_H_ #define CEF_LIBCEF_DLL_CEF_MACROS_H_ #pragma once #ifdef BUILDING_CEF_SHARED #include "base/macros.h" #else // !BUILDING_CEF_SHARED // A macro to disallow the copy constructor and operator= functions // This should be used in the private: declarations for a class #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&); \ void operator=(const TypeName&) #endif // !BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CEF_MACROS_H_
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. #ifndef CEF_LIBCEF_DLL_CEF_MACROS_H_ #define CEF_LIBCEF_DLL_CEF_MACROS_H_ #pragma once #ifdef BUILDING_CEF_SHARED #include "base/macros.h" #else // !BUILDING_CEF_SHARED // A macro to disallow the copy constructor and operator= functions // This should be used in the private: declarations for a class #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&); \ void operator=(const TypeName&) #endif // !BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CEF_MACROS_H_
Remove duplicate content in file.
Remove duplicate content in file.
C
bsd-3-clause
amikey/chromium,amikey/chromium,amikey/chromium,amikey/chromium,amikey/chromium
62c8c410b0c5063bed0ea598a89387854667e14c
Variable.h
Variable.h
using namespace std; vector<int> Int; vector<string> Name; int CheckForInt(string ProcessInput) { if (ProcessInput.substr(0, 3) == "int") { int EqualLocation; int SemicolonLocation; stringstream Number; stringstream StringName; int FinalNumber; string FinalName; EqualLocation = ProcessInput.find("="); EqualLocation++; SemicolonLocation = ProcessInput.find(";"); Number << ProcessInput.substr(EqualLocation, SemicolonLocation); Number >> FinalNumber; StringName << ProcessInput.substr(4, EqualLocation); StringName >> FinalName; cout << FinalName << " = " << FinalNumber << "\n\n"; Int.push_back(FinalNumber); Name.push_back(FinalName); } return 0; }
Add integer interpret and register algorithm.
Add integer interpret and register algorithm. This algorithm uses vectors and standard C++ functions to register integers into the program with name and value corresponding in order. There's another algorithm that will make the program be able to retrieve the results using the console out function. Which that algorithm is still being tested and soon will be committed into the GitHub project when it is completed.
C
mit
Project-CPP/CPP-Interpreter
5041a2011a8f68aaf252f634ba5bd2bd198229b3
src/epollinterface.c
src/epollinterface.c
#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <sys/epoll.h> #include "epollinterface.h" #define MAX_EPOLL_EVENTS 10 void add_epoll_handler(int epoll_fd, struct epoll_event_handler* handler, uint32_t event_mask) { struct epoll_event event; event.data.ptr = handler; event.events = event_mask; if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, handler->fd, &event) == -1) { perror("Couldn't register server socket with epoll"); exit(-1); } } void do_reactor_loop(int epoll_fd) { struct epoll_event epoll_events[MAX_EPOLL_EVENTS]; while (1) { int ii; int num_events; num_events = epoll_wait(epoll_fd, epoll_events, MAX_EPOLL_EVENTS, -1); for (ii=0; ii < num_events; ii++ ) { struct epoll_event_handler* handler = (struct epoll_event_handler*) epoll_events[ii].data.ptr; handler->handle(handler, epoll_events[ii].events); } } }
#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <sys/epoll.h> #include "epollinterface.h" #define MAX_EPOLL_EVENTS 1 void add_epoll_handler(int epoll_fd, struct epoll_event_handler* handler, uint32_t event_mask) { struct epoll_event event; event.data.ptr = handler; event.events = event_mask; if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, handler->fd, &event) == -1) { perror("Couldn't register server socket with epoll"); exit(-1); } } void do_reactor_loop(int epoll_fd) { struct epoll_event epoll_events[MAX_EPOLL_EVENTS]; while (1) { int ii; int num_events; num_events = epoll_wait(epoll_fd, epoll_events, MAX_EPOLL_EVENTS, -1); for (ii=0; ii < num_events; ii++ ) { struct epoll_event_handler* handler = (struct epoll_event_handler*) epoll_events[ii].data.ptr; handler->handle(handler, epoll_events[ii].events); } } }
Handle epoll events one at a time. Doesn't seem to make things slower, and eliminates (I think) risk of freed backends getting events.
Handle epoll events one at a time. Doesn't seem to make things slower, and eliminates (I think) risk of freed backends getting events.
C
mit
gpjt/rsp,gpjt/rsp,gpjt/rsp
b1d45cb3b9f9ad2089d57de0ec3fa75ea1cf7fc4
include/ygo/data/CardData.h
include/ygo/data/CardData.h
#ifndef YGO_DATA_CARDDATA_H #define YGO_DATA_CARDDATA_H #include <string> #include "CardType.h" namespace ygo { namespace data { struct StaticCardData { std::string name; CardType cardType; // monster only Attribute attribute; MonsterType monsterType; Type type; MonsterType monsterAbility; int level; int attack; int defense; int lpendulum; int rpendulum; // spell and trap only SpellType spellType; TrapType trapType; }; } } #endif
#ifndef YGO_DATA_CARDDATA_H #define YGO_DATA_CARDDATA_H #include <string> #include "CardType.h" namespace ygo { namespace data { struct StaticCardData { const char* name; CardType cardType; // monster only Attribute attribute; MonsterType monsterType; Type type; MonsterType monsterAbility; int level; int attack; int defense; int lpendulum; int rpendulum; // spell and trap only SpellType spellType; TrapType trapType; }; } } #endif
Change name to const char *
Change name to const char * Allow for trivially constructable type
C
mit
DeonPoncini/ygodata
2d70b362127449ee79dc7fe236a7b20d75689fd3
libraries/ESP8266WebServer/src/detail/RequestHandler.h
libraries/ESP8266WebServer/src/detail/RequestHandler.h
#ifndef REQUESTHANDLER_H #define REQUESTHANDLER_H class RequestHandler { public: virtual bool canHandle(HTTPMethod method, String uri) { return false; } virtual bool canUpload(String uri) { return false; } virtual bool handle(ESP8266WebServer& server, HTTPMethod requestMethod, String requestUri) { return false; } virtual void upload(ESP8266WebServer& server, String requestUri, HTTPUpload& upload) {} RequestHandler* next() { return _next; } void next(RequestHandler* r) { _next = r; } private: RequestHandler* _next = nullptr; }; #endif //REQUESTHANDLER_H
#ifndef REQUESTHANDLER_H #define REQUESTHANDLER_H class RequestHandler { public: virtual ~RequestHandler() { } virtual bool canHandle(HTTPMethod method, String uri) { return false; } virtual bool canUpload(String uri) { return false; } virtual bool handle(ESP8266WebServer& server, HTTPMethod requestMethod, String requestUri) { return false; } virtual void upload(ESP8266WebServer& server, String requestUri, HTTPUpload& upload) {} RequestHandler* next() { return _next; } void next(RequestHandler* r) { _next = r; } private: RequestHandler* _next = nullptr; }; #endif //REQUESTHANDLER_H
Fix warning due to lack of virtual destructor
Fix warning due to lack of virtual destructor
C
lgpl-2.1
lrmoreno007/Arduino,KaloNK/Arduino,hallard/Arduino,KaloNK/Arduino,quertenmont/Arduino,jes/Arduino,toastedcode/esp8266-Arduino,martinayotte/ESP8266-Arduino,sticilface/Arduino,jes/Arduino,me-no-dev/Arduino,esp8266/Arduino,martinayotte/ESP8266-Arduino,lrmoreno007/Arduino,KaloNK/Arduino,Links2004/Arduino,wemos/Arduino,esp8266/Arduino,Lan-Hekary/Arduino,NextDevBoard/Arduino,Links2004/Arduino,Adam5Wu/Arduino,wemos/Arduino,Juppit/Arduino,NullMedia/Arduino,toastedcode/esp8266-Arduino,NextDevBoard/Arduino,esp8266/Arduino,KaloNK/Arduino,Lan-Hekary/Arduino,martinayotte/ESP8266-Arduino,Lan-Hekary/Arduino,NullMedia/Arduino,toastedcode/esp8266-Arduino,wemos/Arduino,jes/Arduino,quertenmont/Arduino,Juppit/Arduino,Juppit/Arduino,quertenmont/Arduino,me-no-dev/Arduino,Lan-Hekary/Arduino,Adam5Wu/Arduino,wemos/Arduino,lrmoreno007/Arduino,me-no-dev/Arduino,martinayotte/ESP8266-Arduino,Lan-Hekary/Arduino,NextDevBoard/Arduino,gguuss/Arduino,Adam5Wu/Arduino,KaloNK/Arduino,sticilface/Arduino,me-no-dev/Arduino,jes/Arduino,hallard/Arduino,NextDevBoard/Arduino,Juppit/Arduino,gguuss/Arduino,Adam5Wu/Arduino,Links2004/Arduino,toastedcode/esp8266-Arduino,hallard/Arduino,quertenmont/Arduino,toastedcode/esp8266-Arduino,gguuss/Arduino,martinayotte/ESP8266-Arduino,NullMedia/Arduino,NullMedia/Arduino,NextDevBoard/Arduino,gguuss/Arduino,gguuss/Arduino,Links2004/Arduino,lrmoreno007/Arduino,Links2004/Arduino,me-no-dev/Arduino,quertenmont/Arduino,sticilface/Arduino,hallard/Arduino,wemos/Arduino,esp8266/Arduino,lrmoreno007/Arduino,hallard/Arduino,sticilface/Arduino,Adam5Wu/Arduino,sticilface/Arduino,NullMedia/Arduino,esp8266/Arduino,Juppit/Arduino,jes/Arduino
a615fa83959896f8eac76c235953fb164cd1a9b9
include/linux/kmalloc_sizes.h
include/linux/kmalloc_sizes.h
#if (PAGE_SIZE == 4096) CACHE(32) #endif CACHE(64) #if L1_CACHE_BYTES < 64 CACHE(96) #endif CACHE(128) #if L1_CACHE_BYTES < 128 CACHE(192) #endif CACHE(256) CACHE(512) CACHE(1024) CACHE(2048) CACHE(4096) CACHE(8192) CACHE(16384) CACHE(32768) CACHE(65536) CACHE(131072) #ifndef CONFIG_MMU CACHE(262144) CACHE(524288) CACHE(1048576) #ifdef CONFIG_LARGE_ALLOCS CACHE(2097152) CACHE(4194304) CACHE(8388608) CACHE(16777216) CACHE(33554432) #endif /* CONFIG_LARGE_ALLOCS */ #endif /* CONFIG_MMU */
#if (PAGE_SIZE == 4096) CACHE(32) #endif CACHE(64) #if L1_CACHE_BYTES < 64 CACHE(96) #endif CACHE(128) #if L1_CACHE_BYTES < 128 CACHE(192) #endif CACHE(256) CACHE(512) CACHE(1024) CACHE(2048) CACHE(4096) CACHE(8192) CACHE(16384) CACHE(32768) CACHE(65536) CACHE(131072) #if (NR_CPUS > 512) || (MAX_NUMNODES > 256) || !defined(CONFIG_MMU) CACHE(262144) #endif #ifndef CONFIG_MMU CACHE(524288) CACHE(1048576) #ifdef CONFIG_LARGE_ALLOCS CACHE(2097152) CACHE(4194304) CACHE(8388608) CACHE(16777216) CACHE(33554432) #endif /* CONFIG_LARGE_ALLOCS */ #endif /* CONFIG_MMU */
Increase max kmalloc size for very large systems
[PATCH] Increase max kmalloc size for very large systems Systems with extemely large numbers of nodes or cpus need to kmalloc structures larger than is currently supported. This patch increases the maximum supported size for very large systems. This patch should have no effect on current systems. (akpm: why not just use alloc_pages() for sysfs_cpus?) Signed-off-by: Jack Steiner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
C
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs
c6e3881888e2f39b24d5381ce01876f30cfb9482
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 88 #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 89 #endif
Update Skia milestone to 89
Update Skia milestone to 89 Change-Id: I9de827fe1902a9a91898fcf70d82153a821500ee Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334418 Reviewed-by: Heather Miller <[email protected]> Commit-Queue: Heather Miller <[email protected]>
C
bsd-3-clause
google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia
f0b2388d22e1002a70e80643500434b19723a8cc
include/samplog/LogLevel.h
include/samplog/LogLevel.h
#pragma once #ifndef INC_SAMPLOG_LOGLEVEL_H #define INC_SAMPLOG_LOGLEVEL_H #ifdef ERROR //because Microsoft #undef ERROR #endif enum samplog_LogLevel { NONE = 0, DEBUG = 1, INFO = 2, WARNING = 4, ERROR = 8, FATAL = 16, VERBOSE = 32, }; inline samplog_LogLevel operator|(samplog_LogLevel a, samplog_LogLevel b) { return static_cast<samplog_LogLevel>(static_cast<int>(a) | static_cast<int>(b)); } #ifdef __cplusplus namespace samplog { typedef samplog_LogLevel LogLevel; } #endif /* __cplusplus */ #endif /* INC_SAMPLOG_LOGLEVEL_H */
#pragma once #ifndef INC_SAMPLOG_LOGLEVEL_H #define INC_SAMPLOG_LOGLEVEL_H #ifdef ERROR //because Microsoft #undef ERROR #endif enum samplog_LogLevel { NONE = 0, DEBUG = 1, INFO = 2, WARNING = 4, ERROR = 8, FATAL = 16, VERBOSE = 32, }; #ifdef __cplusplus inline samplog_LogLevel operator|(samplog_LogLevel a, samplog_LogLevel b) { return static_cast<samplog_LogLevel>(static_cast<int>(a) | static_cast<int>(b)); } namespace samplog { typedef samplog_LogLevel LogLevel; } #endif /* __cplusplus */ #endif /* INC_SAMPLOG_LOGLEVEL_H */
Put enum OR declaration in `__cplusplus`
Put enum OR declaration in `__cplusplus`
C
mit
maddinat0r/samp-log-core,maddinat0r/samp-log-core
f928e7a707a09d471881dc77e46992a774ae5b44
features/mbedtls/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/mbedtls_device.h
features/mbedtls/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/mbedtls_device.h
/* * mbedtls_device.h ******************************************************************************* * Copyright (c) 2017, STMicroelectronics * SPDX-License-Identifier: Apache-2.0 * * 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 MBEDTLS_DEVICE_H #define MBEDTLS_DEVICE_H /* FIXME: Don't enable AES hardware acceleration until issue #4928 is fixed. * (https://github.com/ARMmbed/mbed-os/issues/4928) */ /* #define MBEDTLS_AES_ALT */ #define MBEDTLS_SHA256_ALT #define MBEDTLS_SHA1_ALT #define MBEDTLS_MD5_ALT #endif /* MBEDTLS_DEVICE_H */
/* * mbedtls_device.h ******************************************************************************* * Copyright (c) 2017, STMicroelectronics * SPDX-License-Identifier: Apache-2.0 * * 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 MBEDTLS_DEVICE_H #define MBEDTLS_DEVICE_H /* FIXME: Don't enable AES hardware acceleration until issue #4928 is fixed. * (https://github.com/ARMmbed/mbed-os/issues/4928) */ /* #define MBEDTLS_AES_ALT */ /* FIXME: Don't enable SHA1, SHA256 and MD5 hardware acceleration until issue * #5079 is fixed. (https://github.com/ARMmbed/mbed-os/issues/5079) */ /* #define MBEDTLS_SHA256_ALT */ /* #define MBEDTLS_SHA1_ALT */ /* #define MBEDTLS_MD5_ALT */ #endif /* MBEDTLS_DEVICE_H */
Disable MD5, SHA1, SHA256 HW ACC for STM32F439xI
mbedtls: Disable MD5, SHA1, SHA256 HW ACC for STM32F439xI STM32F439xI-family MD5, SHA1 and SHA256 hardware acceleration occasionally produces incorrect output (#5079). Don't enable MD5, SHA1 and SHA256 HW acceleration on STM32F439xI-family targets by default until issue #5079 is fixed.
C
apache-2.0
mazimkhan/mbed-os,mbedmicro/mbed,infinnovation/mbed-os,betzw/mbed-os,ryankurte/mbed-os,karsev/mbed-os,ryankurte/mbed-os,mbedmicro/mbed,infinnovation/mbed-os,karsev/mbed-os,nRFMesh/mbed-os,karsev/mbed-os,c1728p9/mbed-os,catiedev/mbed-os,c1728p9/mbed-os,karsev/mbed-os,karsev/mbed-os,Archcady/mbed-os,andcor02/mbed-os,betzw/mbed-os,mazimkhan/mbed-os,nRFMesh/mbed-os,andcor02/mbed-os,nRFMesh/mbed-os,mazimkhan/mbed-os,Archcady/mbed-os,mbedmicro/mbed,catiedev/mbed-os,kjbracey-arm/mbed,CalSol/mbed,andcor02/mbed-os,catiedev/mbed-os,CalSol/mbed,HeadsUpDisplayInc/mbed,nRFMesh/mbed-os,andcor02/mbed-os,c1728p9/mbed-os,betzw/mbed-os,nRFMesh/mbed-os,infinnovation/mbed-os,HeadsUpDisplayInc/mbed,mazimkhan/mbed-os,Archcady/mbed-os,Archcady/mbed-os,c1728p9/mbed-os,HeadsUpDisplayInc/mbed,kjbracey-arm/mbed,kjbracey-arm/mbed,mbedmicro/mbed,c1728p9/mbed-os,mazimkhan/mbed-os,infinnovation/mbed-os,betzw/mbed-os,mazimkhan/mbed-os,ryankurte/mbed-os,betzw/mbed-os,kjbracey-arm/mbed,karsev/mbed-os,ryankurte/mbed-os,Archcady/mbed-os,mbedmicro/mbed,catiedev/mbed-os,CalSol/mbed,HeadsUpDisplayInc/mbed,catiedev/mbed-os,HeadsUpDisplayInc/mbed,betzw/mbed-os,ryankurte/mbed-os,infinnovation/mbed-os,andcor02/mbed-os,c1728p9/mbed-os,catiedev/mbed-os,CalSol/mbed,ryankurte/mbed-os,infinnovation/mbed-os,HeadsUpDisplayInc/mbed,Archcady/mbed-os,CalSol/mbed,nRFMesh/mbed-os,andcor02/mbed-os,CalSol/mbed
ee396e6fa028184cf715351311ba3c41e7b8228e
src/lib/utils/openssl/openssl.h
src/lib/utils/openssl/openssl.h
/* * Utils for calling OpenSSL * (C) 2015 Jack Lloyd * * Botan is released under the Simplified BSD License (see license.txt) */ #ifndef BOTAN_OPENSSL_H__ #define BOTAN_OPENSSL_H__ #include <botan/secmem.h> #include <botan/exceptn.h> #include <memory> #include <openssl/err.h> namespace Botan { class OpenSSL_Error : public Exception { public: OpenSSL_Error(const std::string& what) : Exception(what + " failed: " + ERR_error_string(ERR_get_error(), nullptr)) {} }; #define BOTAN_OPENSSL_BLOCK_PRIO 150 #define BOTAN_OPENSSL_HASH_PRIO 150 #define BOTAN_OPENSSL_RC4_PRIO 150 #define BOTAN_OPENSSL_RSA_PRIO 150 #define BOTAN_OPENSSL_ECDSA_PRIO 150 } #endif
/* * Utils for calling OpenSSL * (C) 2015 Jack Lloyd * * Botan is released under the Simplified BSD License (see license.txt) */ #ifndef BOTAN_OPENSSL_H__ #define BOTAN_OPENSSL_H__ #include <botan/secmem.h> #include <botan/exceptn.h> #include <memory> #include <openssl/err.h> namespace Botan { class OpenSSL_Error : public Exception { public: OpenSSL_Error(const std::string& what) : Exception(what + " failed: " + ERR_error_string(ERR_get_error(), nullptr)) {} }; #define BOTAN_OPENSSL_BLOCK_PRIO 150 #define BOTAN_OPENSSL_HASH_PRIO 150 #define BOTAN_OPENSSL_RC4_PRIO 150 #define BOTAN_OPENSSL_RSA_PRIO 90 #define BOTAN_OPENSSL_ECDSA_PRIO 90 } #endif
Make OpenSSL ECDSA and RSA request only until they can be tested
Make OpenSSL ECDSA and RSA request only until they can be tested
C
bsd-2-clause
randombit/botan,randombit/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,randombit/botan
10687f69c018875f5180e93aeff5bdc3d6b828d1
include/bold/Support/Slab.h
include/bold/Support/Slab.h
//===- Slab.h -------------------------------------------------------------===// // // The Bold Project // // This file is distributed under the New BSD License. // See LICENSE for details. // //===----------------------------------------------------------------------===// #ifndef BOLD_SUPPORT_SLAB_H #define BOLD_SUPPORT_SLAB_H #include <bold/ADT/IListNode.h> namespace bold { /** \class Slab * \brief Slab is a continuous memory space that amounts to `Amount` * `DataType` elements. * * Slab is a basic allocated unit of BumpAllocator. * * @tparam DataType the type of elements * @tparam Amount the amount of elements in a slab */ template<typename DataType, unsigned int Amount> struct Slab : public IListNode<Slab> { public: enum { max_size = Amount }; public: DataType data[max_size]; }; } // namespace bold #endif
//===- Slab.h -------------------------------------------------------------===// // // The Bold Project // // This file is distributed under the New BSD License. // See LICENSE for details. // //===----------------------------------------------------------------------===// #ifndef BOLD_SUPPORT_SLAB_H #define BOLD_SUPPORT_SLAB_H #include <bold/ADT/IListNode.h> namespace bold { /** \class Slab * \brief Slab is a continuous memory space that amounts to `Amount` * `DataType` elements. * * Slab is a basic allocated unit of BumpAllocator. * * @tparam DataType the type of elements * @tparam Amount the amount of elements in a slab */ template<typename DataType, unsigned int Amount> struct Slab : public IListNodeBase { public: enum { max_size = Amount }; public: DataType data[max_size]; }; } // namespace bold #endif
Fix bug - obviously, recursive template type is impossible.
Fix bug - obviously, recursive template type is impossible.
C
bsd-3-clause
astrotycoon/bold-utils,hjmeric/bold-utils,hjmeric/bold-utils,astrotycoon/bold-utils
1acc1d642a43ed98b59e42bd2ace0204f862719f
lib/c_impl/n_hamming_window.c
lib/c_impl/n_hamming_window.c
#include "ruby.h" #include "noyes.h" HammingWindow * new_hamming_window(int window_size) { HammingWindow *hw = malloc(sizeof(HammingWindow)); hw->buf = malloc(window_size * sizeof(double)); hw->buflen = window_size; return hw; } void free_hamming_window(HammingWindow *hw) { free(hw->buf); free(hw); } NData2 * hamming_window_apply(HammingWindow *self, NData2* data) { return NULL; }
Implement allocation and deallocation for c hamming window.
Implement allocation and deallocation for c hamming window.
C
bsd-2-clause
talkhouse/noyes,talkhouse/noyes,talkhouse/noyes
b71d9d2e421652ca60b67b9ce37d7e6988e40e0e
src/miners/fs/tracker-writeback.h
src/miners/fs/tracker-writeback.h
/* * Copyright (C) 2008, Nokia <[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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef __TRACKER_MINER_FS_WRITEBACK_H__ #define __TRACKER_MINER_FS_WRITEBACK_H__ #include <libtracker-miner/tracker-miner.h> #include "tracker-config.h" #include "tracker-miner-files.h" G_BEGIN_DECLS void tracker_writeback_init (TrackerMinerFiles *miner_files, TrackerConfig *config, GError **error); void tracker_writeback_shutdown (void); G_END_DECLS #endif /* __TRACKER_MINER_FS_WRITEBACK_H__ */
/* * Copyright (C) 2008, Nokia <[email protected]> * * This library 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 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 * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef __TRACKER_MINER_FS_WRITEBACK_H__ #define __TRACKER_MINER_FS_WRITEBACK_H__ #include <libtracker-miner/tracker-miner.h> #include "tracker-config.h" #include "tracker-miner-files.h" G_BEGIN_DECLS void tracker_writeback_init (TrackerMinerFiles *miner_files, TrackerConfig *config, GError **error); void tracker_writeback_shutdown (void); G_END_DECLS #endif /* __TRACKER_MINER_FS_WRITEBACK_H__ */
Fix licensing errors in files
tracker-miner-fs: Fix licensing errors in files Some were changed from GPL to LGPL for some reason. Now they're all GPL as they should be.
C
lgpl-2.1
hoheinzollern/tracker,hoheinzollern/tracker,hoheinzollern/tracker,outofbits/tracker,hoheinzollern/tracker,hoheinzollern/tracker,hoheinzollern/tracker,outofbits/tracker,hoheinzollern/tracker,outofbits/tracker,outofbits/tracker,outofbits/tracker,outofbits/tracker,outofbits/tracker
2672954aebf325f7c73f0539fd5e6aa53f4bb1e9
Parse-RACExtensions/PFQuery+RACExtensions.h
Parse-RACExtensions/PFQuery+RACExtensions.h
// // PFQuery+RACExtensions.h // Parse-RACExtensions // // Created by Dave Lee on 2013-06-28. // Copyright (c) 2013 Dave Lee. All rights reserved. // #import <Parse/PFQuery.h> @class RACSignal; @interface PFQuery (RACExtensions) /// Gets a PFObject with the given id. /// /// @warning This mutates the PFQuery. /// /// @see -getObjectInBackgroundWithId:block: /// /// @return A signal that sends the identified PFObject. - (RACSignal *)rac_getObjectWithId:(NSString *)objectId; /// Finds objects based on the constructed query. /// /// @see -findObjectsInBackgroundWithBlock: /// /// @return A signal that sends the NSArray of matching PFObjects. - (RACSignal *)rac_findObjects; /// Gets an object based on the constructed query. /// /// @warning This mutates the PFQuery. /// /// @see -getFirstObjectInBackgroundWithBlock: /// /// @return A signal that sends the first matching PFObject. - (RACSignal *)rac_getFirstObject; /// Counts objects based on the constructed query. /// /// @see -countObjectsInBackgroundWithBlock: /// /// @return A signal that sends the integer count of matching PFObjects - (RACSignal *)rac_countObjects; @end
// // PFQuery+RACExtensions.h // Parse-RACExtensions // // Created by Dave Lee on 2013-06-28. // Copyright (c) 2013 Dave Lee. All rights reserved. // #import <Parse/PFQuery.h> @class RACSignal; @interface PFQuery (RACExtensions) /// Gets a PFObject with the given id. /// /// Disposing subscription will also cancel the query. /// /// @warning This mutates the PFQuery. /// /// @see -getObjectInBackgroundWithId:block: /// /// @return A signal that sends the identified PFObject. - (RACSignal *)rac_getObjectWithId:(NSString *)objectId; /// Finds objects based on the constructed query. /// /// Disposing subscription will also cancel the query. /// /// @see -findObjectsInBackgroundWithBlock: /// /// @return A signal that sends the NSArray of matching PFObjects. - (RACSignal *)rac_findObjects; /// Gets an object based on the constructed query. /// /// Disposing subscription will also cancel the query. /// /// @warning This mutates the PFQuery. /// /// @see -getFirstObjectInBackgroundWithBlock: /// /// @return A signal that sends the first matching PFObject. - (RACSignal *)rac_getFirstObject; /// Counts objects based on the constructed query. /// /// Disposing subscription will also cancel the query. /// /// @see -countObjectsInBackgroundWithBlock: /// /// @return A signal that sends the integer count of matching PFObjects - (RACSignal *)rac_countObjects; @end
Document PFQuery disposal side effects
Document PFQuery disposal side effects
C
mit
kastiglione/Parse-RACExtensions,chrrasmussen/Parse-RACExtensions,kastiglione/Parse-RACExtensions,chrrasmussen/Parse-RACExtensions
2df653a9db16b6359b5abd80e7ffa30e832fed9a
src/StdAfx.h
src/StdAfx.h
/* StdAfx.h * * Copyright (C) 2013 Michael Imamura * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ #pragma once #ifdef _WIN32 # define WIN32_LEAN_AND_MEAN # include <windows.h> #endif #include <math.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <algorithm> #include <list> #include <map> #include <memory> #include <sstream> #include <string> #include <vector> #include <utility> #include <SDL2/SDL.h> #include <SDL2/SDL_image.h> #include <SDL2/SDL_ttf.h>
/* StdAfx.h * * Copyright (C) 2013 Michael Imamura * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ #pragma once #ifdef _WIN32 # define WIN32_LEAN_AND_MEAN // Minimum Windows version: XP # define WINVER 0x0501 # define _CRT_NONSTDC_NO_WARNINGS # define _CRT_SECURE_NO_DEPRECATE # define _SCL_SECURE_NO_DEPRECATE # include <windows.h> #endif #include <math.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <algorithm> #include <list> #include <map> #include <memory> #include <sstream> #include <string> #include <vector> #include <utility> #include <SDL2/SDL.h> #include <SDL2/SDL_image.h> #include <SDL2/SDL_ttf.h>
Set API ver and disable CRT warnings on Win32.
Set API ver and disable CRT warnings on Win32.
C
apache-2.0
ZoogieZork/Adventures-in-SDL2,ZoogieZork/Adventures-in-SDL2
6f6926c373cf829cb8043f1a81595c0388d8009f
src/btcwif.h
src/btcwif.h
#ifndef __BTC_WIF_H__ #define __BTC_WIF_H__ #include <string> #include <vector> namespace btc { namespace wif { std::string PrivateKeyToWif(const std::vector<uint8_t> &priv_key); std::vector<uint8_t> WifToPrivateKey(const std::string &priv_key_str); } // namespace wif } // namespace btc #endif
#ifndef __BTC_WIF_H__ #define __BTC_WIF_H__ #include <string> #include <vector> namespace btc { namespace wif { /** * Convert private key to string in WIF * * @param priv_key Private key data. * * @return WIF string. */ std::string PrivateKeyToWif(const std::vector<uint8_t> &priv_key); /** * Parse WIF private key string. * * @param priv_key_str Private key string in WIF format. * * @return Private key data. */ std::vector<uint8_t> WifToPrivateKey(const std::string &priv_key_str); } // namespace wif } // namespace btc #endif
Add comment for WIF functions.
Add comment for WIF functions.
C
mit
gladosconn/btcaddrgen
19533431a5b879a40b706b7ce2c64a1456acb8bb
src/icmpv4.c
src/icmpv4.c
#include "ethernet.h" #include "icmpv4.h" #include "ip.h" #include "utils.h" void icmpv4_incoming(struct sk_buff *skb) { struct iphdr *iphdr = ip_hdr(skb); struct icmp_v4 *icmp = (struct icmp_v4 *) iphdr->data; //TODO: Check csum switch (icmp->type) { case ICMP_V4_ECHO: icmpv4_reply(skb); break; default: perror("ICMPv4 did not match supported types"); return; } } void icmpv4_reply(struct sk_buff *skb) { struct iphdr *iphdr = ip_hdr(skb); struct icmp_v4 *icmp = (struct icmp_v4 *) iphdr->data; uint16_t icmp_len = iphdr->len - (iphdr->ihl * 4); skb_reserve(skb, ETH_HDR_LEN + IP_HDR_LEN + icmp_len); skb_push(skb, icmp_len); icmp->type = ICMP_V4_REPLY; icmp->csum = 0; icmp->csum = checksum(icmp, icmp_len, 0); iphdr->daddr = iphdr->saddr; skb->protocol = ICMPV4; ip_output(NULL, skb); }
#include "ethernet.h" #include "icmpv4.h" #include "ip.h" #include "utils.h" void icmpv4_incoming(struct sk_buff *skb) { struct iphdr *iphdr = ip_hdr(skb); struct icmp_v4 *icmp = (struct icmp_v4 *) iphdr->data; //TODO: Check csum switch (icmp->type) { case ICMP_V4_ECHO: icmpv4_reply(skb); break; default: perror("ICMPv4 did not match supported types"); return; } } void icmpv4_reply(struct sk_buff *skb) { struct iphdr *iphdr = ip_hdr(skb); struct icmp_v4 *icmp; struct sock sk; uint16_t icmp_len = iphdr->len - (iphdr->ihl * 4); skb_reserve(skb, ETH_HDR_LEN + IP_HDR_LEN + icmp_len); skb_push(skb, icmp_len); icmp = (struct icmp_v4 *)skb->data; icmp->type = ICMP_V4_REPLY; icmp->csum = 0; icmp->csum = checksum(icmp, icmp_len, 0); skb->protocol = ICMPV4; sk.daddr = iphdr->saddr; ip_output(&sk, skb); }
Fix ICMPv4 dest addr set
Fix ICMPv4 dest addr set
C
mit
saminiir/level-ip,saminiir/level-ip
38c0c6b517013f885e9c465e6f481d3828b355ea
bst.h
bst.h
#include <stdlib.h> #ifndef __BST_H__ #define __BST_H__ #endif
#include <stdlib.h> #ifndef __BST_H__ #define __BST_H__ struct BSTNode; struct BST; #endif
Add BSTNode & BST struct declaration
Add BSTNode & BST struct declaration
C
mit
MaxLikelihood/CADT
d8d34b0ebf0af05fd03af936ea0e08ec32972ff8
prj1/include/geometry/geometry.h
prj1/include/geometry/geometry.h
#ifndef GEOMETRY_H #define GEOMETRY_H #include <vector> #include <string> #include <memory> #include "linalg/ray.h" #include "linalg/transform.h" class Geometry { public: virtual bool intersect(Ray &r) = 0; }; class Node { std::vector<std::shared_ptr<Node>> children; std::shared_ptr<Geometry> geometry; Transform transform; std::string name; public: /* * Create a node in the scene graph, placing some named geometry in * the scene */ Node(const std::shared_ptr<Geometry> &geom, const Transform &t, const std::string &name); const std::vector<std::shared_ptr<Node>>& get_children() const; std::vector<std::shared_ptr<Node>>& get_children(); const Geometry& get_geometry() const; const Transform& get_transform() const; Transform& get_transform(); }; #endif
#ifndef GEOMETRY_H #define GEOMETRY_H #include <vector> #include <string> #include <memory> #include "linalg/ray.h" #include "linalg/transform.h" class Geometry { public: /* * Test a ray for intersection with the geometry. * The ray should have been previously transformed into object space */ virtual bool intersect(Ray &r) = 0; }; class Node { std::vector<std::shared_ptr<Node>> children; std::shared_ptr<Geometry> geometry; Transform transform; std::string name; public: /* * Create a node in the scene graph, placing some named geometry in * the scene */ Node(const std::shared_ptr<Geometry> &geom, const Transform &t, const std::string &name); const std::vector<std::shared_ptr<Node>>& get_children() const; std::vector<std::shared_ptr<Node>>& get_children(); const Geometry& get_geometry() const; const Transform& get_transform() const; Transform& get_transform(); }; #endif
Add comment on what space the incoming ray should be in
Add comment on what space the incoming ray should be in
C
mit
Twinklebear/tray,Twinklebear/tray
11cc5dbfd26c345e51ec7aa402417ae5faa0c71d
src/distributed.h
src/distributed.h
#ifndef DISTRIBUTED_H_ #define DISTRIBUTED_H_ #include <pthread.h> #include "synch.h" #define N_WORKERS 2 /* The Nahanni device */ #define SHM_DEV "/dev/uio0" /* The size of the shared memory, in bytes */ #define SHM_SIZE (1024L * 1024L * 1024L) /* Where we should map the memory */ #define SHM_LOC (void *)(1024L * 1024L * 1024L * 1024L) #define MASTER if(master_node) #define WORKER if(!master_node) typedef struct { pthread_spinlock_t lock; int count; int alldone; int exited; } mr_barrier_t; void *shm_base; void shm_init(); void barrier_init(mr_barrier_t *bar); void barrier(mr_barrier_t *bar); int master_node; #endif /* DISTRIBUTED_H_ */
#ifndef DISTRIBUTED_H_ #define DISTRIBUTED_H_ #include <pthread.h> #include "synch.h" /* This is a misnomer - it's actually the number of processes (master + workers) */ #define N_WORKERS 3 /* The Nahanni device */ #define SHM_DEV "/dev/uio0" /* The size of the shared memory, in bytes */ #define SHM_SIZE (1024L * 1024L * 1024L) /* Where we should map the memory */ #define SHM_LOC (void *)(1024L * 1024L * 1024L * 1024L) #define MASTER if(master_node) #define WORKER if(!master_node) typedef struct { pthread_spinlock_t lock; int count; int alldone; int exited; } mr_barrier_t; void *shm_base; void shm_init(); void barrier_init(mr_barrier_t *bar); void barrier(mr_barrier_t *bar); int master_node; #endif /* DISTRIBUTED_H_ */
Increase node count to 3
Increase node count to 3
C
bsd-3-clause
adamwg/elastic-phoenix,adamwg/elastic-phoenix,adamwg/elastic-phoenix
bce9205e430e94918476ae62579f9e3c811294d7
test/Parser/ms-inline-asm.c
test/Parser/ms-inline-asm.c
// REQUIRES: x86-registered-target // RUN: %clang_cc1 %s -verify -fasm-blocks #define M __asm int 0x2c #define M2 int void t1(void) { M } void t2(void) { __asm int 0x2c } void t3(void) { __asm M2 0x2c } void t4(void) { __asm mov eax, fs:[0x10] } void t5() { __asm { int 0x2c ; } asm comments are fun! }{ } __asm {} } int t6() { __asm int 3 ; } comments for single-line asm __asm {} __asm int 4 return 10; } void t7() { __asm { push ebx mov ebx, 0x07 pop ebx } } void t8() { __asm nop __asm nop __asm nop } void t9() { __asm nop __asm nop ; __asm nop } int t_fail() { // expected-note {{to match this}} __asm __asm { // expected-error 3 {{expected}} expected-note {{to match this}}
// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -verify -fasm-blocks #define M __asm int 0x2c #define M2 int void t1(void) { M } void t2(void) { __asm int 0x2c } void t3(void) { __asm M2 0x2c } void t4(void) { __asm mov eax, fs:[0x10] } void t5() { __asm { int 0x2c ; } asm comments are fun! }{ } __asm {} } int t6() { __asm int 3 ; } comments for single-line asm __asm {} __asm int 4 return 10; } void t7() { __asm { push ebx mov ebx, 0x07 pop ebx } } void t8() { __asm nop __asm nop __asm nop } void t9() { __asm nop __asm nop ; __asm nop } int t_fail() { // expected-note {{to match this}} __asm __asm { // expected-error 3 {{expected}} expected-note {{to match this}}
Add a triple, per Ben's suggestion.
Add a triple, per Ben's suggestion. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@173198 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/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,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
f03fd7f1afa93f73f156c82e9541d11e1519ec31
test/Sema/typo-correction.c
test/Sema/typo-correction.c
// RUN: %clang_cc1 -fsyntax-only -verify %s // // This file contains typo correction tests which hit different code paths in C // than in C++ and may exhibit different behavior as a result. __typeof__(struct F*) var[invalid]; // expected-error-re {{use of undeclared identifier 'invalid'{{$}}}} void PR21656() { float x; x = (float)arst; // expected-error-re {{use of undeclared identifier 'arst'{{$}}}} } a = b ? : 0; // expected-warning {{type specifier missing, defaults to 'int'}} \ // expected-error {{use of undeclared identifier 'b'}} struct ContainerStuct { enum { SOME_ENUM }; // expected-note {{'SOME_ENUM' declared here}} }; void func(int arg) { switch (arg) { case SOME_ENUM_: ; // expected-error {{use of undeclared identifier 'SOME_ENUM_'; did you mean 'SOME_ENUM'}} } }
// RUN: %clang_cc1 -fsyntax-only -verify %s // // This file contains typo correction tests which hit different code paths in C // than in C++ and may exhibit different behavior as a result. __typeof__(struct F*) var[invalid]; // expected-error-re {{use of undeclared identifier 'invalid'{{$}}}} void PR21656() { float x; x = (float)arst; // expected-error-re {{use of undeclared identifier 'arst'{{$}}}} } a = b ? : 0; // expected-warning {{type specifier missing, defaults to 'int'}} \ // expected-error {{use of undeclared identifier 'b'}} struct ContainerStuct { enum { SOME_ENUM }; // expected-note {{'SOME_ENUM' declared here}} }; void func(int arg) { switch (arg) { case SOME_ENUM_: // expected-error {{use of undeclared identifier 'SOME_ENUM_'; did you mean 'SOME_ENUM'}} ; } }
Fix test from my previous commit
Fix test from my previous commit (I should have re-run the test after running clang-format) git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@225515 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-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
29cc413e4a179535fc7003b6e7f3cc67424cca13
UTAPIObjCAdapter/UTAPIObjCAdapter.h
UTAPIObjCAdapter/UTAPIObjCAdapter.h
// // UTAPIObjCAdapter-iOS.h // UTAPIObjCAdapter-iOS // // Created by Mark Woollard on 15/05/2016. // Copyright © 2016 UrbanThings. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for UTAPIObjCAdapter-iOS. FOUNDATION_EXPORT double UTAPIObjCAdapter_iOSVersionNumber; //! Project version string for UTAPIObjCAdapter-iOS. FOUNDATION_EXPORT const unsigned char UTAPIObjCAdapter_iOSVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <UTAPIObjCAdapter_iOS/PublicHeader.h>
// // UTAPIObjCAdapter-iOS.h // UTAPIObjCAdapter-iOS // // Created by Mark Woollard on 15/05/2016. // Copyright © 2016 UrbanThings. All rights reserved. // //! Project version number for UTAPIObjCAdapter-iOS. FOUNDATION_EXPORT double UTAPIObjCAdapter_iOSVersionNumber; //! Project version string for UTAPIObjCAdapter-iOS. FOUNDATION_EXPORT const unsigned char UTAPIObjCAdapter_iOSVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <UTAPIObjCAdapter_iOS/PublicHeader.h>
Make master header platform neutral
Make master header platform neutral
C
apache-2.0
urbanthings/urbanthings-sdk-apple,urbanthings/urbanthings-sdk-apple,urbanthings/urbanthings-sdk-apple,urbanthings/urbanthings-sdk-apple
b7a1776530b202dc15387dae8a688e07e956c529
c/unique_characters.c
c/unique_characters.c
#include <stdio.h> #include <stdlib.h> #include <string.h> int is_unique(char *str) { int c; int table[128]; for (int i = 0; i < 128; i++) { table[i] = 0; } for (int i = 0; i < strlen(str); i++) { if (str[i] != ' ') { c = (int) str[i]; table[c]++; if (table[c] > 1) { return 0; } } } return 1; } int main(void) { FILE * file; char file_name[128]; char * line = NULL; size_t length = 0; ssize_t read; printf("Provide input file: "); fgets(file_name, 128, stdin); strtok(file_name, "\n"); file = fopen(file_name, "r"); if (file == NULL) { printf("Failed to open file at %s: ", file_name); exit(1); } while ((read = getline(&line, &length, file)) != -1) { strtok(line, "\n"); if (is_unique(line) == 1) { printf("%s is unique\n", line); } else { printf("%s is not unique\n", line); } } free(line); fclose(file); exit(0); }
Solve c problem to validate a string contains no repeated characters
Solve c problem to validate a string contains no repeated characters
C
mit
gusortiz/code_challenges,codingpains/code_challenges,codingpains/code_challenges,gusortiz/code_challenges,codingpains/code_challenges
cfcd9bc4de42fe201a4d54a6b50144ad87fc6f9f
src/IK.h
src/IK.h
// This file is part of RBDyn. // // RBDyn 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 3 of the License, or // (at your option) any later version. // // RBDyn 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 RBDyn. If not, see <http://www.gnu.org/licenses/>. #pragma once // includes // std #include <vector> // SpaceVecAlg #include <SpaceVecAlg/SpaceVecAlg> #include "Jacobian.h" namespace rbd { class MultiBody; class MultiBodyConfig; namespace ik { static constexpr int MAX_ITERATIONS = 50; static constexpr double LAMBDA = 0.9; static constexpr double THRESHOLD = 1e-8; static constexpr double ALMOST_ZERO = 1e-8; } // ik /** * Inverse Kinematics algorithm. */ class InverseKinematics { public: InverseKinematics() {} /// @param mb MultiBody associated with this algorithm. InverseKinematics(const MultiBody& mb, int ef_index); /** * Compute the inverse kinematics. * @param mb MultiBody used has model. * @param mbc Use q generalized position vector * @return bool if computation has converged * Fill q with new generalized position, bodyPosW, jointConfig * and parentToSon */ bool inverseKinematics(const MultiBody& mb, MultiBodyConfig& mbc, const sva::PTransformd& ef_target); /** safe version of @see inverseKinematics. * @throw std::domain_error If mb doesn't match mbc. */ bool sInverseKinematics(const MultiBody& mb, MultiBodyConfig& mbc, const sva::PTransformd& ef_target); /** * @brief Find q that minimizes the distance between ef and ef_target. * @return Bool if convergence has been reached */ // @brief Maximum number of iterations int max_iterations_; // @brief Learning rate double lambda_; // @brief Stopping criterion double threshold_; // @brief Rounding threshold for the Jacobian double almost_zero_; private: // @brief ef_index is the End Effector index used to build jacobian int ef_index_; Jacobian jac_; Eigen::JacobiSVD<Eigen::MatrixXd> svd_; }; } // namespace rbd
Update documentation for modification of mbc and new properties
Update documentation for modification of mbc and new properties
C
bsd-2-clause
gergondet/RBDyn,jrl-umi3218/RBDyn,jrl-umi3218/RBDyn,jrl-umi3218/RBDyn,jrl-umi3218/RBDyn,gergondet/RBDyn,gergondet/RBDyn,gergondet/RBDyn,gergondet/RBDyn
783ab6c29e2c372ca395cec7683656f593fcd4e2
tests/regression/37-congruence/03-interval-overflow.c
tests/regression/37-congruence/03-interval-overflow.c
// PARAM: --enable ana.int.interval --enable ana.int.congruence --disable ana.int.def_exc // Overflow information should be passed from the interval domain to congruences #include <assert.h> #include <stdio.h> int main(){ char r; if (r) { r = -68; } else { r = -63; } char k = r - 80; assert (k == 0); //UNKNOWN! char non_ov = r - 10; assert (non_ov == -78); //UNKNOWN char m = r * 2; assert (m == 0); //UNKNOWN! char l = r + (-80); assert (l == 0); //UNKNOWN! int g; if (g) { g = -126; } else { g = -128; } char f = g / (-1); assert (f == 1); //UNKNOWN! char d = -g; assert (d == 1); //UNKNOWN! return 0; }
// PARAM: --enable ana.int.interval --enable ana.int.congruence --disable ana.int.def_exc // Overflow information should be passed from the interval domain to congruences #include <assert.h> #include <stdio.h> int main(){ signed char r; if (r) { r = -68; } else { r = -63; } signed char k = r - 80; assert (k == 0); //UNKNOWN! signed char non_ov = r - 10; assert (non_ov == -78); //UNKNOWN! signed char m = r * 2; assert (m == 0); //UNKNOWN! signed char l = r + (-80); assert (l == 0); //UNKNOWN! int g; if (g) { g = -126; } else { g = -128; } signed char f = g / (-1); assert (f == 1); //UNKNOWN! signed char d = -g; assert (d == 1); //UNKNOWN! return 0; }
Change UNKNOWN to UNKNOWN! in 37/03 + chars to signed chars
Change UNKNOWN to UNKNOWN! in 37/03 + chars to signed chars
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
1884e824eac4bd2f6210e13fb20708da0b9b4482
polygonmain.c
polygonmain.c
#include <polygon.h> int main(int argc, char* argv[]) { Polygon lol; lol=createPolygon(); lol=addPoint(lol, createPoint(12.6,-5.3)); lol=addPoint(lol, createPoint(-4.1,456.123)); printf("\n\ntaille : %d", lol.size); printf("\n\nx premier point : %f", lol.head->value.x); printf("\ny premier point : %f\n\n", lol.head->value.y); printf("\n\nx 2eme point : %f", lol.head->next->value.x); printf("\ny 2eme point : %f\n\n", lol.head->next->value.y); printf("\n\nx 3eme point : %f", lol.head->next->next->value.x); printf("\ny 3eme point : %f\n\n", lol.head->next->next->value.y); return EXIT_SUCCESS; }
#include <polygon.h> int main(int argc, char* argv[]) { Polygon lol; lol=createPolygon(); lol=addPoint(lol, createPoint(12.6,-5.3)); lol=addPoint(lol, createPoint(-4.1,456.123)); lol=addPoint(lol, createPoint(23.7,1)); printf("\n\ntaille : %d", lol.size); printf("\n\nx premier point : %f", lol.head->value.x); printf("\ny premier point : %f\n\n", lol.head->value.y); printf("\n\nx 2eme point : %f", lol.head->next->value.x); printf("\ny 2eme point : %f\n\n", lol.head->next->value.y); printf("\n\nx 3eme point : %f", lol.head->next->next->value.x); printf("\ny 3eme point : %f\n\n", lol.head->next->next->value.y); printf("\nSuppression du 2e élément...\n"); lol=removePoint(lol, 2); printf("\n\ntaille : %d", lol.size); printf("\n\nx premier point : %f", lol.head->value.x); printf("\ny premier point : %f\n\n", lol.head->value.y); printf("\n\nx 2eme point : %f", lol.head->next->value.x); printf("\ny 2eme point : %f\n\n", lol.head->next->value.y); printf("\n\nx 3eme point : %f", lol.head->next->next->value.x); printf("\ny 3eme point : %f\n\n", lol.head->next->next->value.y); return EXIT_SUCCESS; }
Add a section which test if the removePoint function work
Add a section which test if the removePoint function work And it work !
C
mit
UTBroM/GeometricLib
0f4cfc0a19d5225ffe18695b81dc28bb2ee664d9
kernel/stdnoreturn.h
kernel/stdnoreturn.h
/* * Copyright (c) 2011-2013 Graham Edgecombe <[email protected]> * * 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. */ #ifndef STDNORETURN_H #define STDNORETURN_H #define noreturn _Noreturn #endif
/* * Copyright (c) 2011-2013 Graham Edgecombe <[email protected]> * * 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. */ #ifndef STDNORETURN_H #define STDNORETURN_H #if defined(__clang__) && __clang_major__ == 3 && __clang_minor__ == 0 #define noreturn #else #define noreturn _Noreturn #endif #endif
Fix lack of _Noreturn support in Clang 3.0.
Fix lack of _Noreturn support in Clang 3.0.
C
isc
grahamedgecombe/arc,grahamedgecombe/arc,grahamedgecombe/arc
28726b93b0b9ae221f54ab7cc297d09a9af6843a
src/lib/pubkey/rfc6979/rfc6979.h
src/lib/pubkey/rfc6979/rfc6979.h
/* * RFC 6979 Deterministic Nonce Generator * (C) 2014 Jack Lloyd * * Distributed under the terms of the Botan license */ #ifndef BOTAN_RFC6979_GENERATOR__ #define BOTAN_RFC6979_GENERATOR__ #include <botan/bigint.h> #include <string> namespace Botan { /** * @param x the secret (EC)DSA key * @param q the group order * @param h the message hash already reduced mod q * @param hash the hash function used to generate h */ BigInt BOTAN_DLL generate_rfc6979_nonce(const BigInt& x, const BigInt& q, const BigInt& h, const std::string& hash); } #endif
/* * RFC 6979 Deterministic Nonce Generator * (C) 2014 Jack Lloyd * * Distributed under the terms of the Botan license */ #ifndef BOTAN_RFC6979_GENERATOR_H__ #define BOTAN_RFC6979_GENERATOR_H__ #include <botan/bigint.h> #include <string> namespace Botan { /** * @param x the secret (EC)DSA key * @param q the group order * @param h the message hash already reduced mod q * @param hash the hash function used to generate h */ BigInt BOTAN_DLL generate_rfc6979_nonce(const BigInt& x, const BigInt& q, const BigInt& h, const std::string& hash); } #endif
Fix header guard for amalgamation
Fix header guard for amalgamation
C
bsd-2-clause
randombit/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,webmaster128/botan,webmaster128/botan
ea154d7d98f4c6d1ded69031ff583b4f4c47118b
src/core/internal/kms-utils.h
src/core/internal/kms-utils.h
#ifndef __KMS_UTILS_H__ #define __KMS_UTILS_H__ #include <gst/gst.h> GstElement* kms_get_pipeline(); void kms_dynamic_connection(GstElement *orig, GstElement *dest, const gchar *name); GstElement* kms_utils_get_element_for_caps(GstElementFactoryListType type, GstRank rank, const GstCaps *caps, GstPadDirection direction, gboolean subsetonly, const gchar *name); #endif /* __KMS_UTILS_H__ */
#ifndef __KMS_UTILS_H__ #define __KMS_UTILS_H__ #include <gst/gst.h> #define KMS_DEBUG_PIPE(name) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS( \ GST_BIN(kms_get_pipeline()), \ GST_DEBUG_GRAPH_SHOW_ALL, name); \ GstElement* kms_get_pipeline(); void kms_dynamic_connection(GstElement *orig, GstElement *dest, const gchar *name); GstElement* kms_utils_get_element_for_caps(GstElementFactoryListType type, GstRank rank, const GstCaps *caps, GstPadDirection direction, gboolean subsetonly, const gchar *name); #endif /* __KMS_UTILS_H__ */
Create a macro for pipeline debugging
Create a macro for pipeline debugging
C
lgpl-2.1
lulufei/kurento-media-server,shelsonjava/kurento-media-server,shelsonjava/kurento-media-server,mparis/kurento-media-server,todotobe1/kurento-media-server,Kurento/kurento-media-server,Kurento/kurento-media-server,mparis/kurento-media-server,TribeMedia/kurento-media-server,TribeMedia/kurento-media-server,lulufei/kurento-media-server,todotobe1/kurento-media-server
ec313ebc744efcab09f2782aa86067cbeec8a424
[42]_Bleichenbacher_s_e3_RSA_Attack/rsa_sign_constants.h
[42]_Bleichenbacher_s_e3_RSA_Attack/rsa_sign_constants.h
#ifndef _RSA_SIGN_CONSTANTS_H_ #define _RSA_SIGN_CONSTANTS_H_ /* * RSA Block length. Used to determine the modulo's size. */ #define RSA_SIGN_BLOCK_LEN (1024) #define RSA_SIGN_HASH_METHOD_SHA_1 ("sha1") #define RSA_SIGN_HASH_METHOD_SHA_256 ("sha256") /* * Supported Hashing methods for RSA signature validation */ enum rsa_sign_hash_method {SHA1, SHA256 }; #endif /* _RSA_SIGN_CONSTANTS_H_ */
#ifndef _RSA_SIGN_CONSTANTS_H_ #define _RSA_SIGN_CONSTANTS_H_ /* * RSA Block length. Used to determine the modulo's size. */ #define RSA_SIGN_BLOCK_LEN (RSA_SIGN_KEY_BITSIZE/8) #define RSA_SIGN_KEY_BITSIZE (1024) #define RSA_SIGN_HASH_METHOD_SHA_1 ("sha1") #define RSA_SIGN_HASH_METHOD_SHA_256 ("sha256") /* * Supported Hashing methods for RSA signature validation */ enum rsa_sign_hash_method {SHA1, SHA256 }; #endif /* _RSA_SIGN_CONSTANTS_H_ */
Add RSA byte length constant
Add RSA byte length constant A RSA byte length define was added to disambiguate RSA_KEY_BITLENGTH (typically 1024 here) from the RSA byte block length.
C
mit
lucasg/Cryptopals,lucasg/Cryptopals,lucasg/Cryptopals,lucasg/Cryptopals
55af85fb1da9a202d6ca6f437c30b927d4153c39
Include/KAI/Platform/GameController.h
Include/KAI/Platform/GameController.h
#ifndef KAI_PLATFORM_GAME_CONTROLLER_H #define KAI_PLATFORM_GAME_CONTROLLER_H #include KAI_PLATFORM_INCLUDE(GameController.h) #endif // SHATTER_PLATFORM_GAME_CONTROLLER_H //EOF
#ifndef KAI_PLATFORM_GAME_CONTROLLER_H #define KAI_PLATFORM_GAME_CONTROLLER_H #include KAI_PLATFORM_INCLUDE(GameController.h) #endif //EOF
Add some color for console output
Add some color for console output Former-commit-id: 315cc71afe5d5245e60ce4564328619c49310b6a Former-commit-id: 4afa9ab712a2bdbef25bee286ff0bdcf2a8da2b2
C
mit
cschladetsch/KAI,cschladetsch/KAI,cschladetsch/KAI
296a1a19d14a6bf5d97e66370d89f0b64da87175
iree/compiler/Translation/SPIRV/LinalgToSPIRV/Passes.h
iree/compiler/Translation/SPIRV/LinalgToSPIRV/Passes.h
// Copyright 2020 Google LLC // // 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 // // https://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 IREE_COMPILER_TRANSLATION_SPIRV_LINALGTOSPIRV_PASSES_H #define IREE_COMPILER_TRANSLATION_SPIRV_LINALGTOSPIRV_PASSES_H #include "mlir/Pass/Pass.h" namespace mlir { namespace iree_compiler { /// Pass to get gpu.module from a gpu.launch operation. std::unique_ptr<OpPassBase<FuncOp>> createIREEGpuKernelOutliningPass(); } // namespace iree_compiler } // namespace mlir #endif
// Copyright 2020 Google LLC // // 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 // // https://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 IREE_COMPILER_TRANSLATION_SPIRV_LINALGTOSPIRV_PASSES_H #define IREE_COMPILER_TRANSLATION_SPIRV_LINALGTOSPIRV_PASSES_H #include "mlir/Pass/Pass.h" namespace mlir { namespace iree_compiler { /// Pass to get gpu.module from a gpu.launch operation. std::unique_ptr<OpPassBase<ModuleOp>> createIREEGpuKernelOutliningPass(); } // namespace iree_compiler } // namespace mlir #endif
Fix mismatch in function signature and implementation.
Fix mismatch in function signature and implementation. PiperOrigin-RevId: 299956663
C
apache-2.0
google/iree,iree-org/iree,iree-org/iree,iree-org/iree,iree-org/iree,google/iree,google/iree,google/iree,iree-org/iree,iree-org/iree,iree-org/iree,google/iree,google/iree,google/iree
63240613241e0de9b977cc2986ef801a40102ddc
PerfCounter.h
PerfCounter.h
#ifndef TUVOK_PERF_COUNTER_H #define TUVOK_PERF_COUNTER_H /// Valid performance counters the system should track. /// When adding a new counter, please add a (units) clause so we know how to /// interpret the value! enum PerfCounter { PERF_DISK_READ=0, // reading bricks from disk (seconds) PERF_DECOMPRESSION, // decompressing brick data (seconds) PERF_COMPRESSION, // compressing brick data (seconds) PERF_BRICKS, // number of bricks read/processed (counter) PERF_END_IO, // invalid; end of IO-based metrics PERF_READ_HTABLE=1000, // reading hash table from GPU (seconds) PERF_CONDENSE_HTABLE, // condensing hash table [removing empties] (seconds) PERF_RENDER, // (seconds) PERF_UPLOAD_BRICKS, // uploading bricks to GPU [tex updates] (seconds) PERF_END_RENDER, // invalid; end of render-based metrics PERF_END // invalid; used for sizing table. }; /// interface for classes which can be queried in this way. struct PerfQueryable { virtual double PerfQuery(enum PerfCounter) = 0; }; #endif /* For more information, please see: http://software.sci.utah.edu The MIT License Copyright (c) 2013 Interactive Visualization and Data Analysis Group 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. */
Add generic perf counter definitions.
Add generic perf counter definitions. git-svn-id: 0a20d38d1bcdb3210d244a647211d61b0aabf366@284 5b8196f7-c1c0-4be6-8b13-4feed349168d
C
mit
BlueBrain/Tuvok,BlueBrain/Tuvok,BlueBrain/Tuvok
af6f4f4b27bc1d2e6200dbeff38a8f2f21d3dc4a
PcAtChipsetPkg/Include/Guid/PcAtChipsetTokenSpace.h
PcAtChipsetPkg/Include/Guid/PcAtChipsetTokenSpace.h
/** @file GUID for PcAtChipsetPkg PCD Token Space Copyright (c) 2009, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #ifndef _PCATCHIPSET_TOKEN_SPACE_GUID_H_ #define _PCATCHIPSET_TOKEN_SPACE_GUID_H_ #define PCATCHIPSET_TOKEN_SPACE_GUID \ { \ 0x326ae723, 0xae32, 0x4589, { 0x98, 0xb8, 0xca, 0xc2, 0x3c, 0xdc, 0xc1, 0xb1 } \ } extern EFI_GUID gPcAtChipsetPkgTokenSpaceGuid; #endif
Add declaration header file for token space.
Add declaration header file for token space. git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@8781 6f19259b-4bc3-4df7-8a09-765794883524
C
bsd-2-clause
MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2
2307eb88c7452b5a83f7a7931bdf2a0a0435f5f8
test/input/replace_minus.c
test/input/replace_minus.c
#include <string.h> #include "../../input.h" int main(void) { char before[64] = "-2+1"; char after[64] = "(0-2.000000)+1"; replace_minus(before); if (strcmp(before, after) == 0){ return (0); } else { return (-1); } }
#include <string.h> #include "../../input.h" int main(void) { // a case removable char before1[64] = "-2+1"; char after1[64] = "(0-2.000000)+1"; replace_minus(before1); if (strcmp(before1, after1) != 0){ return (-1); } // a case not removable char before2[64] = "3-2"; char after2[64] = "3-2"; replace_minus(before2); if (strcmp(before2, after2) != 0){ return (-1); } return (0); }
Add new test to remove_minus
Add new test to remove_minus
C
mit
Roadagain/Calculator,Roadagain/Calculator
40225798d32b3b36bf03583865fe88bfee2f31bc
lib/Common/Memory/MarkContextWrapper.h
lib/Common/Memory/MarkContextWrapper.h
//------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- #include "core/RecyclerHeapMarkingContext.h" // Class used to wrap a MarkContext so that calls to MarkObjects during IRecyclerVisitedObject::Trace // can mark with the correct contextual template parameters template<bool parallel> class MarkContextWrapper : public IRecyclerHeapMarkingContext { public: MarkContextWrapper(MarkContext* context) : markContext(context) {} void __stdcall MarkObjects(void** objects, size_t count, void* parent) override { for (size_t i = 0; i < count; i++) { // We pass true for interior, since we expect a majority of the pointers being marked by // external objects to themselves be external (and thus candidates for interior pointers). markContext->Mark<parallel, /*interior*/true, /*doSpecialMark*/ false>(objects[i], parent); } } private: // Should only be created on the stack void* operator new(size_t); MarkContext* markContext; };
//------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- #include "Core/RecyclerHeapMarkingContext.h" // Class used to wrap a MarkContext so that calls to MarkObjects during IRecyclerVisitedObject::Trace // can mark with the correct contextual template parameters template<bool parallel> class MarkContextWrapper : public IRecyclerHeapMarkingContext { public: MarkContextWrapper(MarkContext* context) : markContext(context) {} void __stdcall MarkObjects(void** objects, size_t count, void* parent) override { for (size_t i = 0; i < count; i++) { // We pass true for interior, since we expect a majority of the pointers being marked by // external objects to themselves be external (and thus candidates for interior pointers). markContext->Mark<parallel, /*interior*/true, /*doSpecialMark*/ false>(objects[i], parent); } } private: // Should only be created on the stack void* operator new(size_t); MarkContext* markContext; };
Fix casing for relatively included header to fix Linux builds
Fix casing for relatively included header to fix Linux builds
C
mit
mrkmarron/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore,Microsoft/ChakraCore,mrkmarron/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore,Microsoft/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore,mrkmarron/ChakraCore
5284cde440e54c6a841efb6a5864afdf3a0aa78e
sdl2cubes/tests/test_mesh.c
sdl2cubes/tests/test_mesh.c
#include "../src/mesh_obj.h" #include <stdio.h> #include <stdlib.h> int main(int argc, char *args[]) { if(argc < 2) { printf("test_mesh test-mesh-name.obj\n"); return 0; } // read mesh from standard input, push into obj parser Mesh *mesh = meshReadOBJ(args[1]); if(!mesh) { return 0; } unsigned numFloats = meshGetNumFloats(mesh); unsigned numVertices = meshGetNumVertices(mesh); float *buf = malloc(sizeof(float) * numFloats); meshPackVertices(mesh, buf); meshClose(mesh); return 0; }
#include "../src/mesh_obj.h" #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *args[]) { if(argc < 2) { printf("usage: test_mesh filename.obj\n"); printf(" pass - (a dash character) as filename to read from stdin\n"); return 0; } Mesh *mesh; // read mesh from standard input or file, push into obj parser if(!strcmp("-", args[1])) { mesh = meshReadOBJF(stdin, "(stdin)"); } else { mesh = meshReadOBJ(args[1]); } if(!mesh) { return 0; } unsigned numFloats = meshGetNumFloats(mesh); unsigned numVertices = meshGetNumVertices(mesh); float *buf = malloc(sizeof(float) * numFloats); meshPackVertices(mesh, buf); meshClose(mesh); free(buf); return 0; }
Make mesh loader actually read stdin
tests: Make mesh loader actually read stdin
C
unlicense
teistiz/instanssi-samples
adcbe2a70a34603eba67d5048b37132804472cda
src/libidaten/cuda/cudainit.h
src/libidaten/cuda/cudainit.h
#pragma once #include <cuda.h> #include "cuda/cudautil.h" namespace idaten { void initCuda() { checkCudaErrors(cuInit(0)); } }
#pragma once #include <cuda.h> #include "cuda/cudautil.h" namespace idaten { inline void initCuda() { checkCudaErrors(cuInit(0)); } }
Fix a bug that not inlined.
Fix a bug that not inlined.
C
mit
nakdai/aten,nakdai/aten
8f81b4e9d5c0bb8cd34da1d62d670cfa26446e43
src/google/protobuf/stubs/atomicops_internals_pnacl.h
src/google/protobuf/stubs/atomicops_internals_pnacl.h
// Protocol Buffers - Google's data interchange format // Copyright 2012 Google Inc. All rights reserved. // http://code.google.com/p/protobuf/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // This file is an internal atomic implementation, use atomicops.h instead. #ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PNACL_H_ #define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PNACL_H_ namespace google { namespace protobuf { namespace internal { inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, Atomic32 old_value, Atomic32 new_value) { return __sync_val_compare_and_swap(ptr, old_value, new_value); } inline void MemoryBarrier() { __sync_synchronize(); } inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr, Atomic32 old_value, Atomic32 new_value) { Atomic32 ret = NoBarrier_CompareAndSwap(ptr, old_value, new_value); MemoryBarrier(); return ret; } inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { MemoryBarrier(); *ptr = value; } inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { Atomic32 value = *ptr; MemoryBarrier(); return value; } } // namespace internal } // namespace protobuf } // namespace google #endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PNACL_H_
Add the missing PNaCl atomicops support.
Add the missing PNaCl atomicops support.
C
bsd-3-clause
malthe/google-protobuf,malthe/google-protobuf,malthe/google-protobuf,malthe/google-protobuf,malthe/google-protobuf
fa458a1f7c574c0fe8d40dff4c1af418c365b8ad
src/main.c
src/main.c
#include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <errno.h> #include "basic.h" #include "tuntap_if.h" #include "utils.h" int main(int argc, char** argv) { int tun_fd; char buf[100]; char *dev = calloc(10, 1); CLEAR(buf); tun_fd = tun_alloc(dev); if (set_if_up(dev) != 0) { printf("ERROR when setting up if\n"); } if (set_if_address(dev, "10.0.0.5/24") != 0) { printf("ERROR when setting address for if\n"); }; if (set_if_route(dev, "10.0.0.0/24") != 0) { printf("ERROR when setting route for if\n"); } read(tun_fd, buf, 100); print_hexdump(buf, 100); free(dev); }
#include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <errno.h> #include "basic.h" #include "tuntap_if.h" #include "utils.h" int main(int argc, char** argv) { int tun_fd; char buf[100]; char *dev = calloc(10, 1); CLEAR(buf); tun_fd = tun_alloc(dev); if (set_if_up(dev) != 0) { printf("ERROR when setting up if\n"); } if (set_if_address(dev, "10.0.0.5/24") != 0) { printf("ERROR when setting address for if\n"); }; if (set_if_route(dev, "10.0.0.0/24") != 0) { printf("ERROR when setting route for if\n"); } while (1) { read(tun_fd, buf, 100); print_hexdump(buf, 100); } free(dev); }
Read from tun buffer and print hexdump in loop
Read from tun buffer and print hexdump in loop
C
mit
saminiir/level-ip,saminiir/level-ip
d222c00f6c4fe1aea3bf4afe45582af8977d6d59
Sensorama/Sensorama/SRDataModel.h
Sensorama/Sensorama/SRDataModel.h
// // SRDataModel.h // Sensorama // // Created by Wojciech Adam Koszek (h) on 19/04/2016. // Copyright © 2016 Wojciech Adam Koszek. All rights reserved. // #import <Foundation/Foundation.h> #import "Realm/Realm.h" @interface SRDataPoint : RLMObject @property NSNumber<RLMInt> *accX; @property NSNumber<RLMInt> *accY; @property NSNumber<RLMInt> *accZ; @property NSNumber<RLMInt> *magX; @property NSNumber<RLMInt> *magY; @property NSNumber<RLMInt> *magZ; @property NSNumber<RLMInt> *gyroX; @property NSNumber<RLMInt> *gyroY; @property NSNumber<RLMInt> *gyroZ; @property NSInteger fileId; @property NSInteger curTime; @end @interface SRDataFile : RLMObject @property NSString *username; @property NSString *desc; /* need to do something about device_info */ @property NSInteger sampleInterval; @property BOOL accEnabled; @property BOOL magEnabled; @property BOOL gyroEnabled; @property NSDate *dateStart; @property NSDate *dateEnd; @property NSInteger fileId; @end
// // SRDataModel.h // Sensorama // // Created by Wojciech Adam Koszek (h) on 19/04/2016. // Copyright © 2016 Wojciech Adam Koszek. All rights reserved. // #import <Foundation/Foundation.h> #import "Realm/Realm.h" @interface SRDataPoint : RLMObject @property NSNumber<RLMInt> *accX; @property NSNumber<RLMInt> *accY; @property NSNumber<RLMInt> *accZ; @property NSNumber<RLMInt> *magX; @property NSNumber<RLMInt> *magY; @property NSNumber<RLMInt> *magZ; @property NSNumber<RLMInt> *gyroX; @property NSNumber<RLMInt> *gyroY; @property NSNumber<RLMInt> *gyroZ; @property NSInteger fileId; @property NSInteger curTime; @end @interface SRDataFile : RLMObject @property NSString *username; @property NSString *desc; @property NSString *timezone; /* need to do something about device_info */ @property NSInteger sampleInterval; @property BOOL accEnabled; @property BOOL magEnabled; @property BOOL gyroEnabled; @property NSDate *dateStart; @property NSDate *dateEnd; @property NSInteger fileId; @end
Add the timezone to the data model.
Add the timezone to the data model.
C
bsd-2-clause
wkoszek/sensorama-ios,wkoszek/sensorama-ios,wkoszek/sensorama-ios,wkoszek/sensorama-ios
f6392137118661add2ab7fc98be42a0c8748bb1d
lib/enable_execute_stack.c
lib/enable_execute_stack.c
//===-- enable_execute_stack.c - Implement __enable_execute_stack ---------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include <stdint.h> #include <sys/mman.h> // // The compiler generates calls to __enable_execute_stack() when creating // trampoline functions on the stack for use with nested functions. // It is expected to mark the page(s) containing the address // and the next 48 bytes as executable. Since the stack is normally rw- // that means changing the protection on those page(s) to rwx. // void __enable_execute_stack(void* addr) { #if __APPLE__ // On Darwin, pagesize is always 4096 bytes const uintptr_t pageSize = 4096; #else // FIXME: We should have a configure check for this. const uintptr_t pagesize = getpagesize(); #endif const uintptr_t pageAlignMask = ~(pageSize-1); uintptr_t p = (uintptr_t)addr; unsigned char* startPage = (unsigned char*)(p & pageAlignMask); unsigned char* endPage = (unsigned char*)((p+48+pageSize) & pageAlignMask); mprotect(startPage, endPage-startPage, PROT_READ | PROT_WRITE | PROT_EXEC); }
//===-- enable_execute_stack.c - Implement __enable_execute_stack ---------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include <stdint.h> #include <sys/mman.h> #ifndef __APPLE__ #include <unistd.h> #endif // // The compiler generates calls to __enable_execute_stack() when creating // trampoline functions on the stack for use with nested functions. // It is expected to mark the page(s) containing the address // and the next 48 bytes as executable. Since the stack is normally rw- // that means changing the protection on those page(s) to rwx. // void __enable_execute_stack(void* addr) { #if __APPLE__ // On Darwin, pagesize is always 4096 bytes const uintptr_t pageSize = 4096; #else // FIXME: We should have a configure check for this. const uintptr_t pageSize = getpagesize(); #endif const uintptr_t pageAlignMask = ~(pageSize-1); uintptr_t p = (uintptr_t)addr; unsigned char* startPage = (unsigned char*)(p & pageAlignMask); unsigned char* endPage = (unsigned char*)((p+48+pageSize) & pageAlignMask); mprotect(startPage, endPage-startPage, PROT_READ | PROT_WRITE | PROT_EXEC); }
Add missing include for getpagesize, and fix a typo.
Add missing include for getpagesize, and fix a typo. git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@74588 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt
a683ed193b85656e90ca7ee54298106fa6a313e4
tests/regression/36-octapron/17-traces-rpb-litmus.c
tests/regression/36-octapron/17-traces-rpb-litmus.c
// SKIP PARAM: --sets ana.activated[+] octApron #include <pthread.h> #include <assert.h> int g = 42; // matches write in t_fun pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { // pthread_mutex_lock(&A); // pthread_mutex_lock(&B); // g = 42; // pthread_mutex_unlock(&B); // pthread_mutex_unlock(&A); return NULL; } int main(void) { int r, t; pthread_t id; pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&A); pthread_mutex_lock(&B); if (r * r) { g = 17; pthread_mutex_unlock(&B); // publish to g#prot pthread_mutex_lock(&B); } // locally written g is only in one branch, g == g#prot should be forgotten! t = g; assert(t == 17); // UNKNOWN! pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); return 0; }
// SKIP PARAM: --sets ana.activated[+] octApron #include <pthread.h> #include <assert.h> int g = 42; // matches write in t_fun pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&A); pthread_mutex_lock(&B); g = 42; pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); return NULL; } int main(void) { int r, t; pthread_t id; pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&A); pthread_mutex_lock(&B); if (r) { g = 17; pthread_mutex_unlock(&B); // publish to g#prot pthread_mutex_lock(&B); } // locally written g is only in one branch, g == g#prot should be forgotten! t = g; assert(t == 17); // UNKNOWN! pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); return 0; }
Remove debugging changes from 36/17
Remove debugging changes from 36/17
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
4e1124d7c68bc85cc6b6f1adceb63034d4bfe812
src/REvent.h
src/REvent.h
#ifndef __INCLUDED_6FCA43F2953F11E6AA6EA088B4D1658C #define __INCLUDED_6FCA43F2953F11E6AA6EA088B4D1658C #include <RTypes.h> class REvent { public: REvent(); virtual ~REvent(); void accept(); void ignore(); bool isAccepted() const; void setAccepted(bool accepted); virtual rcount type() const; static rcount registerEventType(); private: bool mIsAccepted; }; /** * An easy wrapper template for generate type() method and provide auto * registered static type variable. So that you could focus on the * implementation of event class. */ template <class DerivedType, class BaseType> class TypeRegisteredEvent : public BaseType { public: rcount type() const { return sType; } static inline rcount staticType() { return sType; } private: static const rcount sType; }; template <class DerivedType, class BaseType> const rcount TypeRegisteredEvent<DerivedType, BaseType>::sType = REvent::registerEventType(); #endif // __INCLUDED_6FCA43F2953F11E6AA6EA088B4D1658C
#ifndef __INCLUDED_6FCA43F2953F11E6AA6EA088B4D1658C #define __INCLUDED_6FCA43F2953F11E6AA6EA088B4D1658C #include <RTypes.h> class REvent { public: REvent(); virtual ~REvent(); void accept(); void ignore(); bool isAccepted() const; void setAccepted(bool accepted); virtual rcount type() const; static rcount registerEventType(); private: bool mIsAccepted; }; /** * An easy wrapper template for generate type() method and provide auto * registered static type variable. So that you could focus on the * implementation of event class. */ template <class DerivedType, class BaseType = REvent> class TypeRegisteredEvent : public BaseType { public: // Inherit all constructors template <class ... ParamTypes> TypeRegisteredEvent(ParamTypes ... params) : BaseType(params ...) { } rcount type() const { return sType; } static inline rcount staticType() { return sType; } private: static const rcount sType; }; template <class DerivedType, class BaseType> const rcount TypeRegisteredEvent<DerivedType, BaseType>::sType = REvent::registerEventType(); #endif // __INCLUDED_6FCA43F2953F11E6AA6EA088B4D1658C
Support inhert constructors from BaseType
Support inhert constructors from BaseType
C
mit
starofrainnight/ArduinoRabirdTookit,starofrainnight/ArduinoRabirdToolkit,starofrainnight/ArduinoRabirdToolkit
6f24c8ade6012005ceb41b4a2cc70a021d7f1d64
src/trusted/service_runtime/linux/arm/sel_segments.c
src/trusted/service_runtime/linux/arm/sel_segments.c
/* * Copyright (c) 2012 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include <stdint.h> #include "native_client/src/trusted/service_runtime/sel_util.h" uint32_t NaClGetStackPtr(void) { uint32_t sp; asm("mov %0, %%sp" : "=r" (sp)); return sp; }
/* * Copyright (c) 2012 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include <stdint.h> #include "native_client/src/trusted/service_runtime/sel_util.h" uint32_t NaClGetStackPtr(void) { uint32_t sp; asm("mov %0, sp" : "=r" (sp)); return sp; }
Make sel build with clang's built-in assembler.
arm: Make sel build with clang's built-in assembler. clang's integrated assembler only supports UAL, where sp is spelled sp and not %sp. Fixes the following error when building with clang's integrated assembler enabled: ../../native_client/src/trusted/service_runtime/linux/arm/sel_segments.c:13:7: error: unexpected token in operand asm("mov %0, %%sp" : "=r" (sp)); ^ <inline asm>:1:10: note: instantiated into assembly here mov r0, %sp ^ 1 error generated. BUG=chromium:124610 Review URL: https://codereview.chromium.org/1485143002
C
bsd-3-clause
sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client
0f00cf915c8c590d1b00e89ac5e883fe3bfd1213
main.c
main.c
#include <stdio.h> #include <stdlib.h> #include "src/headers.h" int main() { char* taskfilepath = "D:\\zz_exp\\testinggrounds\\tasks.txt"; task_list* list = gettasks(taskfilepath); task_list* traveller = list; while ( traveller != NULL ) { task_t* task = traveller -> task; result_t* result = deliver(task); printf("MESSAGE: %s\n", result -> message); traveller = traveller -> next; } return 0; }
#include <stdio.h> #include <stdlib.h> #include "src/headers.h" int main(int argc, char** argv) { for ( int x = 0; x < argc; x++ ) { char* taskfilepath = argv[x]; task_list* list = gettasks(taskfilepath); task_list* traveller = list; while ( traveller != NULL ) { task_t* task = traveller -> task; result_t* result = deliver(task); printf("MESSAGE: %s\n", result -> message); traveller = traveller -> next; } } return 0; }
Allow user to indicate filepaths of taskfiles
v2.0.1: Allow user to indicate filepaths of taskfiles User can now usee multiple taskfiles and specify via arguments the location of taskfiles to be used
C
mit
DanerJimenez/File-Delivery-Truck
ab1766cc27f548384b400de3b2417c598da3b503
src/hello_zproto_selftest.c
src/hello_zproto_selftest.c
/* ========================================================================= hello_zproto_selftest - run self tests Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========================================================================= */ #include "../include/hello_zproto.h" int main (int argc, char *argv []) { bool verbose; if (argc == 2 && streq (argv [1], "-v")) verbose = true; else verbose = false; printf ("Running self tests...\n"); hello_zproto_msg_test (verbose); citizen_msg_test (verbose); printf ("Tests passed OK\n"); return 0; }
/* ========================================================================= hello_zproto_selftest - run self tests Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========================================================================= */ #include "../include/hello_zproto.h" int main (int argc, char *argv []) { bool verbose; if (argc == 2 && streq (argv [1], "-v")) verbose = true; else verbose = false; printf ("Running self tests...\n"); hello_zproto_msg_test (verbose); citizen_msg_test (verbose); citizen_server_test (verbose); printf ("Tests passed OK\n"); return 0; }
Add citizen_server self test to overall self test
Add citizen_server self test to overall self test
C
mit
jemc/hello_zproto,jemc/hello_zproto,jemc/hello_zproto,jemc/hello_zproto
18cee717a922876b67f94000db165a875033fb9e
mudlib/mud/home/Text/sys/verb/wiz/ooc/system/borphans.c
mudlib/mud/home/Text/sys/verb/wiz/ooc/system/borphans.c
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2012 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.h> #include <text/paths.h> inherit LIB_RAWVERB; void main(object actor, string args) { object user; user = query_user(); if (user->query_class() < 3) { send_out("You do not have sufficient access rights to check for bigstruct orphans.\n"); return; } "~Bigstruct/sys/bigstructd"->find_orphaned_nodes(); "~Bigstruct/sys/bigstructd"->find_orphaned_roots(); }
Add command to clean up orphaned bigstruct objects
Add command to clean up orphaned bigstruct objects
C
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka