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
acb1a34584a2f31dbe59b77d48f782042293b049
include/ieeefp.h
include/ieeefp.h
/* $NetBSD: ieeefp.h,v 1.4 1998/01/09 08:03:43 perry Exp $ */ /* * Written by J.T. Conklin, Apr 6, 1995 * Public domain. */ #ifndef _IEEEFP_H_ #define _IEEEFP_H_ #include <sys/cdefs.h> #include <machine/ieeefp.h> #ifdef __i386__ #include <machine/floatingpoint.h> #else /* !__i386__ */ extern fp_rnd fpgetround __P((void)); extern fp_rnd fpsetround __P((fp_rnd)); extern fp_except fpgetmask __P((void)); extern fp_except fpsetmask __P((fp_except)); extern fp_except fpgetsticky __P((void)); extern fp_except fpsetsticky __P((fp_except)); #endif /* __i386__ */ #endif /* _IEEEFP_H_ */
/* $NetBSD: ieeefp.h,v 1.4 1998/01/09 08:03:43 perry Exp $ */ /* * Written by J.T. Conklin, Apr 6, 1995 * Public domain. */ #ifndef _IEEEFP_H_ #define _IEEEFP_H_ #include <sys/cdefs.h> #include <machine/ieeefp.h> #ifdef __i386__ #include <machine/floatingpoint.h> #else /* !__i386__ */ __BEGIN_DECLS extern fp_rnd fpgetround __P((void)); extern fp_rnd fpsetround __P((fp_rnd)); extern fp_except fpgetmask __P((void)); extern fp_except fpsetmask __P((fp_except)); extern fp_except fpgetsticky __P((void)); extern fp_except fpsetsticky __P((fp_except)); __END_DECLS #endif /* __i386__ */ #endif /* _IEEEFP_H_ */
Allow fpsetmask(3) and friends to be used from a C++ program on the Alpha.
Allow fpsetmask(3) and friends to be used from a C++ program on the Alpha. Reviewed by: dfr
C
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
cec1dca33ecc1716d111ad5a8978342913950d5a
include/rapidcheck/detail/Meta.h
include/rapidcheck/detail/Meta.h
#pragma once namespace rc { namespace detail { //! We don't want to require C++14 so we make our own version of this. template<typename T, T ...Ints> struct IntSequence; //! If T == std::size_t template<std::size_t ...Ints> using IndexSequence = IntSequence<std::size_t, Ints...>; template<typename Sequence, std::size_t N> struct MakeIntSequenceImpl; template<typename IntT> struct MakeIntSequenceImpl<IntSequence<IntT>, 0> { typedef IntSequence<IntT> Sequence; }; template<typename IntT, IntT ...Ints> struct MakeIntSequenceImpl<IntSequence<IntT, 0, Ints...>, 0> { typedef IntSequence<IntT, 0, Ints...> Sequence; }; template<typename IntT, IntT ...Ints, std::size_t N> struct MakeIntSequenceImpl<IntSequence<IntT, Ints...>, N> { typedef typename MakeIntSequenceImpl< IntSequence<IntT, N - 1, Ints...>, N - 1>::Sequence Sequence; }; //! Creates an `IntSequence` from 0 to N exclusive. template<typename T, T N> using MakeIntSequence = typename MakeIntSequenceImpl<IntSequence<T>, N>::Sequence; //! Alias for MakeIntSequence<std::size_t, N> template<std::size_t N> using MakeIndexSequence = MakeIntSequence<std::size_t, N>; } // namespace detail } // namespace rc
Add integer sequence TMP utilities
Add integer sequence TMP utilities
C
bsd-2-clause
emil-e/rapidcheck,tm604/rapidcheck,whoshuu/rapidcheck,emil-e/rapidcheck,tm604/rapidcheck,whoshuu/rapidcheck,whoshuu/rapidcheck,unapiedra/rapidfuzz,unapiedra/rapidfuzz,emil-e/rapidcheck,unapiedra/rapidfuzz,tm604/rapidcheck
965703d6abaaf700e4c5307597b7f298843b0e32
src/lib-fts/fts-filter-private.h
src/lib-fts/fts-filter-private.h
#ifndef FTS_FILTER_PRIVATE_H #define FTS_FILTER_PRIVATE_H #define FTS_FILTER_CLASSES_NR 3 /* API that stemming providers (classes) must provide: The register() function is called when the class is registered via fts_filter_register() The create() function is called to get an instance of a registered filter class. The destroy function is called to destroy an instance of a filter. */ struct fts_filter_vfuncs { int (*create)(const struct fts_language *lang, const char *const *settings, struct fts_filter **filter_r, const char **error_r); int (*filter)(struct fts_filter *filter, const char **token, const char **error_r); void (*destroy)(struct fts_filter *filter); }; struct fts_filter { const char *class_name; /* name of the class this is based on */ const struct fts_filter_vfuncs *v; int refcount; struct fts_filter *parent; }; #endif
#ifndef FTS_FILTER_PRIVATE_H #define FTS_FILTER_PRIVATE_H #define FTS_FILTER_CLASSES_NR 3 /* API that stemming providers (classes) must provide: The create() function is called to get an instance of a registered filter class. The filter() function is called with tokens for the specific filter. The destroy function is called to destroy an instance of a filter. */ struct fts_filter_vfuncs { int (*create)(const struct fts_language *lang, const char *const *settings, struct fts_filter **filter_r, const char **error_r); int (*filter)(struct fts_filter *filter, const char **token, const char **error_r); void (*destroy)(struct fts_filter *filter); }; struct fts_filter { const char *class_name; /* name of the class this is based on */ const struct fts_filter_vfuncs *v; int refcount; struct fts_filter *parent; }; #endif
Correct comment in filter internal API.
lib-fts: Correct comment in filter internal API.
C
mit
dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot
6e40568c6c6297fa0fcc85a6f8116af5bc167f69
linkedlist.c
linkedlist.c
/** */ #include "linkedlist.h" /** * Create a new empty linked list. */ LinkedList* createList(void) { LinkedList *list = (LinkedList *) malloc(sizeof(LinkedList)); /* * If no error in allocating, initialise list contents. */ if (list) list->head = NULL; return list; } /** * Delete an entire list. * * TODO: use double pointer to allow setting to NULL from inside? */ void deleteList(LinkedList *list) { LinkedListNode *current, *next; current = list->head; next = current; while (next) { next = current->next; free(current); current = next; } free(list); } /** * Add an element to the start. * * Precondition: list is a valid pointer */ void insertStart(LinkedList *list, LinkedListData data) { LinkedListNode *node = (LinkedListNode *) malloc(sizeof(LinkedListNode)); /* * If no error, proceed to add node to list. */ if (node) { node->data = data; node->next = list->head; list->head = node; } } /** * Delete an element at the start. * * Precondition: list is a valid pointer */ void removeStart(LinkedList *list) { if (list->head) { LinkedListNode *node = list->head; list->head = node->next; free(node); } }
/** */ #include "linkedlist.h" /** * Create a new empty linked list. */ LinkedList* createList(void) { LinkedList *list = (LinkedList *) malloc(sizeof(LinkedList)); /* * If no error in allocating, initialise list contents. */ if (list) list->head = NULL; return list; } /** * Delete an entire list. * * TODO: use double pointer to allow setting to NULL from inside? */ void deleteList(LinkedList *list) { if (list != NULL) { LinkedListNode *current, *next; current = list->head; next = current; while (next) { next = current->next; free(current); current = next; } free(list); } } /** * Add an element to the start. * * Precondition: list is a valid pointer */ void insertStart(LinkedList *list, LinkedListData data) { LinkedListNode *node = (LinkedListNode *) malloc(sizeof(LinkedListNode)); /* * If no error, proceed to add node to list. */ if (node) { node->data = data; node->next = list->head; list->head = node; } } /** * Delete an element at the start. * * Precondition: list is a valid pointer */ void removeStart(LinkedList *list) { if (list->head) { LinkedListNode *node = list->head; list->head = node->next; free(node); } }
Add check for null pointer in deleteList()
Add check for null pointer in deleteList()
C
mit
jradtilbrook/linkedlist
a412123bebbec376d4df8d06a06061d9bd45dd64
src/ibmras/common/common.h
src/ibmras/common/common.h
/******************************************************************************* * Copyright 2016 IBM Corp. * * 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 ibmras_common_common_h #define ibmras_common_common_h #include <sstream> namespace ibmras { namespace common { template <class T> std::string itoa(T t) { #ifdef _WINDOWS return std::to_string(static_cast<long long>(t)); #else std::stringstream s; s << t; return s.str(); #endif std::string ftoa(T t) { #ifdef _WINDOWS return std::to_string(static_cast<long double>(t)); #else std::stringstream s; s << t; return s.str(); #endif } } } #endif /* ibmras_common_common_h */
/******************************************************************************* * Copyright 2016 IBM Corp. * * 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 ibmras_common_common_h #define ibmras_common_common_h #include <sstream> namespace ibmras { namespace common { template <class T> std::string itoa(T t) { #ifdef _WINDOWS return std::to_string(static_cast<long long>(t)); #else std::stringstream s; s << t; return s.str(); #endif template <class T> std::string ftoa(T t) { #ifdef _WINDOWS return std::to_string(static_cast<long double>(t)); #else std::stringstream s; s << t; return s.str(); #endif } } } #endif /* ibmras_common_common_h */
Make ftoa a template function
Make ftoa a template function
C
apache-2.0
RuntimeTools/omr-agentcore,RuntimeTools/omr-agentcore,RuntimeTools/omr-agentcore,RuntimeTools/omr-agentcore,RuntimeTools/omr-agentcore
ac5714bf291199e3d820dacbeabe902aa0fcf769
display.h
display.h
/******************************************************************************* * Copyright (C) 2010, Linaro Limited. * * This file is part of PowerDebug. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Amit Arora <[email protected]> (IBM Corporation) * - initial API and implementation *******************************************************************************/ #define VALUE_MAX 16 WINDOW windows[TOTAL_FEATURE_WINS]; #define PT_COLOR_DEFAULT 1 #define PT_COLOR_HEADER_BAR 2 #define PT_COLOR_ERROR 3 #define PT_COLOR_RED 4 #define PT_COLOR_YELLOW 5 #define PT_COLOR_GREEN 6 #define PT_COLOR_BRIGHT 7 #define PT_COLOR_BLUE 8
/******************************************************************************* * Copyright (C) 2010, Linaro Limited. * * This file is part of PowerDebug. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Amit Arora <[email protected]> (IBM Corporation) * - initial API and implementation *******************************************************************************/ #define PT_COLOR_DEFAULT 1 #define PT_COLOR_HEADER_BAR 2 #define PT_COLOR_ERROR 3 #define PT_COLOR_RED 4 #define PT_COLOR_YELLOW 5 #define PT_COLOR_GREEN 6 #define PT_COLOR_BRIGHT 7 #define PT_COLOR_BLUE 8
Remove unused variables and definitions
Remove unused variables and definitions Signed-off-by: Daniel Lezcano <[email protected]> Signed-off-by: Amit Kucheria <[email protected]>
C
epl-1.0
yinquan529/platform-external-powerdebug,yinquan529/platform-external-powerdebug,gromaudio/android_external_powerdebug,gromaudio/android_external_powerdebug
68906b8b7ac54dcc9a23d74c26a31cd8a8d1f221
chrome/browser/autofill/autofill_dialog.h
chrome/browser/autofill/autofill_dialog.h
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_ #define CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_ #include <vector> #include "chrome/browser/autofill/autofill_profile.h" // Shows the AutoFill dialog, which allows the user to edit profile information. // |profiles| is a vector of autofill profiles that contains the current profile // information. The dialog fills out the profile fields using this data. Any // changes made to the profile information through the dialog should be // transferred back into |profiles|. void ShowAutoFillDialog(const std::vector<AutoFillProfile>& profiles); #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_
Add the AutoFillDialog header, needed by the cross-platform implementations to implement the autofill dialog.
Add the AutoFillDialog header, needed by the cross-platform implementations to implement the autofill dialog. BUG=none TEST=none Review URL: http://codereview.chromium.org/549014 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@36030 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
ropik/chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,adobe/chromium,adobe/chromium,gavinp/chromium,ropik/chromium,adobe/chromium,gavinp/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,gavinp/chromium,yitian134/chromium,gavinp/chromium,yitian134/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,gavinp/chromium,adobe/chromium,gavinp/chromium,ropik/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,adobe/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,ropik/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,Crystalnix/house-of-life-chromium
f4966e249257bb689d40ba9805a6b0cc8d4d7423
src/ApiKey.h
src/ApiKey.h
// Copyright eeGeo Ltd (2012-2015), All Rights Reserved #pragma once #include <string> namespace ExampleApp { //! defines a path to the app config file, which is used to provide the EegeoApiKey and other credentials static const std::string ApplicationConfigurationPath = "ApplicationConfigs/standard_config.json"; //! REQUIRED: You must obtain an API key for the eeGeo SDK from https://www.eegeo.com/developers/ and set is as the value of "EegeoApiKey" in the config file //! Optional: If 'useYelp' is true in AppHost you may wish to obtain a Yelp API key from https://www.yelp.com/developers for POI search provision. //! If so, set credentials using the following keys in the app config file: //! YelpConsumerKey //! YelpConsumerSecret //! YelpOAuthToken //! YelpOAuthTokenSecret //! Optional: You may wish to obtain a geonames account key from http://www.geonames.org/export/web-services.html for address/place search provision. //! Set it as the value of 'GeoNamesUserName' in the app config file: //! Optional: You may wish to obtain an API key for Flurry from https://developer.yahoo.com/analytics/ for metrics. //! Set it as the value of 'FlurryApiKey' in the app config file: }
// Copyright eeGeo Ltd (2012-2015), All Rights Reserved #pragma once #include <string> namespace ExampleApp { //! defines a path to the app config file, which is used to provide the EegeoApiKey and other credentials static const std::string ApplicationConfigurationPath = "ApplicationConfigs/standard_config.json"; //! REQUIRED: You must obtain an API key for the WRLD SDK from https://www.wrld3d.com/developers and set it as the value of "EegeoApiKey" in the config file: "ApplicationConfigs/standard_config.json" //! Optional: If 'useYelp' is true in AppHost you may wish to obtain a Yelp API key from https://www.yelp.com/developers for POI search provision. //! If so, set credentials using the following keys in the app config file: //! YelpConsumerKey //! YelpConsumerSecret //! YelpOAuthToken //! YelpOAuthTokenSecret //! Optional: You may wish to obtain a geonames account key from http://www.geonames.org/export/web-services.html for address/place search provision. //! Set it as the value of 'GeoNamesUserName' in the app config file: //! Optional: You may wish to obtain an API key for Flurry from https://developer.yahoo.com/analytics/ for metrics. //! Set it as the value of 'FlurryApiKey' in the app config file: }
Fix for MPLY-10449 Corrected the message to what the bug report suggests. Buddy: Michael O
Fix for MPLY-10449 Corrected the message to what the bug report suggests. Buddy: Michael O
C
bsd-2-clause
eegeo/eegeo-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,wrld3d/wrld-example-app
21e818f9426d80edb2cb97188ef33047b0f1f5bf
c/boards/arduino_uno/riot_arduino_uno.c
c/boards/arduino_uno/riot_arduino_uno.c
#include "riot_arduino_uno.h" #include "utils.h" riot_arduino_uno_sinks* riot_arduino_uno_sinks_create() { riot_arduino_uno_sinks *sinks = xmalloc(sizeof(riot_arduino_uno_sinks)); return sinks; } riot_arduino_uno_sources* riot_arduino_uno_sources_create() { riot_arduino_uno_sources *sources = xmalloc(sizeof(riot_arduino_uno_sources)); return sources; }; int riot_arduino_uno_run(riot_arduino_uno_main main) { if(main == NULL) { return -1; } riot_arduino_uno_sources *sources = riot_arduino_uno_sources_create(); if(sources == NULL) { return -2; } riot_arduino_uno_sinks *sinks = main(sources); if(sinks == NULL) { return -3; } while(true) { // TODO: Read all inputs and map to sources // TODO: If all sinks/outputs have completed, break } return 0; }
#include "riot_arduino_uno.h" #include "utils.h" #include<stdbool.h> riot_arduino_uno_sinks* riot_arduino_uno_sinks_create() { riot_arduino_uno_sinks *sinks = xmalloc(sizeof(riot_arduino_uno_sinks)); return sinks; } riot_arduino_uno_sources* riot_arduino_uno_sources_create() { riot_arduino_uno_sources *sources = xmalloc(sizeof(riot_arduino_uno_sources)); return sources; }; void riot_arduino_uno_map_sinks_to_write_outputs(riot_arduino_uno_sinks *sinks) { // TODO: Map sinks to write outputs } void riot_arduino_uno_read_inputs(riot_arduino_uno_sources *sources) { // TODO: Read all inputs and map to sources } bool riot_arduino_uno_is_sinks_empty(riot_arduino_uno_sinks *sinks) { // TODO: Return true if no streams are present in sink, ie no output is required. } int riot_arduino_uno_run(riot_arduino_uno_main main) { if(main == NULL) { return -1; } riot_arduino_uno_sources *sources = riot_arduino_uno_sources_create(); if(sources == NULL) { return -2; } riot_arduino_uno_sinks *sinks = main(sources); if(sinks == NULL) { return -3; } riot_arduino_uno_map_sinks_to_write_outputs(sinks); while (true) { riot_arduino_uno_read_inputs(sources); if(riot_arduino_uno_is_sinks_empty(sinks)) break; } return 0; }
Add function declarations, usages and TODOs
Add function declarations, usages and TODOs
C
mit
artfuldev/RIoT
1ce377ab2cf36d8d10b3d0672977dbc63833c745
test/CodeGen/available-externally-suppress.c
test/CodeGen/available-externally-suppress.c
// RUN: %clang_cc1 -emit-llvm -o - -O0 -triple x86_64-apple-darwin10 %s | FileCheck %s // Ensure that we don't emit available_externally functions at -O0. int x; inline void f0(int y) { x = y; } // CHECK: define void @test() // CHECK: declare void @f0(i32) void test() { f0(17); } inline int __attribute__((always_inline)) f1(int x) { int blarg = 0; for (int i = 0; i < x; ++i) blarg = blarg + x * i; return blarg; } int test1(int x) { // CHECK: br i1 // CHECK-NOT: call // CHECK: ret i32 return f1(x); }
// RUN: %clang_cc1 -emit-llvm -o - -O0 -triple x86_64-apple-darwin10 %s | FileCheck %s // Ensure that we don't emit available_externally functions at -O0. int x; inline void f0(int y) { x = y; } // CHECK: define void @test() // CHECK: declare void @f0(i32) void test() { f0(17); } inline int __attribute__((always_inline)) f1(int x) { int blarg = 0; for (int i = 0; i < x; ++i) blarg = blarg + x * i; return blarg; } // CHECK: @test1 int test1(int x) { // CHECK: br i1 // CHECK-NOT: call // CHECK: ret i32 return f1(x); }
Improve test case. Thanks Eli
Improve test case. Thanks Eli git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@108470 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
ec0974bc2f25485f430627e5d170ddf938b1fa56
p_liberrno.h
p_liberrno.h
/* * Copyright 2013 Mo McRoberts. * * 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 P_LIBERRNO_H_ # define P_LIBERRNO_H_ 1 # include <ux/cdefs.h> # include "errno.h" # undef errno int *errno_ux2003(void) UX_SYM03_(errno) UX_WEAK_; int *errno_global_ux2003(void) UX_SYM03_(errno_global_); #endif /*!P_LIBERRNO_H_*/
/* * Copyright 2013 Mo McRoberts. * * 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 P_LIBERRNO_H_ # define P_LIBERRNO_H_ 1 # include <ux/cdefs.h> # include "errno.h" # undef errno int *errno_ux2003(void) UX_SYM03_(errno) UX_WEAK_; int *errno_global_ux2003(void) UX_PRIVATE_(errno_global); #endif /*!P_LIBERRNO_H_*/
Mark errno_global as a private symbol.
Mark errno_global as a private symbol.
C
apache-2.0
coreux/liberrno,coreux/liberrno
054cb770c30818cb8d58846fdf187af00b1e749d
tests/regression/04-mutex/58-strange-spawn.c
tests/regression/04-mutex/58-strange-spawn.c
#include <pthread.h> #include <stdio.h> int myglobal; pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&mutex1); myglobal=myglobal+1; // RACE! pthread_mutex_unlock(&mutex1); return NULL; } int main(void) { pthread_t id; pthread_create(&id, NULL, t_fun, NULL, NULL); // strange pthread_create, should be treated as unknown and spawn (instead of unsoundly bailing) pthread_mutex_lock(&mutex2); myglobal=myglobal+1; // RACE! pthread_mutex_unlock(&mutex2); pthread_join (id, NULL); return 0; }
Add test where bailure is unsound
Add test where bailure is unsound
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
2d6749f8c86b6c0ab9bf64f6666ad167f883226e
src/platform/3ds/3ds-memory.c
src/platform/3ds/3ds-memory.c
/* Copyright (c) 2013-2014 Jeffrey Pfau * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "util/memory.h" void* anonymousMemoryMap(size_t size) { return malloc(size); } void mappedMemoryFree(void* memory, size_t size) { free(memory); }
/* Copyright (c) 2013-2014 Jeffrey Pfau * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "util/memory.h" #include <3ds.h> void* anonymousMemoryMap(size_t size) { return linearAlloc(size); } void mappedMemoryFree(void* memory, size_t size) { UNUSED(size); linearFree(memory); }
Use linearAlloc instead of malloc
3DS: Use linearAlloc instead of malloc
C
mpl-2.0
sergiobenrocha2/mgba,Touched/mgba,AdmiralCurtiss/mgba,Anty-Lemon/mgba,mgba-emu/mgba,iracigt/mgba,jeremyherbert/mgba,cassos/mgba,libretro/mgba,mgba-emu/mgba,libretro/mgba,fr500/mgba,askotx/mgba,Anty-Lemon/mgba,jeremyherbert/mgba,Iniquitatis/mgba,Iniquitatis/mgba,libretro/mgba,mgba-emu/mgba,iracigt/mgba,askotx/mgba,sergiobenrocha2/mgba,fr500/mgba,Anty-Lemon/mgba,askotx/mgba,sergiobenrocha2/mgba,jeremyherbert/mgba,fr500/mgba,cassos/mgba,Iniquitatis/mgba,AdmiralCurtiss/mgba,iracigt/mgba,mgba-emu/mgba,Touched/mgba,MerryMage/mgba,jeremyherbert/mgba,sergiobenrocha2/mgba,libretro/mgba,sergiobenrocha2/mgba,AdmiralCurtiss/mgba,Touched/mgba,MerryMage/mgba,fr500/mgba,cassos/mgba,Anty-Lemon/mgba,iracigt/mgba,askotx/mgba,libretro/mgba,Iniquitatis/mgba,MerryMage/mgba
db44ba375371f40754feca8fa14a009d49333c03
sys/alpha/include/ieeefp.h
sys/alpha/include/ieeefp.h
/* $FreeBSD$ */ /* From: NetBSD: ieeefp.h,v 1.2 1997/04/06 08:47:28 cgd Exp */ /* * Written by J.T. Conklin, Apr 28, 1995 * Public domain. */ #ifndef _ALPHA_IEEEFP_H_ #define _ALPHA_IEEEFP_H_ typedef int fp_except; #define FP_X_INV (1LL << 1) /* invalid operation exception */ #define FP_X_DZ (1LL << 2) /* divide-by-zero exception */ #define FP_X_OFL (1LL << 3) /* overflow exception */ #define FP_X_UFL (1LL << 4) /* underflow exception */ #define FP_X_IMP (1LL << 5) /* imprecise(inexact) exception */ #if 0 #define FP_X_IOV (1LL << 6) /* integer overflow XXX? */ #endif typedef enum { FP_RZ=0, /* round to zero (truncate) */ FP_RM=1, /* round toward negative infinity */ FP_RN=2, /* round to nearest representable number */ FP_RP=3 /* round toward positive infinity */ } fp_rnd; #endif /* _ALPHA_IEEEFP_H_ */
/* $FreeBSD$ */ /* From: NetBSD: ieeefp.h,v 1.2 1997/04/06 08:47:28 cgd Exp */ /* * Written by J.T. Conklin, Apr 28, 1995 * Public domain. */ #ifndef _ALPHA_IEEEFP_H_ #define _ALPHA_IEEEFP_H_ typedef int fp_except_t; #define FP_X_INV (1LL << 1) /* invalid operation exception */ #define FP_X_DZ (1LL << 2) /* divide-by-zero exception */ #define FP_X_OFL (1LL << 3) /* overflow exception */ #define FP_X_UFL (1LL << 4) /* underflow exception */ #define FP_X_IMP (1LL << 5) /* imprecise(inexact) exception */ #if 0 #define FP_X_IOV (1LL << 6) /* integer overflow XXX? */ #endif typedef enum { FP_RZ=0, /* round to zero (truncate) */ FP_RM=1, /* round toward negative infinity */ FP_RN=2, /* round to nearest representable number */ FP_RP=3 /* round toward positive infinity */ } fp_rnd; #endif /* _ALPHA_IEEEFP_H_ */
Change floating point exception type to match the i386 one.
Change floating point exception type to match the i386 one. Submitted by: Mark Abene <[email protected]>
C
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
1f11ee8f51949a764ea6ae871584d2ea5bc738f3
src/shared/timeout-mainloop.c
src/shared/timeout-mainloop.c
/* * * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2014 Intel Corporation. All rights reserved. * * * 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. * */ #include <stdlib.h> #include "timeout.h" #include "monitor/mainloop.h" struct timeout_data { int id; timeout_func_t func; timeout_destroy_func_t destroy; unsigned int timeout; void *user_data; }; static void timeout_callback(int id, void *user_data) { struct timeout_data *data = user_data; if (data->func(data->user_data) && !mainloop_modify_timeout(data->id, data->timeout)) return; mainloop_remove_timeout(data->id); } static void timeout_destroy(void *user_data) { struct timeout_data *data = user_data; if (data->destroy) data->destroy(data->user_data); free(data); } int timeout_add(unsigned int t, timeout_func_t func, void *user_data, timeout_destroy_func_t destroy) { struct timeout_data *data = malloc(sizeof(*data)); data->func = func; data->user_data = user_data; data->timeout = t; data->id = mainloop_add_timeout(t, timeout_callback, data, timeout_destroy); if (!data->id) { free(data); return 0; } return data->id; } void timeout_remove(unsigned int id) { if (id) mainloop_remove_timeout(id); }
Add timeout handling with mainloop support
shared: Add timeout handling with mainloop support
C
lgpl-2.1
ComputeCycles/bluez,ComputeCycles/bluez,pkarasev3/bluez,silent-snowman/bluez,pstglia/external-bluetooth-bluez,pkarasev3/bluez,pstglia/external-bluetooth-bluez,pstglia/external-bluetooth-bluez,silent-snowman/bluez,ComputeCycles/bluez,pstglia/external-bluetooth-bluez,silent-snowman/bluez,mapfau/bluez,ComputeCycles/bluez,pkarasev3/bluez,mapfau/bluez,mapfau/bluez,mapfau/bluez,pkarasev3/bluez,silent-snowman/bluez
903d83a74a10f6839b2a9a53d5912de9b3038902
src/drivers/net/stm32cube/stm32f7cube_eth.h
src/drivers/net/stm32cube/stm32f7cube_eth.h
/** * @file * * @date 17.03.2017 * @author Anton Bondarev */ #ifndef STM32F7CUBE_ETH_H_ #define STM32F7CUBE_ETH_H_ #include <stm32f7xx_hal_conf.h> #include <stm32f7xx.h> #include <stm32f7xx_hal.h> #include <stm32f7xx_hal_eth.h> #define PHY_ADDRESS 0x00 #endif /* STM32F7CUBE_ETH_H_ */
/** * @file * * @date 17.03.2017 * @author Anton Bondarev */ #ifndef STM32F7CUBE_ETH_H_ #define STM32F7CUBE_ETH_H_ #include <stm32f7xx_hal.h> #define PHY_ADDRESS 0x00 #endif /* STM32F7CUBE_ETH_H_ */
Build fix eth for stm32 f7
drivers: Build fix eth for stm32 f7
C
bsd-2-clause
embox/embox,embox/embox,embox/embox,embox/embox,embox/embox,embox/embox
50212adfb401ea0b48a0318675b57c470f1f3de6
src/shared.c
src/shared.c
#include <openssl/conf.h> #include <openssl/bio.h> #include <openssl/evp.h> #include "shared.h" int un_base64 (char *in, char **out, int **len) { BIO *bio, *b64; } bool saltystring_is_salty (
#include <openssl/conf.h> #include <openssl/bio.h> #include <openssl/evp.h> #include "shared.h" int un_base64 (char *in, char **out, int **len) { BIO *bio, *b64; }
Remove forgotten broken line of code lel
Remove forgotten broken line of code lel
C
bsd-3-clause
undesktop/libopkeychain
817c3829c8c666d0438e3aca805ad998377c4730
test/suite/bugs/ifpp.c
test/suite/bugs/ifpp.c
int f(int d) { int i = 0, j, k, l; if (d%2==0) if (d%3==0) i+=2; else i+=3; if (d%2==0) { if (d%3==0) i+=7; } else i+=11; l = d; if (d%2==0) while (l--) if (1) i+=13; else i+=17; l = d; if (d%2==0) { while (l--) if (1) i+=21; } else i+=23; if (d==0) i+=27; else if (d%2==0) if (d%3==0) i+=29; else if (d%5==0) if (d%7==0) i+=31; else i+=33; return i; } int main() { int i,k=0; for(i=0;i<255;i++) { k+=f(i); } printf("Result: %d\n",k); }
Add another test for pretty printing if-then-else
Add another test for pretty printing if-then-else Ignore-this: c0cab673ec9d716deb4154ae5599ed74 darcs-hash:20100720212917-c1f02-512056f55df6186193f854d96821b4a589d19d04
C
bsd-3-clause
llelf/language-c,llelf/language-c,llelf/language-c
75703388d0f8a32c3c7f15d11106d6815cdce33e
AFToolkit/AFToolkit.h
AFToolkit/AFToolkit.h
// // Toolkit header to include the main headers of the 'AFToolkit' library. // #import "AFDefines.h" #import "AFLogHelper.h" #import "AFFileHelper.h" #import "AFPlatformHelper.h" #import "AFReachability.h" #import "AFKVO.h" #import "AFArray.h" #import "AFMutableArray.h" #import "NSBundle+Universal.h" #import "UITableViewCell+Universal.h" #import "AFDBClient.h" #import "AFView.h" #import "AFViewController.h"
// // Toolkit header to include the main headers of the 'AFToolkit' library. // #import "AFDefines.h" #import "AFLogHelper.h" #import "AFFileHelper.h" #import "AFPlatformHelper.h" #import "AFReachability.h" #import "AFKVO.h" #import "AFArray.h" #import "AFMutableArray.h" #import "NSBundle+Universal.h" #import "UITableViewCell+Universal.h" #import "UIView+Render.h" #import "AFDBClient.h" #import "AFView.h" #import "AFViewController.h"
Add UIView+Render header to toolkit include.
Add UIView+Render header to toolkit include.
C
mit
mlatham/AFToolkit
33bbb00cdc583af343bcabc53acb189252d38b6b
caffe2/utils/threadpool/pthreadpool_impl.h
caffe2/utils/threadpool/pthreadpool_impl.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * 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 CAFFE2_UTILS_PTHREADPOOL_IMPL_H_ #define CAFFE2_UTILS_PTHREADPOOL_IMPL_H_ #include "ThreadPoolCommon.h" #ifndef CAFFE2_THREADPOOL_MOBILE #error "mobile build state not defined" #endif #if CAFFE2_THREADPOOL_MOBILE namespace caffe2 { struct ThreadPool; } // namespace caffe2 extern "C" { // Wrapper for the caffe2 threadpool for the usage of NNPACK struct pthreadpool { pthreadpool(caffe2::ThreadPool* pool) : pool_(pool) {} caffe2::ThreadPool* pool_; }; } // extern "C" #endif // CAFFE2_THREADPOOL_MOBILE #endif // CAFFE2_UTILS_PTHREADPOOL_IMPL_H_
/** * Copyright (c) 2016-present, Facebook, Inc. * * 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 CAFFE2_UTILS_PTHREADPOOL_IMPL_H_ #define CAFFE2_UTILS_PTHREADPOOL_IMPL_H_ #include "ThreadPoolCommon.h" #ifndef CAFFE2_THREADPOOL_MOBILE #error "mobile build state not defined" #endif #if CAFFE2_THREADPOOL_MOBILE namespace caffe2 { class ThreadPool; } // namespace caffe2 extern "C" { // Wrapper for the caffe2 threadpool for the usage of NNPACK struct pthreadpool { pthreadpool(caffe2::ThreadPool* pool) : pool_(pool) {} caffe2::ThreadPool* pool_; }; } // extern "C" #endif // CAFFE2_THREADPOOL_MOBILE #endif // CAFFE2_UTILS_PTHREADPOOL_IMPL_H_
Fix ThreadPool class/struct forward declaration mixup
Fix ThreadPool class/struct forward declaration mixup Summary: `ThreadPool` is a class, but it is forward-declared as a struct, which produces an error when compiled with clang 5. Reviewed By: Maratyszcza Differential Revision: D6399594 fbshipit-source-id: e8e81006f484b38e60389c659e9500ec9cfab731
C
apache-2.0
Yangqing/caffe2,caffe2/caffe2,xzturn/caffe2,davinwang/caffe2,davinwang/caffe2,Yangqing/caffe2,Yangqing/caffe2,davinwang/caffe2,xzturn/caffe2,xzturn/caffe2,xzturn/caffe2,Yangqing/caffe2,Yangqing/caffe2,xzturn/caffe2,davinwang/caffe2,davinwang/caffe2
7a6b32904342e3006e6fb1a968068ca9c8e674fb
Programs/GUI/Includes/Manager/SoundManager.h
Programs/GUI/Includes/Manager/SoundManager.h
/************************************************************************* > File Name: SoundManager.h > Project Name: Hearthstone++ > Author: Chan-Ho Chris Ohk > Purpose: Sound manager of Hearthstone++ GUI program. > Created Time: 2018/06/05 > Copyright (c) 2018, Chan-Ho Chris Ohk *************************************************************************/ #ifndef HEARTHSTONEPP_GUI_SOUND_MANAGER_H #define HEARTHSTONEPP_GUI_SOUND_MANAGER_H #include <SFML/Audio/Music.hpp> #include <optional> namespace Hearthstonepp { class SoundManager { public: SoundManager(const SoundManager& other) = delete; ~SoundManager() = delete; static SoundManager* GetInstance(); //! Play Music. void PlayMusic(const char* musicFileName, bool isForceToPlay = false); //! Stop Music. void StopMusic(); //! Returns whether the music is playing. bool IsMusicPlaying() const; //! Returns the name of the currently playing music. std::string GetPlayingMusicName() const; private: SoundManager() = default; static SoundManager* m_instance; sf::Music m_music; std::string m_musicName; }; } #endif
/************************************************************************* > File Name: SoundManager.h > Project Name: Hearthstone++ > Author: Chan-Ho Chris Ohk > Purpose: Sound manager of Hearthstone++ GUI program. > Created Time: 2018/06/05 > Copyright (c) 2018, Chan-Ho Chris Ohk *************************************************************************/ #ifndef HEARTHSTONEPP_GUI_SOUND_MANAGER_H #define HEARTHSTONEPP_GUI_SOUND_MANAGER_H #include <SFML/Audio/Music.hpp> namespace Hearthstonepp { class SoundManager { public: SoundManager(const SoundManager& other) = delete; ~SoundManager() = delete; static SoundManager* GetInstance(); //! Play Music. void PlayMusic(const char* musicFileName, bool isForceToPlay = false); //! Stop Music. void StopMusic(); //! Returns whether the music is playing. bool IsMusicPlaying() const; //! Returns the name of the currently playing music. std::string GetPlayingMusicName() const; private: SoundManager() = default; static SoundManager* m_instance; sf::Music m_music; std::string m_musicName; }; } #endif
Fix compile error on MacOS (unsupported <optional>)
Fix compile error on MacOS (unsupported <optional>)
C
mit
Hearthstonepp/Hearthstonepp,Hearthstonepp/Hearthstonepp
02fa4f4e01ae24ac1507b3c86902a14ee2815319
test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c
test/FrontendC/2008-11-11-AnnotateStructFieldAttribute.c
// RUN: %llvmgcc -c -emit-llvm %s -o - | llvm-dis | grep llvm.ptr.annotation | count 3 #include <stdio.h> /* Struct with element X being annotated */ struct foo { int X __attribute__((annotate("StructAnnotation"))); int Y; int Z; }; void test(struct foo *F) { F->X = 42; F->Z = 1; F->Y = F->X; }
Add test case for ptr annotation.
Add test case for ptr annotation. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@59142 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap
6ebe8168c19687c6227ac41127f1e7c02a46e4d9
tests/regression/27-inv_invariants/09-invariant-worsen.c
tests/regression/27-inv_invariants/09-invariant-worsen.c
// extracted from 01/22 #include <assert.h> int main() { int a = 1; int b = 1; int *x; int rnd; if (rnd) x = &a; else x = &b; assert(*x == 1); b = 2; assert(a == 1); if (*x != 0) { // TODO: invariant makes less precise! assert(a == 1); // TODO } return 0; }
Add test where base invariant worsens precision
Add test where base invariant worsens precision
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
225ed70ce8cda3ba1922063e3bdb95204d30e853
v6502/main.c
v6502/main.c
// // main.c // v6502 // // Created by Daniel Loffgren on H.25/03/28. // Copyright (c) 平成25年 Hello-Channel, LLC. All rights reserved. // #include <stdio.h> #include "cpu.h" #include "mem.h" int main(int argc, const char * argv[]) { printf("Allocating virtual memory of size 2k…\n"); return 0; }
// // main.c // v6502 // // Created by Daniel Loffgren on H.25/03/28. // Copyright (c) 平成25年 Hello-Channel, LLC. All rights reserved. // #include <stdio.h> #include <string.h> #include "cpu.h" #include "mem.h" #include "core.h" int main(int argc, const char * argv[]) { printf("Creating 1 virtual CPU…\n"); v6502_cpu *cpu = v6502_createCPU(); printf("Allocating virtual memory of size 2k…\n"); cpu->memory = v6502_createMemory(2048); char command[10]; for (;;) { printf("] "); scanf("%s", command); if (!strncmp(command, "!", 2)) { v6502_printCpuState(cpu); } } return 0; }
Create a CPU and start REPLing
Create a CPU and start REPLing git-svn-id: dd14d189f2554b0b3f4c2209a95c13d2029e3fe8@6 96dfbd92-d197-e211-9ca9-00110a534b34
C
mit
RyuKojiro/v6502
19ed9ff12a7623717beacf55ad0b7b02a9cecace
src/gop/hp.h
src/gop/hp.h
/* Copyright 2016 Vanderbilt University 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. */ /** \file * Autogenerated public API */ #ifndef ACCRE_GOP_HP_PRIVATE_H_INCLUDED #define ACCRE_GOP_HP_PRIVATE_H_INCLUDED #include <apr_time.h> #include <gop/visibility.h> #include <gop/types.h> #ifdef __cplusplus extern "C" { #endif int gop_op_sync_exec_enabled(gop_op_generic_t *gop); void gop_op_sync_exec(gop_op_generic_t *gop); void gop_op_submit(gop_op_generic_t *gop); #ifdef __cplusplus } #endif #endif /* ^ ACCRE_GOP_HP_PRIVATE_H_INCLUDED ^ */
Add missing internal Hportal header
Add missing internal Hportal header
C
apache-2.0
accre/lstore,tacketar/lstore,accre/lstore,tacketar/lstore,accre/lstore,tacketar/lstore,tacketar/lstore,accre/lstore
4cc2cf0e8fc8584a8bd564c21f5448433a7f6a31
atmel-samd/rgb_led_colors.h
atmel-samd/rgb_led_colors.h
#define BLACK 0x000000 #define GREEN 0x001000 #define BLUE 0x000010 #define CYAN 0x001010 #define RED 0x100000 #define ORANGE 0x100800 #define YELLOW 0x101000 #define PURPLE 0x100010 #define WHITE 0x101010 #define BOOT_RUNNING BLUE #define MAIN_RUNNING GREEN #define SAFE_MODE YELLOW #define ALL_DONE GREEN #define REPL_RUNNING WHITE #define ACTIVE_WRITE 0x200000 #define ALL_GOOD_CYCLE_MS 2000u #define LINE_NUMBER_TOGGLE_LENGTH 300u #define EXCEPTION_TYPE_LENGTH_MS 1000u #define THOUSANDS WHITE #define HUNDREDS BLUE #define TENS YELLOW #define ONES CYAN #define INDENTATION_ERROR GREEN #define SYNTAX_ERROR CYAN #define NAME_ERROR WHITE #define OS_ERROR ORANGE #define VALUE_ERROR PURPLE #define OTHER_ERROR YELLOW
#define BLACK 0x000000 #define GREEN 0x003000 #define BLUE 0x000030 #define CYAN 0x003030 #define RED 0x300000 #define ORANGE 0x302000 #define YELLOW 0x303000 #define PURPLE 0x300030 #define WHITE 0x303030 #define BOOT_RUNNING BLUE #define MAIN_RUNNING GREEN #define SAFE_MODE YELLOW #define ALL_DONE GREEN #define REPL_RUNNING WHITE #define ACTIVE_WRITE 0x200000 #define ALL_GOOD_CYCLE_MS 2000u #define LINE_NUMBER_TOGGLE_LENGTH 300u #define EXCEPTION_TYPE_LENGTH_MS 1000u #define THOUSANDS WHITE #define HUNDREDS BLUE #define TENS YELLOW #define ONES CYAN #define INDENTATION_ERROR GREEN #define SYNTAX_ERROR CYAN #define NAME_ERROR WHITE #define OS_ERROR ORANGE #define VALUE_ERROR PURPLE #define OTHER_ERROR YELLOW
Increase the status LED brightness a bit so that newer DotStars aren't super dim. This will make status NeoPixels a bit bright but one can use samd.set_rgb_status_brightness() to dim them.
Increase the status LED brightness a bit so that newer DotStars aren't super dim. This will make status NeoPixels a bit bright but one can use samd.set_rgb_status_brightness() to dim them.
C
mit
adafruit/circuitpython,adafruit/micropython,adafruit/micropython,adafruit/circuitpython,adafruit/circuitpython,adafruit/micropython,adafruit/circuitpython,adafruit/micropython,adafruit/micropython,adafruit/circuitpython,adafruit/circuitpython
961166443c193be490106684f3c29e894d21dcfd
libevmjit/Common.h
libevmjit/Common.h
#pragma once #include <vector> #include <boost/multiprecision/cpp_int.hpp> namespace dev { namespace eth { namespace jit { using byte = uint8_t; using bytes = std::vector<byte>; using u256 = boost::multiprecision::uint256_t; using bigint = boost::multiprecision::cpp_int; struct NoteChannel {}; // FIXME: Use some log library? enum class ReturnCode { Stop = 0, Return = 1, Suicide = 2, BadJumpDestination = 101, OutOfGas = 102, StackTooSmall = 103, BadInstruction = 104, LLVMConfigError = 201, LLVMCompileError = 202, LLVMLinkError = 203, }; /// Representation of 256-bit value binary compatible with LLVM i256 // TODO: Replace with h256 struct i256 { uint64_t a; uint64_t b; uint64_t c; uint64_t d; }; static_assert(sizeof(i256) == 32, "Wrong i265 size"); #define UNTESTED assert(false) } } }
#pragma once #include <vector> #include <boost/multiprecision/cpp_int.hpp> namespace dev { namespace eth { namespace jit { using byte = uint8_t; using bytes = std::vector<byte>; using u256 = boost::multiprecision::uint256_t; using bigint = boost::multiprecision::cpp_int; struct NoteChannel {}; // FIXME: Use some log library? enum class ReturnCode { Stop = 0, Return = 1, Suicide = 2, BadJumpDestination = 101, OutOfGas = 102, StackTooSmall = 103, BadInstruction = 104, LLVMConfigError = 201, LLVMCompileError = 202, LLVMLinkError = 203, }; /// Representation of 256-bit value binary compatible with LLVM i256 // TODO: Replace with h256 struct i256 { uint64_t a = 0; uint64_t b = 0; uint64_t c = 0; uint64_t d = 0; }; static_assert(sizeof(i256) == 32, "Wrong i265 size"); #define UNTESTED assert(false) } } }
Fix some GCC initialization warnings
Fix some GCC initialization warnings
C
mit
expanse-project/cpp-expanse,vaporry/cpp-ethereum,yann300/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,d-das/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,xeddmc/cpp-ethereum,joeldo/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,vaporry/evmjit,LefterisJP/cpp-ethereum,anthony-cros/cpp-ethereum,subtly/cpp-ethereum-micro,anthony-cros/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,expanse-org/cpp-expanse,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,smartbitcoin/cpp-ethereum,vaporry/webthree-umbrella,karek314/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,xeddmc/cpp-ethereum,karek314/cpp-ethereum,LefterisJP/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,gluk256/cpp-ethereum,eco/cpp-ethereum,eco/cpp-ethereum,expanse-org/cpp-expanse,arkpar/webthree-umbrella,d-das/cpp-ethereum,programonauta/webthree-umbrella,eco/cpp-ethereum,d-das/cpp-ethereum,gluk256/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,anthony-cros/cpp-ethereum,d-das/cpp-ethereum,subtly/cpp-ethereum-micro,expanse-org/cpp-expanse,subtly/cpp-ethereum-micro,johnpeter66/ethminer,d-das/cpp-ethereum,karek314/cpp-ethereum,smartbitcoin/cpp-ethereum,xeddmc/cpp-ethereum,johnpeter66/ethminer,PaulGrey30/go-get--u-github.com-tools-godep,joeldo/cpp-ethereum,xeddmc/cpp-ethereum,joeldo/cpp-ethereum,LefterisJP/cpp-ethereum,expanse-project/cpp-expanse,subtly/cpp-ethereum-micro,expanse-project/cpp-expanse,vaporry/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,anthony-cros/cpp-ethereum,vaporry/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,expanse-project/cpp-expanse,karek314/cpp-ethereum,LefterisJP/cpp-ethereum,xeddmc/cpp-ethereum,expanse-project/cpp-expanse,yann300/cpp-ethereum,eco/cpp-ethereum,smartbitcoin/cpp-ethereum,yann300/cpp-ethereum,yann300/cpp-ethereum,expanse-org/cpp-expanse,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,vaporry/cpp-ethereum,karek314/cpp-ethereum,subtly/cpp-ethereum-micro,smartbitcoin/cpp-ethereum,subtly/cpp-ethereum-micro,d-das/cpp-ethereum,vaporry/cpp-ethereum,smartbitcoin/cpp-ethereum,smartbitcoin/cpp-ethereum,ethers/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,LefterisJP/webthree-umbrella,PaulGrey30/go-get--u-github.com-tools-godep,Sorceror32/go-get--u-github.com-tools-godep,joeldo/cpp-ethereum,LefterisJP/webthree-umbrella,expanse-org/cpp-expanse,gluk256/cpp-ethereum,joeldo/cpp-ethereum,gluk256/cpp-ethereum,eco/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,programonauta/webthree-umbrella,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,ethers/cpp-ethereum,gluk256/cpp-ethereum,xeddmc/cpp-ethereum,expanse-org/cpp-expanse,ethers/cpp-ethereum,karek314/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,ethers/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,joeldo/cpp-ethereum,LefterisJP/cpp-ethereum,LefterisJP/cpp-ethereum,ethers/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,chfast/webthree-umbrella,anthony-cros/cpp-ethereum,vaporry/evmjit,anthony-cros/cpp-ethereum,expanse-project/cpp-expanse,johnpeter66/ethminer,gluk256/cpp-ethereum,yann300/cpp-ethereum,yann300/cpp-ethereum,ethers/cpp-ethereum,eco/cpp-ethereum,vaporry/cpp-ethereum
a59be15fe062229e4a5566d930186bf521c4d8c0
include/tilck/kernel/debug_utils.h
include/tilck/kernel/debug_utils.h
/* SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include <tilck/kernel/paging.h> #include <tilck/kernel/hal.h> size_t stackwalk32(void **frames, size_t count, void *ebp, pdir_t *pdir); void dump_stacktrace(void); void dump_regs(regs *r); void validate_stack_pointer_int(const char *file, int line); #ifdef DEBUG # define DEBUG_VALIDATE_STACK_PTR() validate_stack_pointer_int(__FILE__, \ __LINE__) #else # define DEBUG_VALIDATE_STACK_PTR() #endif void debug_qemu_turn_off_machine(void); void register_debug_kernel_keypress_handler(void); void init_extra_debug_features(); void set_sched_alive_thread_enabled(bool enabled);
/* SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include <tilck/kernel/paging.h> #include <tilck/kernel/hal.h> size_t stackwalk32(void **frames, size_t count, void *ebp, pdir_t *pdir); void dump_stacktrace(void); void dump_regs(regs *r); void validate_stack_pointer_int(const char *file, int line); #if defined(DEBUG) && !defined(UNIT_TEST_ENVIRONMENT) # define DEBUG_VALIDATE_STACK_PTR() validate_stack_pointer_int(__FILE__, \ __LINE__) #else # define DEBUG_VALIDATE_STACK_PTR() #endif void debug_qemu_turn_off_machine(void); void register_debug_kernel_keypress_handler(void); void init_extra_debug_features(); void set_sched_alive_thread_enabled(bool enabled);
Make DEBUG_VALIDATE_STACK_PTR() a no-op in unit tests
[debug] Make DEBUG_VALIDATE_STACK_PTR() a no-op in unit tests
C
bsd-2-clause
vvaltchev/experimentOs,vvaltchev/experimentOs,vvaltchev/experimentOs,vvaltchev/experimentOs
17bd549d6a85a90837f56b0374564d6b1a18259a
list.h
list.h
#include <stdlib.h> #ifndef __LIST_H__ #define __LIST_H__ struct ListNode; struct List; typedef struct ListNode ListNode; typedef struct List List; List* List_Create(void); void List_Destroy(List* l); ListNode* ListNode_Create(void *); void ListNode_Destroy(ListNode* n); ListNode* List_Search(List* l, void* k, int (f)(void*, void*)); void List_Insert(List* l, ListNode* n); void List_Delete(List* l, ListNode* n); #endif
#include <stdlib.h> #ifndef __LIST_H__ #define __LIST_H__ struct ListNode; struct List; typedef struct ListNode ListNode; typedef struct List List; List* List_Create(void); void List_Destroy(List* l); ListNode* ListNode_Create(void * k); void ListNode_Destroy(ListNode* n); ListNode* List_Search(List* l, void* k, int (f)(void*, void*)); void List_Insert(List* l, ListNode* n); void List_Delete(List* l, ListNode* n); #endif
Add missing parameter variable name 'k'
Add missing parameter variable name 'k'
C
mit
MaxLikelihood/CADT
b5cc0902de920ae24f8545549dc6cdf342b36628
test-seccomp-filter.c
test-seccomp-filter.c
#include <sys/prctl.h> #include <linux/seccomp.h> int main(void) { prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, 0); return(EFAULT == errno ? 0 : 1); }
Add thusfar-unused Linux seccomp filter test.
Add thusfar-unused Linux seccomp filter test.
C
isc
kristapsdz/kcgi,kristapsdz/kcgi
7214f0aa8bfbe71e69e3340bda1f2f4411db8ff0
cuser/acpica/acenv_header.h
cuser/acpica/acenv_header.h
#define ACPI_MACHINE_WIDTH 64 #define ACPI_SINGLE_THREADED #define ACPI_USE_LOCAL_CACHE #define ACPI_INLINE inline #define ACPI_USE_NATIVE_DIVIDE #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED #ifdef ACPI_FULL_DEBUG #define ACPI_DEBUG_OUTPUT #define ACPI_DISASSEMBLER // Depends on threading support #define ACPI_DEBUGGER #define ACPI_DBG_TRACK_ALLOCATIONS #define ACPI_GET_FUNCTION_NAME __FUNCTION__ #else #define ACPI_GET_FUNCTION_NAME "" #endif #define ACPI_PHYS_BASE 0x100000000 #include <stdint.h> #include <stdarg.h> #define AcpiOsPrintf printf #define AcpiOsVprintf vprintf struct acpi_table_facs; uint32_t AcpiOsReleaseGlobalLock(struct acpi_table_facs* facs); uint32_t AcpiOsAcquireGlobalLock(struct acpi_table_facs* facs); #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acquired) Acquired = AcpiOsAcquireGlobalLock(GLptr) #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = AcpiOsReleaseGlobalLock(GLptr)
#define ACPI_MACHINE_WIDTH 64 #define ACPI_SINGLE_THREADED #define ACPI_USE_LOCAL_CACHE #define ACPI_INLINE inline #define ACPI_USE_NATIVE_DIVIDE #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED #ifdef ACPI_FULL_DEBUG #define ACPI_DEBUG_OUTPUT #define ACPI_DISASSEMBLER // Depends on threading support #define ACPI_DEBUGGER //#define ACPI_DBG_TRACK_ALLOCATIONS #define ACPI_GET_FUNCTION_NAME __FUNCTION__ #else #define ACPI_GET_FUNCTION_NAME "" #endif #define ACPI_PHYS_BASE 0x100000000 #include <stdint.h> #include <stdarg.h> #define AcpiOsPrintf printf #define AcpiOsVprintf vprintf struct acpi_table_facs; uint32_t AcpiOsReleaseGlobalLock(struct acpi_table_facs* facs); uint32_t AcpiOsAcquireGlobalLock(struct acpi_table_facs* facs); #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acquired) Acquired = AcpiOsAcquireGlobalLock(GLptr) #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = AcpiOsReleaseGlobalLock(GLptr)
Disable allocation tracking (it appears to be broken)
Disable allocation tracking (it appears to be broken)
C
mit
olsner/os,olsner/os,olsner/os,olsner/os
4df3463df9e5e50ecab60d9ed1bd969f16d5417b
tails_files/securedrop_init.c
tails_files/securedrop_init.c
#include <unistd.h> int main(int argc, char* argv) { setuid(0); // Use absolute path to the Python binary and execl to avoid $PATH or symlink trickery execl("/usr/bin/python2.7", "python2.7", "/home/vagrant/tails_files/test.py", (char*)NULL); return 0; }
#include <unistd.h> int main(int argc, char* argv) { setuid(0); // Use absolute path to the Python binary and execl to avoid $PATH or symlink trickery execl("/usr/bin/python2.7", "python2.7", "/home/amnesia/Persistent/.securedrop/securedrop_init.py", (char*)NULL); return 0; }
Fix path in tails_files C wrapper
Fix path in tails_files C wrapper
C
agpl-3.0
mark-in/securedrop-prov-upstream,mark-in/securedrop-prov-upstream,mark-in/securedrop-prov-upstream,mark-in/securedrop-prov-upstream
585cca1d52aa7e082aaa029c585fef8ea6d25d43
modules/example/seed-example.c
modules/example/seed-example.c
/* -*- mode: C; indent-tabs-mode: t; tab-width: 8; c-basic-offset: 2; -*- */ /* * This file is part of Seed, the GObject Introspection<->Javascript bindings. * * Seed 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. * Seed 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 Seed. If not, see <http://www.gnu.org/licenses/>. * * Copyright (C) Robert Carr 2009 <[email protected]> */ #include <glib.h> #include <seed-module.h> SeedObject seed_module_init(SeedEngine * eng) { g_print("Hello Seed Module World \n"); return seed_make_object (eng->context, NULL, NULL); }
/* -*- mode: C; indent-tabs-mode: t; tab-width: 8; c-basic-offset: 2; -*- */ /* * This file is part of Seed, the GObject Introspection<->Javascript bindings. * * Seed 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. * Seed 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 Seed. If not, see <http://www.gnu.org/licenses/>. * * Copyright (C) Robert Carr 2009 <[email protected]> */ #include <glib.h> #include <seed-module.h> SeedObject seed_module_init(SeedEngine * eng) { g_print("Hello Seed Module World\n"); return seed_make_object (eng->context, NULL, NULL); }
Remove extraneous space in output
Remove extraneous space in output
C
lgpl-2.1
danilocesar/seed,danilocesar/seed,danilocesar/seed,danilocesar/seed,danilocesar/seed
ab870ba01a18e2228b6b9827dba7e5d2b9c7a8ab
International/CIAPIRequest.h
International/CIAPIRequest.h
// // CIAPIRequest.h // International // // Created by Dimitry Bentsionov on 7/4/13. // Copyright (c) 2013 Carnegie Museums. All rights reserved. // #import <Foundation/Foundation.h> #import "AFNetworking.h" #define API_BASE_URL @"http://guidecms.carnegiemuseums.org/" #define API_TOKEN @"207b0977eb0be992898c7cf102f1bd8b" #define API_SECRET @"5b2d5ba341d2ded69a4d6cef387951ad" typedef void (^CIAPIHoursRequestSuccessBlock) (NSArray *hours); typedef void (^CIAPIRequestSuccessBlock) (NSURLRequest *request, NSHTTPURLResponse *response, id JSON); typedef void (^CIAPIRequestFailureBlock) (NSURLRequest* request, NSHTTPURLResponse* response, NSError* error, id JSON); @interface CIAPIRequest : NSObject { AFJSONRequestOperation *operation; } @property (nonatomic, retain) AFJSONRequestOperation *operation; #pragma mark - API Methods - (void)syncAll:(BOOL)syncAll success:(CIAPIRequestSuccessBlock)success failure:(CIAPIRequestFailureBlock)failure; - (void)sync; - (void)syncAll; - (void)getWeeksHours:(CIAPIHoursRequestSuccessBlock)success failure:(CIAPIRequestFailureBlock)failure; - (void)subscribeEmail:(NSString*)email success:(CIAPIRequestSuccessBlock)success failure:(CIAPIRequestFailureBlock)failure; @end
// // CIAPIRequest.h // International // // Created by Dimitry Bentsionov on 7/4/13. // Copyright (c) 2013 Carnegie Museums. All rights reserved. // #import <Foundation/Foundation.h> #import "AFNetworking.h" #define API_BASE_URL @"http://guidecms.carnegiemuseums.org" typedef void (^CIAPIHoursRequestSuccessBlock) (NSArray *hours); typedef void (^CIAPIRequestSuccessBlock) (NSURLRequest *request, NSHTTPURLResponse *response, id JSON); typedef void (^CIAPIRequestFailureBlock) (NSURLRequest* request, NSHTTPURLResponse* response, NSError* error, id JSON); @interface CIAPIRequest : NSObject { AFJSONRequestOperation *operation; } @property (nonatomic, retain) AFJSONRequestOperation *operation; #pragma mark - API Methods - (void)syncAll:(BOOL)syncAll success:(CIAPIRequestSuccessBlock)success failure:(CIAPIRequestFailureBlock)failure; - (void)sync; - (void)syncAll; - (void)getWeeksHours:(CIAPIHoursRequestSuccessBlock)success failure:(CIAPIRequestFailureBlock)failure; - (void)subscribeEmail:(NSString*)email success:(CIAPIRequestSuccessBlock)success failure:(CIAPIRequestFailureBlock)failure; @end
Remove unused API_TOKEN and API_SECRET
Remove unused API_TOKEN and API_SECRET
C
mit
CMP-Studio/cmoa-app-ios,CMP-Studio/cmoa-app-ios
e78b06f28070b1361e76c889ebc815973557aa3c
src/exercise210.c
src/exercise210.c
/* * A solution to Exercise 2-3 in The C Programming Language (Second Edition). * * This file was written by Damien Dart, <[email protected]>. This is free * and unencumbered software released into the public domain. For more * information, please refer to the accompanying "UNLICENCE" file. */ #include <stdint.h> #include <stdio.h> #include <stdlib.h> int16_t lower(int16_t); int main(void) { int16_t character; while((character = getchar()) != EOF) { putchar(lower(character)); } return EXIT_SUCCESS; } int16_t lower(int16_t character) { return (character >= 'A' && character <= 'Z') ? character + 'a' - 'A' : character; }
Add solution to Exercise 2-10.
Add solution to Exercise 2-10.
C
unlicense
damiendart/knr-solutions,damiendart/knr-solutions,damiendart/knr-solutions
f93edabc6295b37955e27384c650487c4689324d
src/instruction.h
src/instruction.h
#ifndef _INC_INSTRUCTION_H #define _INC_INSTRUCTION_H #include "basetypes.h" #include <vector> #include <map> typedef std::vector<byte> ByteString; class BaseCPU; class Instruction { public: Instruction(ByteString opcode, SizeType instructionLength); virtual void execute(BaseCPU &cpu, const ByteString &params) const = 0; const ByteString opcode; const SizeType length; }; class InstructionSet { public: class InstructionComparator { public: bool operator()(const Instruction &a, const Instruction &b) const { return a.opcode < b.opcode; } }; int add(const Instruction &instruction); int remove(const ByteString &opcode); MOCKABLE int decode(const ByteString &opcode, const Instruction **out) const; SizeType count() const; private: typedef std::pair<ByteString, const Instruction &> InstructionCode; typedef std::map<ByteString, const Instruction &> Set; typedef Set::iterator Iterator; typedef Set::const_iterator ConstIterator; typedef std::pair<Iterator, bool> Insertion; Set set; }; #endif//_INC_INSTRUCTION_H
#ifndef _INC_INSTRUCTION_H #define _INC_INSTRUCTION_H #include "basetypes.h" #include <vector> #include <map> typedef std::vector<byte> ByteString; class BaseCPU; class Instruction { public: Instruction(ByteString opcode, SizeType instructionLength); virtual void execute(BaseCPU &cpu, const ByteString &params) const = 0; const ByteString opcode; // FIXME: Total length is opcode.size() + length? const SizeType length; }; class InstructionSet { public: class InstructionComparator { public: bool operator()(const Instruction &a, const Instruction &b) const { return a.opcode < b.opcode; } }; int add(const Instruction &instruction); int remove(const ByteString &opcode); MOCKABLE int decode(const ByteString &opcode, const Instruction **out) const; SizeType count() const; private: typedef std::pair<ByteString, const Instruction &> InstructionCode; typedef std::map<ByteString, const Instruction &> Set; typedef Set::iterator Iterator; typedef Set::const_iterator ConstIterator; typedef std::pair<Iterator, bool> Insertion; Set set; }; #endif//_INC_INSTRUCTION_H
Add note to fix confusing Instruction lengths
Add note to fix confusing Instruction lengths
C
mit
aroxby/cpu,aroxby/cpu
39fdbda361ba08ffd09f7632d88d28f6e7e19ba6
include/llvm/Analysis/LiveVar/LiveVarMap.h
include/llvm/Analysis/LiveVar/LiveVarMap.h
/* Title: LiveVarMap.h Author: Ruchira Sasanka Date: Jun 30, 01 Purpose: This file contains the class for a map between the BasicBlock class and the BBLiveVar class, which is a wrapper class of BasicBlock used for the live variable analysis. The reverse mapping can be found in the BBLiveVar class (It has a pointer to the corresponding BasicBlock) */ #ifndef LIVE_VAR_MAP_H #define LIVE_VAR_MAP_H #include <ext/hash_map> class BasicBlock; class BBLiveVar; struct hashFuncMInst { // sturcture containing the hash function for MInst inline size_t operator () (const MachineInstr *val) const { return (size_t) val; } }; struct hashFuncBB { // sturcture containing the hash function for BB inline size_t operator () (const BasicBlock *val) const { return (size_t) val; } }; typedef std::hash_map<const BasicBlock *, BBLiveVar *, hashFuncBB > BBToBBLiveVarMapType; typedef std::hash_map<const MachineInstr *, const LiveVarSet *, hashFuncMInst> MInstToLiveVarSetMapType; #endif
/* Title: LiveVarMap.h -*- C++ -*- Author: Ruchira Sasanka Date: Jun 30, 01 Purpose: This file contains the class for a map between the BasicBlock class and the BBLiveVar class, which is a wrapper class of BasicBlock used for the live variable analysis. The reverse mapping can be found in the BBLiveVar class (It has a pointer to the corresponding BasicBlock) */ #ifndef LIVE_VAR_MAP_H #define LIVE_VAR_MAP_H #include "Support/HashExtras.h" class MachineInstr; class BasicBlock; class BBLiveVar; class LiveVarSet; typedef std::hash_map<const BasicBlock *, BBLiveVar *> BBToBBLiveVarMapType; typedef std::hash_map<const MachineInstr *, const LiveVarSet *> MInstToLiveVarSetMapType; #endif
Use generic pointer hashes instead of custom ones.
Use generic pointer hashes instead of custom ones. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@1684 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap
49237f04a8982e919bce667a47e0024cd0705d60
test/FrontendC/x86-64-red-zone.c
test/FrontendC/x86-64-red-zone.c
// RUN: $llvmgcc -m64 -fomit-frame-pointer -O2 %s -S -o - > %t // RUN: not grep subq %t // RUN: not grep addq %t // RUN: grep {\\-4(%%rsp)} %t | count 2 // RUN: $llvmgcc -m64 -fomit-frame-pointer -O2 %s -S -o - -mno-red-zone > %t // RUN: grep subq %t | count 1 // RUN: grep addq %t | count 1 // This is a test for x86-64, add your target below if it FAILs. // XFAIL: alpha|ia64|arm|powerpc|sparc|x86 long double f0(float f) { return f; }
Add a FrontendC testcase for the x86-64 Red Zone feature, to help verify that the feature may be disabled through the -mno-red-zone option.
Add a FrontendC testcase for the x86-64 Red Zone feature, to help verify that the feature may be disabled through the -mno-red-zone option. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@63079 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,dslab-epfl/asap,dslab-epfl/asap,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm
8948e345f5b99784538cac6b305dd78c43e80eb2
test/PCH/modified-header-error.c
test/PCH/modified-header-error.c
// XFAIL: win32 // RUN: mkdir -p %t.dir // RUN: echo '#include "header2.h"' > %t.dir/header1.h // RUN: echo > %t.dir/header2.h // RUN: cp %s %t.dir/t.c // RUN: %clang_cc1 -x c-header %t.dir/header1.h -emit-pch -o %t.pch // RUN: echo >> %t.dir/header2.h // RUN: %clang_cc1 %t.dir/t.c -include-pch %t.pch -fsyntax-only 2>&1 | FileCheck %s #include "header2.h" // CHECK: fatal error: file {{.*}} has been modified since the precompiled header was built
// RUN: mkdir -p %t.dir // RUN: echo '#include "header2.h"' > %t.dir/header1.h // RUN: echo > %t.dir/header2.h // RUN: cp %s %t.dir/t.c // RUN: %clang_cc1 -x c-header %t.dir/header1.h -emit-pch -o %t.pch // RUN: echo >> %t.dir/header2.h // RUN: %clang_cc1 %t.dir/t.c -include-pch %t.pch -fsyntax-only 2>&1 | FileCheck %s #include "header2.h" // CHECK: fatal error: file {{.*}} has been modified since the precompiled header was built
Revert r132426; this test passes more often than not, and we don't have a way to mark tests as intermittently failing at the moment.
Revert r132426; this test passes more often than not, and we don't have a way to mark tests as intermittently failing at the moment. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@132446 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
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,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
cec1a48a4138035c6c8462c8baaee699addf0ede
AVOS/AVOSCloudLiveQuery/AVSubscription.h
AVOS/AVOSCloudLiveQuery/AVSubscription.h
// // AVSubscription.h // AVOS // // Created by Tang Tianyong on 15/05/2017. // Copyright © 2017 LeanCloud Inc. All rights reserved. // #import <Foundation/Foundation.h> #import "AVQuery.h" #import "AVDynamicObject.h" NS_ASSUME_NONNULL_BEGIN @interface AVSubscriptionOptions : AVDynamicObject @end @interface AVSubscription : NSObject @property (nonatomic, strong, readonly) AVQuery *query; @property (nonatomic, strong, readonly, nullable) AVSubscriptionOptions *options; - (instancetype)initWithQuery:(AVQuery *)query options:(nullable AVSubscriptionOptions *)options; @end NS_ASSUME_NONNULL_END
// // AVSubscription.h // AVOS // // Created by Tang Tianyong on 15/05/2017. // Copyright © 2017 LeanCloud Inc. All rights reserved. // #import <Foundation/Foundation.h> #import "AVQuery.h" #import "AVDynamicObject.h" NS_ASSUME_NONNULL_BEGIN @protocol AVSubscriptionDelegate <NSObject> @end @interface AVSubscriptionOptions : AVDynamicObject @end @interface AVSubscription : NSObject @property (nonatomic, weak, nullable) id<AVSubscriptionDelegate> delegate; @property (nonatomic, strong, readonly) AVQuery *query; @property (nonatomic, strong, readonly, nullable) AVSubscriptionOptions *options; - (instancetype)initWithQuery:(AVQuery *)query options:(nullable AVSubscriptionOptions *)options; @end NS_ASSUME_NONNULL_END
Add delegate property for subscription
Add delegate property for subscription
C
apache-2.0
leancloud/objc-sdk,leancloud/objc-sdk,leancloud/objc-sdk,leancloud/objc-sdk
339d11539a67d2e3c4dce940e364ed7002961377
Mac/Compat/sync.c
Mac/Compat/sync.c
/* The equivalent of the Unix 'sync' system call: FlushVol. Public domain by Guido van Rossum, CWI, Amsterdam (July 1987). For now, we only flush the default volume (since that's the only volume written to by MacB). */ #include "macdefs.h" int sync(void) { if (FlushVol((StringPtr)0, 0) == noErr) return 0; else { errno= ENODEV; return -1; } }
/* The equivalent of the Unix 'sync' system call: FlushVol. Public domain by Guido van Rossum, CWI, Amsterdam (July 1987). For now, we only flush the default volume (since that's the only volume written to by MacB). */ #include "macdefs.h" void sync(void) { if (FlushVol((StringPtr)0, 0) == noErr) return; else { errno= ENODEV; return; } }
Make the prototype match the declaration in the GUSI header files.
Make the prototype match the declaration in the GUSI header files.
C
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
39cbe6995ca13a4e24850528c16c33a1bd8f39d5
vtStor/CommandHandlerInterface.h
vtStor/CommandHandlerInterface.h
/* <License> Copyright 2015 Virtium Technology 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. </License> */ #ifndef __vtStorCommandHandlerInterface_h__ #define __vtStorCommandHandlerInterface_h__ #pragma once #include <memory> #include "ErrorCodes.h" #include "BufferInterface.h" #include "ProtocolInterface.h" #include "vtStorPlatformDefines.h" namespace vtStor { class VTSTOR_API cDriveInterface; class VTSTOR_API cCommandHandlerInterface { public: cCommandHandlerInterface( std::shared_ptr<Protocol::cProtocolInterface> Protocol ); virtual ~cCommandHandlerInterface(); public: virtual eErrorCode IssueCommand( std::shared_ptr<const cBufferInterface> CommandDescriptor, std::shared_ptr<cBufferInterface> Data ) = 0; protected: std::shared_ptr<Protocol::cProtocolInterface> m_Protocol; }; } #endif
/* <License> Copyright 2015 Virtium Technology 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. </License> */ #ifndef __vtStorCommandHandlerInterface_h__ #define __vtStorCommandHandlerInterface_h__ #pragma once #include <memory> #include "ErrorCodes.h" #include "BufferInterface.h" #include "ProtocolInterface.h" #include "vtStorPlatformDefines.h" namespace vtStor { class VTSTOR_API cCommandHandlerInterface { public: cCommandHandlerInterface( std::shared_ptr<Protocol::cProtocolInterface> Protocol ); virtual ~cCommandHandlerInterface(); public: virtual eErrorCode IssueCommand( std::shared_ptr<const cBufferInterface> CommandDescriptor, std::shared_ptr<cBufferInterface> Data ) = 0; protected: std::shared_ptr<Protocol::cProtocolInterface> m_Protocol; }; } #endif
Remove declare: class VTSTOR_API cDriveInterface
Remove declare: class VTSTOR_API cDriveInterface
C
apache-2.0
tranminhtam/vtStor,tranminhtam/vtStor,tranminhtam/vtStor,tranminhtam/vtStor
a981815c88aca37a8dcb42f1ce673ed838114251
webkit/fileapi/quota_file_util.h
webkit/fileapi/quota_file_util.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 WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_ #define WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_ #include "webkit/fileapi/file_system_file_util.h" #include "webkit/fileapi/file_system_operation_context.h" #pragma once namespace fileapi { class QuotaFileUtil : public FileSystemFileUtil { public: static QuotaFileUtil* GetInstance(); ~QuotaFileUtil() {} static const int64 kNoLimit; base::PlatformFileError CopyOrMoveFile( FileSystemOperationContext* fs_context, const FilePath& src_file_path, const FilePath& dest_file_path, bool copy); // TODO(dmikurube): Charge some amount of quota for directories. base::PlatformFileError Truncate( FileSystemOperationContext* fs_context, const FilePath& path, int64 length); friend struct DefaultSingletonTraits<QuotaFileUtil>; DISALLOW_COPY_AND_ASSIGN(QuotaFileUtil); protected: QuotaFileUtil() {} }; } // namespace fileapi #endif // WEBKIT_FILEAPI_QUOTA_FILE_UTIL_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 WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_ #define WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_ #include "webkit/fileapi/file_system_file_util.h" #include "webkit/fileapi/file_system_operation_context.h" #pragma once namespace fileapi { class QuotaFileUtil : public FileSystemFileUtil { public: static QuotaFileUtil* GetInstance(); ~QuotaFileUtil() {} static const int64 kNoLimit; virtual base::PlatformFileError CopyOrMoveFile( FileSystemOperationContext* fs_context, const FilePath& src_file_path, const FilePath& dest_file_path, bool copy); // TODO(dmikurube): Charge some amount of quota for directories. virtual base::PlatformFileError Truncate( FileSystemOperationContext* fs_context, const FilePath& path, int64 length); friend struct DefaultSingletonTraits<QuotaFileUtil>; DISALLOW_COPY_AND_ASSIGN(QuotaFileUtil); protected: QuotaFileUtil() {} }; } // namespace fileapi #endif // WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_
Add virtual in QuitaFileUtil to fix the compilation error in r82441.
Add virtual in QuitaFileUtil to fix the compilation error in r82441. TBR=dmikurube,kinuko BUG=none TEST=none Review URL: http://codereview.chromium.org/6882112 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@82445 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
gavinp/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,ropik/chromium,gavinp/chromium,ropik/chromium,yitian134/chromium,ropik/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,ropik/chromium,gavinp/chromium,adobe/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,ropik/chromium,ropik/chromium,gavinp/chromium
837dabff5245b55bfde5b7c84425416831c039df
licharger.c
licharger.c
#include <avr/io.h> #include <avr/delay.h>
#include <avr/io.h> int main (void) { //Set pin 3 as output to source current? PORTB = 1<<PORTB3; DDRB = 1<<DDB3; }
Add basic program to turn an LED on
Add basic program to turn an LED on
C
mit
Atom058/ArduinoLithiumCharger,Atom058/ArduinoLithiumCharger
a318a6ee85491e867edadd155dfa29d793b2ad1f
ext/xorcist/xorcist.c
ext/xorcist/xorcist.c
#include "ruby.h" VALUE Xorcist = Qnil; void Init_xorcist(); VALUE xor_in_place(VALUE x, VALUE y, VALUE self); VALUE xor_in_place(VALUE self, VALUE x, VALUE y) { const char *src = 0; char *dest = 0; size_t len; size_t y_len; rb_str_modify(x); dest = RSTRING_PTR(x); len = RSTRING_LEN(x); src = RSTRING_PTR(y); y_len = RSTRING_LEN(y); if (y_len < len) { len = y_len; } for (; len--; ++dest, ++src) { *dest ^= *src; } return x; } void Init_xorcist() { Xorcist = rb_define_module("Xorcist"); rb_define_module_function(Xorcist, "xor!", xor_in_place, 2); }
#include <ruby.h> VALUE Xorcist = Qnil; void Init_xorcist(); VALUE xor_in_place(VALUE x, VALUE y, VALUE self); VALUE xor_in_place(VALUE self, VALUE x, VALUE y) { const char *src = 0; char *dest = 0; size_t len; size_t y_len; rb_str_modify(x); dest = RSTRING_PTR(x); len = RSTRING_LEN(x); src = RSTRING_PTR(y); y_len = RSTRING_LEN(y); if (y_len < len) { len = y_len; } for (; len--; ++dest, ++src) { *dest ^= *src; } return x; } void Init_xorcist() { Xorcist = rb_define_module("Xorcist"); rb_define_module_function(Xorcist, "xor!", xor_in_place, 2); }
Use angle brackets for Ruby include
Use angle brackets for Ruby include
C
mit
Teino1978-Corp/Teino1978-Corp-xorcist,fny/xorcist,fny/xorcist,Teino1978-Corp/Teino1978-Corp-xorcist,fny/xorcist,fny/xorcist,Teino1978-Corp/Teino1978-Corp-xorcist,Teino1978-Corp/Teino1978-Corp-xorcist
7847a35e376e39ba86bb75721f1c2e5bf79fb9ab
test2/structs/lvalue/cant.c
test2/structs/lvalue/cant.c
// RUN: %check -e %s main() { struct A { int i; } a, b, c; a = b ? : c; // CHECK: error: struct involved in if-expr }
Test for struct in GNU ?: expressions
Test for struct in GNU ?: expressions
C
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
ae5143868081c97304191a55a4ecc3a390fc77e5
src/MarbleTest.h
src/MarbleTest.h
// // This file is part of the Marble Desktop Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2004-2007 Torsten Rahn <[email protected]>" // Copyright 2007 Inge Wallin <[email protected]>" // // // Description: Some Tests for Marble // #ifndef MARBLETEST_H #define MARBLETEST_H namespace Marble { class MarbleWidget; class MarbleTest { public: explicit MarbleTest( MarbleWidget* marbleWidget ); virtual ~MarbleTest(){ } void timeDemo(); /** * @brief load a gpx file and test the for average time, max time, * min time and total time */ void gpsDemo(); private: MarbleWidget *m_marbleWidget; }; } #endif // MARBLETEST_H
// // This file is part of the Marble Desktop Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2004-2007 Torsten Rahn <[email protected]>" // Copyright 2007 Inge Wallin <[email protected]>" // // // Description: Some Tests for Marble // #ifndef MARBLETEST_H #define MARBLETEST_H namespace Marble { class MarbleWidget; class MarbleTest { public: explicit MarbleTest( MarbleWidget* marbleWidget ); virtual ~MarbleTest(){ } void timeDemo(); /** * @brief load a gpx file and test average, max, min, and total time */ void gpsDemo(); private: MarbleWidget *m_marbleWidget; }; } #endif // MARBLETEST_H
Fix @brief description by making it on one line instead of two
Fix @brief description by making it on one line instead of two svn path=/trunk/KDE/kdeedu/marble/; revision=879319
C
lgpl-2.1
tucnak/marble,David-Gil/marble-dev,utkuaydin/marble,tzapzoor/marble,tucnak/marble,Earthwings/marble,David-Gil/marble-dev,probonopd/marble,quannt24/marble,AndreiDuma/marble,oberluz/marble,oberluz/marble,oberluz/marble,quannt24/marble,tzapzoor/marble,Earthwings/marble,tzapzoor/marble,AndreiDuma/marble,Earthwings/marble,oberluz/marble,David-Gil/marble-dev,tucnak/marble,rku/marble,adraghici/marble,adraghici/marble,probonopd/marble,probonopd/marble,David-Gil/marble-dev,rku/marble,rku/marble,utkuaydin/marble,rku/marble,utkuaydin/marble,quannt24/marble,adraghici/marble,rku/marble,AndreiDuma/marble,quannt24/marble,tucnak/marble,quannt24/marble,tzapzoor/marble,adraghici/marble,tucnak/marble,utkuaydin/marble,tzapzoor/marble,Earthwings/marble,Earthwings/marble,quannt24/marble,utkuaydin/marble,tzapzoor/marble,Earthwings/marble,AndreiDuma/marble,tucnak/marble,David-Gil/marble-dev,AndreiDuma/marble,oberluz/marble,adraghici/marble,utkuaydin/marble,tzapzoor/marble,David-Gil/marble-dev,rku/marble,probonopd/marble,adraghici/marble,oberluz/marble,probonopd/marble,probonopd/marble,tzapzoor/marble,AndreiDuma/marble,tucnak/marble,quannt24/marble,probonopd/marble
84562bd91c74c00ad7df15ddb0e2ee8e7d8f49ab
src/debugger_global.h
src/debugger_global.h
#ifndef DEBUGGER_PARSER_GLOBAL_H_ #define DEBUGGER_PARSER_GLOBAL_H_ #include "common.h" #include <stdio.h> struct debug_expr { enum expr_type { EXPR_NULL, EXPR_MEM, EXPR_REG } type; int32_t val; }; enum display_type { DISP_NULL, DISP_DEC, DISP_HEX, DISP_INST, DISP_max }; struct debugger_data { struct sim_state *s; ///< simulator state to which we belong void *scanner; void *breakpoints; struct { unsigned savecol; char saveline[LINE_LEN]; } lexstate; struct debug_display { struct debug_display *next; struct debug_expr expr; int fmt; } *displays; int displays_count; struct debug_cmd { enum { CMD_NULL, CMD_CONTINUE, CMD_DELETE_BREAKPOINT, CMD_DISPLAY, CMD_GET_INFO, CMD_PRINT, CMD_SET_BREAKPOINT, CMD_STEP_INSTRUCTION, CMD_QUIT, CMD_max } code; struct { struct debug_expr expr; int fmt; ///< print / display format character char str[LINE_LEN]; } arg; } cmd; }; int tdbg_parse(struct debugger_data *); int tdbg_prompt(struct debugger_data *dd, FILE *where); #endif
#ifndef DEBUGGER_PARSER_GLOBAL_H_ #define DEBUGGER_PARSER_GLOBAL_H_ #include "common.h" #include <stdint.h> #include <stdio.h> struct debug_expr { enum expr_type { EXPR_NULL, EXPR_MEM, EXPR_REG } type; int32_t val; }; enum display_type { DISP_NULL, DISP_DEC, DISP_HEX, DISP_INST, DISP_max }; struct debugger_data { struct sim_state *s; ///< simulator state to which we belong void *scanner; void *breakpoints; struct { unsigned savecol; char saveline[LINE_LEN]; } lexstate; struct debug_display { struct debug_display *next; struct debug_expr expr; int fmt; } *displays; int displays_count; struct debug_cmd { enum { CMD_NULL, CMD_CONTINUE, CMD_DELETE_BREAKPOINT, CMD_DISPLAY, CMD_GET_INFO, CMD_PRINT, CMD_SET_BREAKPOINT, CMD_STEP_INSTRUCTION, CMD_QUIT, CMD_max } code; struct { struct debug_expr expr; int fmt; ///< print / display format character char str[LINE_LEN]; } arg; } cmd; }; int tdbg_parse(struct debugger_data *); int tdbg_prompt(struct debugger_data *dd, FILE *where); #endif
Mend missing reference to stdint
Mend missing reference to stdint
C
mit
kulp/tenyr,kulp/tenyr,kulp/tenyr
970d2e0a24d25f61ba31eee9575f73f48dd1102d
src/debugger/utils.h
src/debugger/utils.h
/* * Copyright 2006-2008 The FLWOR Foundation. * * 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 ZORBA_DEBUGGER_UTILS #define ZORBA_DEBUGGER_UTILS namespace zorba { template<class T> class ZorbaArrayAutoPointer { private: T* thePtr; public: ZorbaArrayAutoPointer(): thePtr(0){} ZorbaArrayAutoPointer(T *aPtr): thePtr(aPtr){} ~ZorbaArrayAutoPointer() { delete[] thePtr; } void reset(T *aPtr) { T* lPtr = thePtr; thePtr = aPtr; delete[] lPtr; } T* get() { return thePtr; } T* release() { T* lPtr = thePtr; thePtr = 0; return lPtr; } }; }//end of namespace #endif
/* * Copyright 2006-2008 The FLWOR Foundation. * * 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 ZORBA_DEBUGGER_UTILS_H #define ZORBA_DEBUGGER_UTILS_H namespace zorba { template<class T> class ZorbaArrayAutoPointer { private: T* thePtr; public: ZorbaArrayAutoPointer(): thePtr(0){} explicit ZorbaArrayAutoPointer(T *aPtr): thePtr(aPtr){} ~ZorbaArrayAutoPointer() { if(thePtr != 0) { delete[] thePtr; } } void reset(T *aPtr) { T* lPtr = thePtr; thePtr = aPtr; if(thePtr != 0) { delete[] lPtr; } } T* get() const { return thePtr; } T* release() { T* lPtr = thePtr; thePtr = 0; return lPtr; } T operator[](unsigned int anIndex) const { return thePtr[anIndex]; } }; }//end of namespace #endif
Add [] operator. Fix potential memory errors.
Add [] operator. Fix potential memory errors.
C
apache-2.0
bgarrels/zorba,bgarrels/zorba,bgarrels/zorba,28msec/zorba,bgarrels/zorba,cezarfx/zorba,cezarfx/zorba,28msec/zorba,cezarfx/zorba,cezarfx/zorba,28msec/zorba,bgarrels/zorba,bgarrels/zorba,28msec/zorba,cezarfx/zorba,cezarfx/zorba,cezarfx/zorba,28msec/zorba,bgarrels/zorba,28msec/zorba,28msec/zorba,cezarfx/zorba,bgarrels/zorba,cezarfx/zorba,cezarfx/zorba,28msec/zorba,28msec/zorba
951007303bdf13ef0f50de7e1b84b766c682e5d3
alura/c/adivinhacao.c
alura/c/adivinhacao.c
#include <stdio.h> int main() { // imprime o cabecalho do nosso jogo printf("******************************************\n"); printf("* Bem vindo ao nosso jogo de adivinhação *\n"); printf("******************************************\n"); int numerosecreto = 42; printf("O número %d é o secreto. Não conta pra ninguém!\n", numerosecreto); }
#include <stdio.h> int main() { // imprime o cabecalho do nosso jogo printf("******************************************\n"); printf("* Bem vindo ao nosso jogo de adivinhação *\n"); printf("******************************************\n"); int numerosecreto = 42; int chute; printf("Qual é o seu chute? "); scanf("%d", &chute); printf("Seu chute foi %d", chute); }
Update file, Alura, Introdução a C, Aula 1.5
Update file, Alura, Introdução a C, Aula 1.5
C
mit
fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs
5ac661e80c92e90ae0ed8ba658570db8f76e8490
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", .capt_id = 101, .hep_version = 3, .usessl = 0, .pl_compress = 0, .sendPacketsCount = 0 };
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 };
Add .hints initializer for clarity.
Add .hints initializer for clarity.
C
bsd-2-clause
dsanders11/rtpproxy,sippy/rtpproxy,sippy/rtpproxy,dsanders11/rtpproxy,dsanders11/rtpproxy,sippy/rtpproxy
a8e112272be9d82ba964e4b1694539b4606b2436
test/CodeGen/pointer-signext.c
test/CodeGen/pointer-signext.c
// RUN: %clang_cc1 -triple x86_64-pc-win32 -emit-llvm -O2 -o - %s | FileCheck %s // Under Windows 64, int and long are 32-bits. Make sure pointer math doesn't // cause any sign extensions. // CHECK: [[P:%.*]] = add i64 %param, -8 // CHECK-NEXT: [[Q:%.*]] = inttoptr i64 [[P]] to [[R:%.*\*]] // CHECK-NEXT: {{%.*}} = getelementptr inbounds [[R]] [[Q]], i64 0, i32 0 #define CR(Record, TYPE, Field) \ ((TYPE *) ((unsigned char *) (Record) - (unsigned char *) &(((TYPE *) 0)->Field))) typedef struct _LIST_ENTRY { struct _LIST_ENTRY *ForwardLink; struct _LIST_ENTRY *BackLink; } LIST_ENTRY; typedef struct { unsigned long long Signature; LIST_ENTRY Link; } MEMORY_MAP; int test(unsigned long long param) { LIST_ENTRY *Link; MEMORY_MAP *Entry; Link = (LIST_ENTRY *) param; Entry = CR (Link, MEMORY_MAP, Link); return (int) Entry->Signature; }
// RUN: %clang_cc1 -triple x86_64-pc-win32 -emit-llvm -O2 -o - %s | FileCheck %s // Under Windows 64, int and long are 32-bits. Make sure pointer math doesn't // cause any sign extensions. // CHECK: [[P:%.*]] = add i64 %param, -8 // CHECK-NEXT: [[Q:%.*]] = inttoptr i64 [[P]] to [[R:%.*]]* // CHECK-NEXT: {{%.*}} = getelementptr inbounds [[R]]* [[Q]], i64 0, i32 0 #define CR(Record, TYPE, Field) \ ((TYPE *) ((unsigned char *) (Record) - (unsigned char *) &(((TYPE *) 0)->Field))) typedef struct _LIST_ENTRY { struct _LIST_ENTRY *ForwardLink; struct _LIST_ENTRY *BackLink; } LIST_ENTRY; typedef struct { unsigned long long Signature; LIST_ENTRY Link; } MEMORY_MAP; int test(unsigned long long param) { LIST_ENTRY *Link; MEMORY_MAP *Entry; Link = (LIST_ENTRY *) param; Entry = CR (Link, MEMORY_MAP, Link); return (int) Entry->Signature; }
Adjust test case to be compatible with future changes to explicitly pass the type to getelementptr
Adjust test case to be compatible with future changes to explicitly pass the type to getelementptr git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@229196 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-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,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
181f9eba6f31b27bd669e6b70a48488fab25389a
src/nrf24.c
src/nrf24.c
/* * This file is part of the KNOT Project * * Copyright (c) 2015, CESAR. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the CESAR 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 CESAR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <errno.h> #include <unistd.h> #include <string.h> #include <sys/socket.h> #include <sys/un.h> #include "node.h" static int nrf24_probe(void) { return -ENOSYS; } static void nrf24_remove(void) { } static int nrf24_listen(void) { return -ENOSYS; } static int nrf24_accept(int srv_sockfd) { return -ENOSYS; } static ssize_t nrf24_recv(int sockfd, void *buffer, size_t len) { return -ENOSYS; } static ssize_t nrf24_send(int sockfd, const void *buffer, size_t len) { return -ENOSYS; } static struct node_ops nrf24_ops = { .name = "NRF24L01", .probe = nrf24_probe, .remove = nrf24_remove, .listen = nrf24_listen, .accept = nrf24_accept, .recv = nrf24_recv, .send = nrf24_send }; /* * The following functions MAY be implemented as plugins * initialization functions, avoiding function calls such * as manager@manager_start()->node@node_init()-> * manager@node_ops_register()->node@node_probe() */ int node_init(void) { return node_ops_register(&nrf24_ops); } void node_exit(void) { }
Add NRF24L01 node_ops 'driver' skeleton
gw: Add NRF24L01 node_ops 'driver' skeleton This patch adds the initial code to implement node_ops 'driver' abstraction for NRF24L01. NRF24L01 is connected to the host through SPI connection, and multiple users must be managed using 'pipes' which are analogous to radio access code for a logical channel.
C
lgpl-2.1
CESARBR/knot-service-source,CESARBR/knot-service-source,CESARBR/knot-service-source,CESARBR/knot-service-source,CESARBR/knot-service-source
8035340f994f48b8b5f7c0d382517c3243b58ac3
libpqxx/include/pqxx/util.h
libpqxx/include/pqxx/util.h
/*------------------------------------------------------------------------- * * FILE * pqxx/util.h * * DESCRIPTION * Various utility definitions for libpqxx * * Copyright (c) 2001-2004, Jeroen T. Vermeulen <[email protected]> * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. * *------------------------------------------------------------------------- */ #ifndef PQXX_UTIL_H #define PQXX_UTIL_H #if defined(PQXX_HAVE_CPP_WARNING) #warning "Deprecated libpqxx header included. Use headers without '.h'" #elif defined(PQXX_HAVE_CPP_PRAGMA_MESSAGE) #pragma message("Deprecated libpqxx header included. Use headers without '.h'") #endif #define PQXX_DEPRECATED_HEADERS #include "pqxx/util" #endif
/*------------------------------------------------------------------------- * * FILE * pqxx/util.h * * DESCRIPTION * Various utility definitions for libpqxx * * Copyright (c) 2001-2004, Jeroen T. Vermeulen <[email protected]> * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. * *------------------------------------------------------------------------- */ #ifndef PQXX_UTIL_H #define PQXX_UTIL_H #if !defined(PQXXYES_I_KNOW_DEPRECATED_HEADER) #define PQXXYES_I_KNOW_DEPRECATED_HEADER #if defined(PQXX_HAVE_CPP_WARNING) #warning "Deprecated libpqxx header included. Use headers without '.h'" #elif defined(PQXX_HAVE_CPP_PRAGMA_MESSAGE) #pragma message("Deprecated libpqxx header included. Use headers without '.h'") #endif #endif #define PQXX_DEPRECATED_HEADERS #include "pqxx/util" #endif
Allow suppression of "deprecated header" warning
Allow suppression of "deprecated header" warning
C
bsd-3-clause
jtv/libpqxx,jtv/libpqxx,jtv/libpqxx,jtv/libpqxx
f16b686efbe6bfe50c1fbb3c5b318c279fc16ec0
include/rime/common.h
include/rime/common.h
// // Copyleft RIME Developers // License: GPLv3 // // 2011-03-14 GONG Chen <[email protected]> // #ifndef RIME_COMMON_H_ #define RIME_COMMON_H_ #include <memory> #include <utility> #define BOOST_BIND_NO_PLACEHOLDERS #include <boost/signals2/connection.hpp> #include <boost/signals2/signal.hpp> #ifdef RIME_ENABLE_LOGGING #include <glog/logging.h> #else #include "no_logging.h" #endif // RIME_ENABLE_LOGGGING namespace rime { using boost::signals2::connection; using boost::signals2::signal; using std::unique_ptr; using std::shared_ptr; using std::weak_ptr; template <class A, class B> shared_ptr<A> As(const B& ptr) { return std::dynamic_pointer_cast<A>(ptr); } template <class A, class B> bool Is(const B& ptr) { return bool(As<A, B>(ptr)); } template <class T, class... Args> inline shared_ptr<T> New(Args&&... args) { return std::make_shared<T>(std::forward<Args>(args)...); } } // namespace rime #endif // RIME_COMMON_H_
// // Copyleft RIME Developers // License: GPLv3 // // 2011-03-14 GONG Chen <[email protected]> // #ifndef RIME_COMMON_H_ #define RIME_COMMON_H_ #include <memory> #include <utility> #define BOOST_BIND_NO_PLACEHOLDERS #include <boost/signals2/connection.hpp> #include <boost/signals2/signal.hpp> #ifdef RIME_ENABLE_LOGGING #include <glog/logging.h> #else #include "no_logging.h" #endif // RIME_ENABLE_LOGGING namespace rime { using boost::signals2::connection; using boost::signals2::signal; using std::unique_ptr; using std::shared_ptr; using std::weak_ptr; template <class A, class B> shared_ptr<A> As(const B& ptr) { return std::dynamic_pointer_cast<A>(ptr); } template <class A, class B> bool Is(const B& ptr) { return bool(As<A, B>(ptr)); } template <class T, class... Args> inline shared_ptr<T> New(Args&&... args) { return std::make_shared<T>(std::forward<Args>(args)...); } } // namespace rime #endif // RIME_COMMON_H_
Fix a typo in the comment.
Fix a typo in the comment.
C
bsd-3-clause
kionz/librime,j717273419/librime,kionz/librime,bygloam/librime,rime/librime,rime/librime,jakwings/librime,bygloam/librime,bygloam/librime,j717273419/librime,rwduzhao/librime,Prcuvu/librime,Prcuvu/librime,j717273419/librime,rwduzhao/librime,rwduzhao/librime,kionz/librime,jakwings/librime,Prcuvu/librime,jakwings/librime,Prcuvu/librime,rime/librime,rime/librime,Prcuvu/librime,kionz/librime
67053fa6cd61e995236f77bd525822a80a2b83aa
src/strategies/BasicRoundStrategy.h
src/strategies/BasicRoundStrategy.h
// This program is free software licenced under MIT Licence. You can // find a copy of this licence in LICENCE.txt in the top directory of // source code. // #ifndef BASIC_ROUND_STRATEGY_H_INCLUDED #define BASIC_ROUND_STRATEGY_H_INCLUDED // Project #include "globals.h" #include "RoundStrategy.h" namespace warlightAi { // Fwrd decls class World; class BasicRoundStrategy : public RoundStrategy { public: BasicRoundStrategy(const World &world, int availableArmies); VecOfPairs getDeployments() const; VecOfTuples getAttacks() const; private: VecOfPairs m_deployments; VecOfTuples m_attacks; }; // class BasicRoundStrategy } // namespace warlightAi #endif // BASIC_ROUND_STRATEGY_H_INCLUDED
// This program is free software licenced under MIT Licence. You can // find a copy of this licence in LICENCE.txt in the top directory of // source code. // #ifndef BASIC_ROUND_STRATEGY_H_INCLUDED #define BASIC_ROUND_STRATEGY_H_INCLUDED // Project #include "globals.h" #include "RoundStrategy.h" namespace warlightAi { // Fwrd decls class World; class BasicRoundStrategy : public RoundStrategy { public: BasicRoundStrategy(const World &world, int availableArmies); VecOfPairs getDeployments() const override; VecOfTuples getAttacks() const override; private: VecOfPairs m_deployments; VecOfTuples m_attacks; }; // class BasicRoundStrategy } // namespace warlightAi #endif // BASIC_ROUND_STRATEGY_H_INCLUDED
Add override after overriden methods
Add override after overriden methods
C
mit
calincru/Warlight-AI-Challenge-2-Bot,calincru/Warlight-AI-Challenge-2-Bot
518c6e2ec1dd9b4ad8bd9b52b35ae2ba0a05594e
mpi_ls_affinity.c
mpi_ls_affinity.c
/* Copyright (c) 2013 Janne Blomqvist 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 <hwloc.h> #include <errno.h> #include <stdio.h> #include <string.h> #ifdef _OPENMP #include <omp.h> #endif #ifdef MPI #include <mpi.h> #endif static hwloc_topology_t topo; static void print_cpu_bind(FILE* f, int rank, int threadid) { char* s; hwloc_bitmap_t cpuset = hwloc_bitmap_alloc(); /* get the current thread CPU location */ hwloc_get_cpubind(topo, cpuset, HWLOC_CPUBIND_THREAD); hwloc_bitmap_asprintf(&s, cpuset); fprintf(f, "MPI rank %d thread %d running on %s\n", rank, threadid, s); } int main(int argc, char **argv) { int rank = 0; hwloc_topology_init(&topo); hwloc_topology_load(topo); #ifdef MPI MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); #endif #pragma omp parallel { #ifdef _OPENMP int threadid = omp_get_thread_num(); #else int threadid = 0; #endif print_cpu_bind(stdout, rank, threadid); } #ifdef MPI MPI_Finalize(); #endif return 0; }
Test program to get CPU affinity of an MPI application
Test program to get CPU affinity of an MPI application
C
mit
jabl/ls_affinity
35ae6c5ab2c6945d346a45dedc095dc54f8b8a03
lib/src/downloader/download-query-loader.h
lib/src/downloader/download-query-loader.h
#ifndef DOWNLOAD_QUERY_LOADER_H #define DOWNLOAD_QUERY_LOADER_H #include <QString> class Site; class DownloadQueryImage; class DownloadQueryGroup; class DownloadQueryLoader { public: static bool load(QString path, QList<DownloadQueryImage> &uniques, QList<DownloadQueryGroup> &batchs, QMap<QString, Site*> &sites); static bool save(QString path, QList<DownloadQueryImage> &uniques, QList<DownloadQueryGroup> &batchs); }; #endif // DOWNLOAD_QUERY_LOADER_H
#ifndef DOWNLOAD_QUERY_LOADER_H #define DOWNLOAD_QUERY_LOADER_H #include <QString> #include <QList> #include <QMap> class Site; class DownloadQueryImage; class DownloadQueryGroup; class DownloadQueryLoader { public: static bool load(QString path, QList<DownloadQueryImage> &uniques, QList<DownloadQueryGroup> &batchs, QMap<QString, Site*> &sites); static bool save(QString path, QList<DownloadQueryImage> &uniques, QList<DownloadQueryGroup> &batchs); }; #endif // DOWNLOAD_QUERY_LOADER_H
Include QList and QMap to header file to fix build
Include QList and QMap to header file to fix build
C
apache-2.0
Bionus/imgbrd-grabber,Bionus/imgbrd-grabber,Bionus/imgbrd-grabber,Bionus/imgbrd-grabber,Bionus/imgbrd-grabber,Bionus/imgbrd-grabber
03c66d522256b7cc8a266625e5f16f4b63b6c303
windows/dirent.h
windows/dirent.h
#ifndef _TOKU_DIRENT_H #define _TOKU_DIRENT_H #if defined(__cplusplus) extern "C" { #endif //The DIR functions do not exist in windows, but the Linux API ends up //just using a wrapper. We might convert these into an toku_os_* type api. enum { DT_UNKNOWN = 0, DT_DIR = 4, DT_REG = 8 }; struct dirent { char d_name[_MAX_PATH]; unsigned char d_type; }; struct __toku_windir; typedef struct __toku_windir DIR; DIR *opendir(const char *name); struct dirent *readdir(DIR *dir); int closedir(DIR *dir); #ifndef NAME_MAX #define NAME_MAX 255 #endif #if defined(__cplusplus) }; #endif #endif
#ifndef _TOKU_DIRENT_H #define _TOKU_DIRENT_H #include "toku_os_types.h" #if defined(__cplusplus) extern "C" { #endif //The DIR functions do not exist in windows, but the Linux API ends up //just using a wrapper. We might convert these into an toku_os_* type api. enum { DT_UNKNOWN = 0, DT_DIR = 4, DT_REG = 8 }; struct dirent { char d_name[_MAX_PATH]; unsigned char d_type; }; struct __toku_windir; typedef struct __toku_windir DIR; DIR *opendir(const char *name); struct dirent *readdir(DIR *dir); int closedir(DIR *dir); #ifndef NAME_MAX #define NAME_MAX 255 #endif #if defined(__cplusplus) }; #endif #endif
Fix broken windows build due to r19902 (merge of 2499d branch)
[t:2499] Fix broken windows build due to r19902 (merge of 2499d branch) git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@19935 c7de825b-a66e-492c-adef-691d508d4ae1
C
lgpl-2.1
ollie314/server,flynn1973/mariadb-aix,natsys/mariadb_10.2,natsys/mariadb_10.2,davidl-zend/zenddbi,natsys/mariadb_10.2,natsys/mariadb_10.2,ollie314/server,ollie314/server,davidl-zend/zenddbi,natsys/mariadb_10.2,natsys/mariadb_10.2,davidl-zend/zenddbi,flynn1973/mariadb-aix,davidl-zend/zenddbi,flynn1973/mariadb-aix,davidl-zend/zenddbi,flynn1973/mariadb-aix,flynn1973/mariadb-aix,slanterns/server,natsys/mariadb_10.2,natsys/mariadb_10.2,ollie314/server,flynn1973/mariadb-aix,flynn1973/mariadb-aix,davidl-zend/zenddbi,ollie314/server,natsys/mariadb_10.2,davidl-zend/zenddbi,ollie314/server,ollie314/server,flynn1973/mariadb-aix,ollie314/server,ollie314/server,davidl-zend/zenddbi,davidl-zend/zenddbi,flynn1973/mariadb-aix,davidl-zend/zenddbi,flynn1973/mariadb-aix,davidl-zend/zenddbi,natsys/mariadb_10.2,ollie314/server,ollie314/server,natsys/mariadb_10.2,flynn1973/mariadb-aix
8c890982a2aa318fcc632ee616e1c5398fa9eb91
Settings/Display.h
Settings/Display.h
#pragma once #include "Tab.h" class Display : public Tab { public: virtual void SaveSettings(); protected: virtual void Initialize(); virtual void LoadSettings(); private: bool OnAnimationChanged(); bool OnAnimationSpin(NMUPDOWN *ud); bool OnCustomCheckChanged(); bool OnPositionChanged(); private: /* Controls: */ Checkbox _onTop; Checkbox _hideFullscreen; ComboBox _position; Label _customX; EditBox _positionX; Label _customY; EditBox _positionY; Checkbox _customDistance; Spinner _edgeSpinner; Label _displayDevLabel; ComboBox _displayDevice; ComboBox _animation; Label _hideDelayLabel; Spinner _hideDelay; Label _hideSpeedLabel; Spinner _hideSpeed; private: /* Strings: */ std::wstring primaryMonitorStr = L"Primary Monitor"; std::wstring allMonitorStr = L"All Monitors"; std::wstring customPositionStr = L"Custom"; std::wstring noAnimStr = L"None"; private: /* Constants: */ const int MIN_EDGE = -65535; const int MAX_EDGE = 65535; const int MIN_MS = USER_TIMER_MINIMUM; const int MAX_MS = 60000; };
#pragma once #include "Tab.h" #include <CommCtrl.h> class Display : public Tab { public: virtual void SaveSettings(); protected: virtual void Initialize(); virtual void LoadSettings(); private: bool OnAnimationChanged(); bool OnAnimationSpin(NMUPDOWN *ud); bool OnCustomCheckChanged(); bool OnPositionChanged(); private: /* Controls: */ Checkbox _onTop; Checkbox _hideFullscreen; ComboBox _position; Label _customX; EditBox _positionX; Label _customY; EditBox _positionY; Checkbox _customDistance; Spinner _edgeSpinner; Label _displayDevLabel; ComboBox _displayDevice; ComboBox _animation; Label _hideDelayLabel; Spinner _hideDelay; Label _hideSpeedLabel; Spinner _hideSpeed; private: /* Strings: */ std::wstring primaryMonitorStr = L"Primary Monitor"; std::wstring allMonitorStr = L"All Monitors"; std::wstring customPositionStr = L"Custom"; std::wstring noAnimStr = L"None"; private: /* Constants: */ const int MIN_EDGE = -65535; const int MAX_EDGE = 65535; const int MIN_MS = USER_TIMER_MINIMUM; const int MAX_MS = 60000; const int ANIM_SPIN_INCREMENT = 100; };
Add constant for spin increment
Add constant for spin increment
C
bsd-2-clause
malensek/3RVX,malensek/3RVX,malensek/3RVX,Soulflare3/3RVX,Soulflare3/3RVX,Soulflare3/3RVX
41bf86fc16dd31522953dff4b29241c98c082139
tests/sv-comp/cfg/path_true-unreach-call.c
tests/sv-comp/cfg/path_true-unreach-call.c
extern void __VERIFIER_error() __attribute__ ((__noreturn__)); extern int __VERIFIER_nondet_int(); void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR: __VERIFIER_error(); } return; } int main() { int x, y; if (__VERIFIER_nondet_int()) { x = 0; y = 1; } else { x = 1; y = 0; } __VERIFIER_assert(x + y == 1); return 0; }
Add basic (base analysis) path sensitivity test
Add basic (base analysis) path sensitivity test
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
1f1153dc7087845e1909bae381af106d39c13912
tests/pinocchio/lib.h
tests/pinocchio/lib.h
#include <QtCore/QProcess> #include <QtDBus/QtDBus> #include <QtTest/QtTest> #include <TelepathyQt4/Client/PendingOperation> #include <TelepathyQt4/Constants> #include "tests/lib/test.h" class PinocchioTest : public Test { Q_OBJECT public: PinocchioTest(QObject *parent = 0); virtual ~PinocchioTest(); static inline QLatin1String pinocchioBusName() { return QLatin1String( TELEPATHY_CONNECTION_MANAGER_BUS_NAME_BASE "pinocchio"); } static inline QLatin1String pinocchioObjectPath() { return QLatin1String( TELEPATHY_CONNECTION_MANAGER_OBJECT_PATH_BASE "pinocchio"); } bool waitForPinocchio(uint timeoutMs = 5000); protected: QString mPinocchioPath; QString mPinocchioCtlPath; QProcess mPinocchio; QEventLoop *mLoop; virtual void initTestCaseImpl(); virtual void cleanupTestCaseImpl(); protected Q_SLOTS: void gotNameOwner(QDBusPendingCallWatcher* watcher); void onNameOwnerChanged(const QString&, const QString&, const QString&); };
#include <QtCore/QProcess> #include <QtDBus/QtDBus> #include <QtTest/QtTest> #include <TelepathyQt4/Client/PendingOperation> #include <TelepathyQt4/Constants> #include "tests/lib/test.h" class PinocchioTest : public Test { Q_OBJECT public: PinocchioTest(QObject *parent = 0); virtual ~PinocchioTest(); static inline QLatin1String pinocchioBusName() { return QLatin1String( TELEPATHY_CONNECTION_MANAGER_BUS_NAME_BASE "pinocchio"); } static inline QLatin1String pinocchioObjectPath() { return QLatin1String( TELEPATHY_CONNECTION_MANAGER_OBJECT_PATH_BASE "pinocchio"); } bool waitForPinocchio(uint timeoutMs = 5000); protected: QString mPinocchioPath; QString mPinocchioCtlPath; QProcess mPinocchio; virtual void initTestCaseImpl(); virtual void cleanupTestCaseImpl(); protected Q_SLOTS: void gotNameOwner(QDBusPendingCallWatcher* watcher); void onNameOwnerChanged(const QString&, const QString&, const QString&); };
Remove spurious mLoop member from PinocchioTest
Remove spurious mLoop member from PinocchioTest Having moved mLoop into the parent class, the fact that there's another one here (uninitialized, and used for about half the functions) breaks the tests.
C
lgpl-2.1
TelepathyIM/telepathy-qt,special/telepathy-qt-upstream,tiagosh/telepathy-qt,TelepathyQt/telepathy-qt,anantkamath/telepathy-qt,anantkamath/telepathy-qt,freedesktop-unofficial-mirror/telepathy__telepathy-qt4,tiagosh/telepathy-qt,TelepathyIM/telepathy-qt,freedesktop-unofficial-mirror/telepathy__telepathy-qt,special/telepathy-qt-upstream,TelepathyIM/telepathy-qt,freedesktop-unofficial-mirror/telepathy__telepathy-qt4,special/telepathy-qt-upstream,freedesktop-unofficial-mirror/telepathy__telepathy-qt,TelepathyIM/telepathy-qt,TelepathyQt/telepathy-qt,TelepathyQt/telepathy-qt,detrout/telepathy-qt,TelepathyQt/telepathy-qt,freedesktop-unofficial-mirror/telepathy__telepathy-qt4,detrout/telepathy-qt,detrout/telepathy-qt,freedesktop-unofficial-mirror/telepathy__telepathy-qt,freedesktop-unofficial-mirror/telepathy__telepathy-qt4,tiagosh/telepathy-qt,freedesktop-unofficial-mirror/telepathy__telepathy-qt,anantkamath/telepathy-qt,TelepathyIM/telepathy-qt,tiagosh/telepathy-qt
99b0d43bdf67fc060df5e5b541d72e6e3723a391
chap1/charcount.c
chap1/charcount.c
#include <stdio.h> int main() { long nc = 0; while (getchar() != EOF) { ++nc; } printf("count: %d\n", nc); }
#include <stdio.h> int main() { double nc = 0; for (nc = 0; getchar() != EOF; ++nc) ; printf("count: %f\n", nc); }
Use dirty C tricks to make it smaller
Use dirty C tricks to make it smaller
C
mit
jabocg/theclang
9ff982c1ae369eeb29f416251c63721a9c8738bf
test/CodeGen/2009-06-01-addrofknr.c
test/CodeGen/2009-06-01-addrofknr.c
// RUN: clang-cc %s -o %t -emit-llvm -verify // PR4289 struct funcptr { int (*func)(); }; static int func(f) void *f; { return 0; } int main(int argc, char *argv[]) { struct funcptr fp; fp.func = &func; fp.func = func; return 0; }
// RUN: clang-cc %s -o %t -emit-llvm -verify // PR4289 struct funcptr { int (*func)(); }; static int func(f) void *f; { return 0; } int main(int argc, char *argv[]) { struct funcptr fp; fp.func = &func; fp.func = func; }
Revert this, was a bug in my new warning code, not the test case.
Revert this, was a bug in my new warning code, not the test case. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@76690 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
ebb0c49aa4b45a4778ec270c99b872873d4d37a6
starlight.h
starlight.h
#pragma once #include <string> #if 0 int Stricmp(const char* str1, const char* str2) { int d; while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; } return d; } int Strnicmp(const char* str1, const char* str2, int count) { int d = 0; while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; count--; } return d; } #endif #ifdef _MSC_VER #define SL_CALL __vectorcall #else #define SL_CALL #endif #define COUNT_OF(X) (sizeof(X) / sizeof((X)[0])) #define ZERO_MEM(X, Y) (memset(X, 0, Y));
#pragma once #include <string> #if 0 int Stricmp(const char* str1, const char* str2) { int d; while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; } return d; } int Strnicmp(const char* str1, const char* str2, int count) { int d = 0; while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; count--; } return d; } #endif #if defined(_MSC_VER) && (_MSC_VER >= 1800) #define SL_CALL __vectorcall #else #define SL_CALL #endif #define COUNT_OF(X) (sizeof(X) / sizeof((X)[0])) #define ZERO_MEM(X, Y) (memset(X, 0, Y));
Remove __vectorcall calling convention on older versions of MSVC++
Remove __vectorcall calling convention on older versions of MSVC++
C
mit
darkedge/starlight,darkedge/starlight,darkedge/starlight
17135f7fdf4e4757570805be06fff3c7ae13ec3e
base/win/comptr.h
base/win/comptr.h
// LAF Base Library // Copyright (c) 2017 David Capello // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifndef BASE_WIN_COMPTR_H_INCLUDED #define BASE_WIN_COMPTR_H_INCLUDED #pragma once #if !defined(_WIN32) #error This header file can be used only on Windows platform #endif #include "base/disable_copying.h" namespace base { template<class T> class ComPtr { public: ComPtr() : m_ptr(nullptr) { } ~ComPtr() { reset(); } T** operator&() { return &m_ptr; } T* operator->() { return m_ptr; } T* get() { return m_ptr; } void reset() { if (m_ptr) { m_ptr->Release(); m_ptr = nullptr; } } private: T* m_ptr; DISABLE_COPYING(ComPtr); }; } // namespace base #endif
Add ComPtr utility to laf-base library
Add ComPtr utility to laf-base library
C
mit
aseprite/laf,aseprite/laf
797a01fb912a5d121649726f4f7956a9c5da9f16
tests/regression/02-base/51-empty-not-dead.c
tests/regression/02-base/51-empty-not-dead.c
//PARAM: --set ana.activated '["base", "mallocWrapper"]' // Copied & modified from 33/04. #include <assert.h> int main() { // state: {bot}, because no locals/globals assert(1); // state: {bot}, because Hoare set add (in PathSensitive2 map) keeps bot, while reduce would remove assert(1); // state: {bot}, because Hoare set add (in PathSensitive2 map) keeps bot, while reduce would remove return 0; }
Add test where base has live bottom state
Add test where base has live bottom state
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
77378e0ff43a3fc1074c3eac22dbf25d1686fece
src/imap/cmd-create.c
src/imap/cmd-create.c
/* Copyright (C) 2002 Timo Sirainen */ #include "common.h" #include "mail-namespace.h" #include "commands.h" bool cmd_create(struct client_command_context *cmd) { struct mail_namespace *ns; const char *mailbox, *full_mailbox; bool directory; size_t len; /* <mailbox> */ if (!client_read_string_args(cmd, 1, &mailbox)) return FALSE; full_mailbox = mailbox; ns = client_find_namespace(cmd, &mailbox); if (ns == NULL) return TRUE; len = strlen(full_mailbox); if (len == 0 || full_mailbox[len-1] != ns->sep) directory = FALSE; else { /* name ends with hierarchy separator - client is just informing us that it wants to create children under this mailbox. */ directory = TRUE; mailbox = t_strndup(mailbox, len-1); full_mailbox = t_strndup(full_mailbox, strlen(full_mailbox)-1); } if (!client_verify_mailbox_name(cmd, full_mailbox, FALSE, TRUE)) return TRUE; if (mail_storage_mailbox_create(ns->storage, mailbox, directory) < 0) client_send_storage_error(cmd, ns->storage); else client_send_tagline(cmd, "OK Create completed."); return TRUE; }
/* Copyright (C) 2002 Timo Sirainen */ #include "common.h" #include "mail-namespace.h" #include "commands.h" bool cmd_create(struct client_command_context *cmd) { struct mail_namespace *ns; const char *mailbox, *full_mailbox; bool directory; size_t len; /* <mailbox> */ if (!client_read_string_args(cmd, 1, &mailbox)) return FALSE; full_mailbox = mailbox; ns = client_find_namespace(cmd, &mailbox); if (ns == NULL) return TRUE; len = strlen(full_mailbox); if (len == 0 || full_mailbox[len-1] != ns->sep) directory = FALSE; else { /* name ends with hierarchy separator - client is just informing us that it wants to create children under this mailbox. */ directory = TRUE; mailbox = t_strndup(mailbox, strlen(mailbox)-1); full_mailbox = t_strndup(full_mailbox, len-1); } if (!client_verify_mailbox_name(cmd, full_mailbox, FALSE, TRUE)) return TRUE; if (mail_storage_mailbox_create(ns->storage, mailbox, directory) < 0) client_send_storage_error(cmd, ns->storage); else client_send_tagline(cmd, "OK Create completed."); return TRUE; }
CREATE ns_prefix/box/ didn't work right when namespace prefix existed.
CREATE ns_prefix/box/ didn't work right when namespace prefix existed. --HG-- branch : HEAD
C
mit
dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot
bf3b21090f3081c379cffb8f28cecfe6cb28591b
include/shmlog_tags.h
include/shmlog_tags.h
/* * $Id$ * * Define the tags in the shared memory in a reusable format. * Whoever includes this get to define what the SLTM macro does. * */ SLTM(CLI) SLTM(SessionOpen) SLTM(SessionClose) SLTM(ClientAddr) SLTM(Request) SLTM(URL) SLTM(Protocol) SLTM(HD_Unknown) SLTM(HD_Lost) #define HTTPH(a, b, c, d, e, f, g) SLTM(b) #include "http_headers.h" #undef HTTPH
/* * $Id$ * * Define the tags in the shared memory in a reusable format. * Whoever includes this get to define what the SLTM macro does. * */ SLTM(Debug) SLTM(CLI) SLTM(SessionOpen) SLTM(SessionClose) SLTM(ClientAddr) SLTM(Request) SLTM(URL) SLTM(Protocol) SLTM(HD_Unknown) SLTM(HD_Lost) #define HTTPH(a, b, c, d, e, f, g) SLTM(b) #include "http_headers.h" #undef HTTPH
Add a Debug shmemlog tag.
Add a Debug shmemlog tag. git-svn-id: 7d4b18ab7d176792635d6a7a77dd8cbbea8e8daa@104 d4fa192b-c00b-0410-8231-f00ffab90ce4
C
bsd-2-clause
ssm/pkg-varnish,CartoDB/Varnish-Cache,ssm/pkg-varnish,wikimedia/operations-debs-varnish,ssm/pkg-varnish,CartoDB/Varnish-Cache,wikimedia/operations-debs-varnish,CartoDB/Varnish-Cache,wikimedia/operations-debs-varnish,wikimedia/operations-debs-varnish,ssm/pkg-varnish,ssm/pkg-varnish,wikimedia/operations-debs-varnish
c0d6f035e91ad580fca2e764c7bbe6c70d4d5c74
src/condor_includes/condor_syscall_mode.h
src/condor_includes/condor_syscall_mode.h
#ifndef _CONDOR_SYSCALLS_H #define _CONDOR_SYSCALLS_H #if defined( AIX32) # include "syscall.aix32.h" #else # include <syscall.h> #endif typedef int BOOL; static const int SYS_LOCAL = 1; static const int SYS_REMOTE = 0; static const int SYS_RECORDED = 2; static const int SYS_MAPPED = 2; static const int SYS_UNRECORDED = 0; static const int SYS_UNMAPPED = 0; #if defined(__cplusplus) extern "C" { #endif int SetSyscalls( int mode ); int GetSyscallMode(); BOOL LocalSysCalls(); BOOL RemoteSysCalls(); BOOL MappingFileDescriptors(); int REMOTE_syscall( int syscall_num, ... ); #if defined(OSF1) || defined(HPUX9) int syscall( int, ... ); #endif #if defined(__cplusplus) } #endif #endif
#ifndef _CONDOR_SYSCALLS_H #define _CONDOR_SYSCALLS_H #if defined( AIX32) # include "syscall.aix.h" #else # include <syscall.h> #endif typedef int BOOL; static const int SYS_LOCAL = 1; static const int SYS_REMOTE = 0; static const int SYS_RECORDED = 2; static const int SYS_MAPPED = 2; static const int SYS_UNRECORDED = 0; static const int SYS_UNMAPPED = 0; #if defined(__cplusplus) extern "C" { #endif int SetSyscalls( int mode ); int GetSyscallMode(); BOOL LocalSysCalls(); BOOL RemoteSysCalls(); BOOL MappingFileDescriptors(); int REMOTE_syscall( int syscall_num, ... ); #if defined(OSF1) || defined(HPUX9) int syscall( int, ... ); #endif #if defined(__cplusplus) } #endif #endif
Make work for AIX machines.
Make work for AIX machines.
C
apache-2.0
zhangzhehust/htcondor,zhangzhehust/htcondor,htcondor/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,bbockelm/condor-network-accounting,htcondor/htcondor,djw8605/htcondor,clalancette/condor-dcloud,djw8605/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,djw8605/condor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,htcondor/htcondor,zhangzhehust/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,djw8605/htcondor,neurodebian/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,djw8605/condor,mambelli/osg-bosco-marco,htcondor/htcondor,zhangzhehust/htcondor,djw8605/htcondor,djw8605/htcondor,neurodebian/htcondor,neurodebian/htcondor,htcondor/htcondor,neurodebian/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,htcondor/htcondor,djw8605/condor,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,djw8605/condor,neurodebian/htcondor,clalancette/condor-dcloud,djw8605/condor,djw8605/condor,htcondor/htcondor,bbockelm/condor-network-accounting,djw8605/condor,neurodebian/htcondor,bbockelm/condor-network-accounting,zhangzhehust/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,zhangzhehust/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/htcondor,zhangzhehust/htcondor,djw8605/condor,htcondor/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco
f08a19b4cdf0740d852fc4cadf1c27f4cf63cfb9
libmorton/include/morton_common.h
libmorton/include/morton_common.h
#pragma once #include <stdint.h> #if _MSC_VER #include <intrin.h> #endif template<typename morton> inline bool findFirstSetBit(const morton x, unsigned long* firstbit_location) { #if _MSC_VER && !_WIN64 // 32 BIT on 32 BIT if (sizeof(morton) <= 4) { return _BitScanReverse(firstbit_location, x); } // 64 BIT on 32 BIT else { *firstbit_location = 0; if (_BitScanReverse(firstbit_location, (x >> 32))) { // check first part firstbit_location += 32; return true; } return _BitScanReverse(firstbit_location, (x & 0xFFFFFFFF)); } #elif _MSC_VER && _WIN64 // 32 or 64 BIT on 64 BIT return _BitScanReverse64(firstbit_location, x); #elif __GNUC__ if (x == 0) { return false; } else { *firstbit_location = static_cast<unsigned long>((sizeof(morton)*8) - __builtin_clzll(x)); return true; } #endif }
#pragma once // Libmorton - Common helper methods needed in Morton encoding/decoding #include <stdint.h> #if _MSC_VER #include <intrin.h> #endif template<typename morton> inline bool findFirstSetBit(const morton x, unsigned long* firstbit_location) { #if _MSC_VER && !_WIN64 // 32 BIT on 32 BIT if (sizeof(morton) <= 4) { return _BitScanReverse(firstbit_location, x); } // 64 BIT on 32 BIT else { *firstbit_location = 0; if (_BitScanReverse(firstbit_location, (x >> 32))) { // check first part firstbit_location += 32; return true; } return _BitScanReverse(firstbit_location, (x & 0xFFFFFFFF)); } #elif _MSC_VER && _WIN64 // 32 or 64 BIT on 64 BIT return _BitScanReverse64(firstbit_location, x) != 0; #elif __GNUC__ if (x == 0) { return false; } else { *firstbit_location = static_cast<unsigned long>((sizeof(morton)*8) - __builtin_clzll(x)); return true; } #endif }
Fix MSVC compiler warnings about return value not being a boolean
Fix MSVC compiler warnings about return value not being a boolean
C
mit
Forceflow/libmorton
b96e42cf7643421ab923ac1d4bb0119c2f3faa8e
include/tclap/Visitor.h
include/tclap/Visitor.h
/****************************************************************************** * * file: Visitor.h * * Copyright (c) 2003, Michael E. Smoot . * All rights reverved. * * See the file COPYING in the top directory of this distribution for * more information. * * 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. * *****************************************************************************/ #ifndef TCLAP_VISITOR_H #define TCLAP_VISITOR_H namespace TCLAP { /** * A base class that defines the interface for visitors. */ class Visitor { public: /** * Constructor. Does nothing. */ Visitor() { } /** * Destructor. Does nothing. */ virtual ~Visitor() { } /** * Does nothing. Should be overridden by child. */ virtual void visit() { } }; } #endif
/****************************************************************************** * * file: Visitor.h * * Copyright (c) 2003, Michael E. Smoot . * All rights reverved. * * See the file COPYING in the top directory of this distribution for * more information. * * 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. * *****************************************************************************/ #ifndef TCLAP_VISITOR_H #define TCLAP_VISITOR_H namespace TCLAP { /** * A base class that defines the interface for visitors. */ class Visitor { public: /** * Constructor. Does nothing. */ Visitor() { } /** * Destructor. Does nothing. */ virtual ~Visitor() { } /** * This method (to implemented by children) will be * called when the visitor is visited. */ virtual void visit() = 0; }; } #endif
Make "visit" method pure virtual (needs to be implemented by subclass to make sense).
Make "visit" method pure virtual (needs to be implemented by subclass to make sense).
C
mit
ufz/tclap,ufz/tclap,mjkoo/tclap,mirror/tclap,ufz/tclap,mirror/tclap,Qointum/tclap,mc-server/TCLAP,xguerin/tclap,mc-server/TCLAP,Qointum/tclap,mirror/tclap,mirror/tclap,mjkoo/tclap,xguerin/tclap,xguerin/tclap,mjkoo/tclap,xguerin/tclap,mc-server/TCLAP,Qointum/tclap
d8f45f076d3f27ac094acb998c2c457ec2ae105f
RectConfinementForce.h
RectConfinementForce.h
/*===- RectConfinementForce.h - libSimulation -================================= * * DEMON * * This file is distributed under the BSD Open Source License. See LICENSE.TXT * for details. * *===-----------------------------------------------------------------------===*/ #ifndef RECTCONFINEMENTFORCE_H #define RECTCONFINEMENTFORCE_H #include "Force.h" class RectConfinementForce : public Force { public: RectConfinementForce(Cloud * const C, double confineConstX, double confineConstY) : Force(C), confineX(-confineConstX), confineY(-confineConstY) {} // IMPORTANT: In the above constructor, confineConst_'s must be positive! ~RectConfinementForce() {} // public functions: void force1(const double currentTime); // rk substep 1 void force2(const double currentTime); // rk substep 2 void force3(const double currentTime); // rk substep 3 void force4(const double currentTime); // rk substep 4 void writeForce(fitsfile * const file, int * const error) const; void readForce(fitsfile * const file, int * const error); private: // private variables: double confineX; double confineY; // private functions: void force(const cloud_index currentParticle, const __m128d currentPositionX, const __m128d currentPositionY); }; #endif // RECTCONFINEMENTFORCE_H
/*===- RectConfinementForce.h - libSimulation -================================= * * DEMON * * This file is distributed under the BSD Open Source License. See LICENSE.TXT * for details. * *===-----------------------------------------------------------------------===*/ #ifndef RECTCONFINEMENTFORCE_H #define RECTCONFINEMENTFORCE_H #include "Force.h" class RectConfinementForce : public Force { public: RectConfinementForce(Cloud * const C, double confineConstX, double confineConstY) : Force(C), confineX(confineConstX), confineY(-confineConstY) {} // IMPORTANT: In the above constructor, confineConst_'s must be positive! ~RectConfinementForce() {} // public functions: void force1(const double currentTime); // rk substep 1 void force2(const double currentTime); // rk substep 2 void force3(const double currentTime); // rk substep 3 void force4(const double currentTime); // rk substep 4 void writeForce(fitsfile * const file, int * const error) const; void readForce(fitsfile * const file, int * const error); private: // private variables: double confineX; double confineY; // private functions: void force(const cloud_index currentParticle, const __m128d currentPositionX, const __m128d currentPositionY); }; #endif // RECTCONFINEMENTFORCE_H
Fix direction of rectangular confinement force.
Fix direction of rectangular confinement force.
C
bsd-3-clause
leios/demonsimulationcode,leios/demonsimulationcode
ae6149b38413f373634eec6bfd897789cb0c7bdf
tests/regression/29-svcomp/12_interval_bot.c
tests/regression/29-svcomp/12_interval_bot.c
// PARAM: --enable ana.int.interval --enable ana.int.def_exc int main(){ unsigned long long a ; unsigned long long addr; if(a + addr > 0x0ffffffffULL){ return 1; } }
Add minimal failing test case
Add minimal failing test case
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
bf6888b5555a045a90642bf637f1a18f82559bcc
src/arch/microblaze/kernel/interrupt_handler.c
src/arch/microblaze/kernel/interrupt_handler.c
/** * @file * @details This file contains @link interrupt_handler() @endlink function. * It's proxy between asm code and kernel interrupt handler * @link irq_dispatch() @endlink function. * * @date 27.11.09 * @author Anton Bondarev */ #include <drivers/irqctrl.h> #include <asm/msr.h> /* we havn't interrupts acknowledgment in microblaze architecture * and must receive interrupt number our self and then clear pending bit in * pending register */ void interrupt_handler(void) { unsigned int pending; while (0 != (pending = mb_intc_get_pending())) { unsigned int irq_num; for (irq_num = 0; irq_num < IRQCTRL_IRQS_TOTAL; irq_num++) { if (pending & (1 << irq_num)) { //TODO we must clear whole pending register irqctrl_clear(irq_num); /*now we allow nested irq*/ msr_set_ie(); irq_dispatch(irq_num); } } } }
/** * @file * @details This file contains @link interrupt_handler() @endlink function. * It's proxy between asm code and kernel interrupt handler * @link irq_dispatch() @endlink function. * * @date 27.11.09 * @author Anton Bondarev */ #include <drivers/irqctrl.h> #include <asm/msr.h> #include <kernel/irq.h> /* we havn't interrupts acknowledgment in microblaze architecture * and must receive interrupt number our self and then clear pending bit in * pending register */ void interrupt_handler(void) { unsigned int pending; while (0 != (pending = mb_intc_get_pending())) { unsigned int irq_num; for (irq_num = 0; irq_num < IRQCTRL_IRQS_TOTAL; irq_num++) { if (pending & (1 << irq_num)) { //TODO we must clear whole pending register irqctrl_clear(irq_num); /*now we allow nested irq*/ msr_set_ie(); irq_dispatch(irq_num); } } } }
Fix microblaze build after merge 480c64b
Fix microblaze build after merge 480c64b
C
bsd-2-clause
gzoom13/embox,mike2390/embox,embox/embox,Kefir0192/embox,abusalimov/embox,mike2390/embox,mike2390/embox,gzoom13/embox,Kefir0192/embox,Kakadu/embox,abusalimov/embox,Kakadu/embox,gzoom13/embox,vrxfile/embox-trik,Kakadu/embox,vrxfile/embox-trik,gzoom13/embox,gzoom13/embox,mike2390/embox,gzoom13/embox,embox/embox,Kakadu/embox,embox/embox,vrxfile/embox-trik,Kefir0192/embox,Kefir0192/embox,Kakadu/embox,gzoom13/embox,mike2390/embox,vrxfile/embox-trik,abusalimov/embox,Kefir0192/embox,vrxfile/embox-trik,abusalimov/embox,vrxfile/embox-trik,Kefir0192/embox,abusalimov/embox,embox/embox,mike2390/embox,Kakadu/embox,Kefir0192/embox,abusalimov/embox,embox/embox,vrxfile/embox-trik,embox/embox,mike2390/embox,Kakadu/embox
267980e066f9e8c5df8902cdec2005018f632a4d
simulator/mips/mips.h
simulator/mips/mips.h
/** * mips.h - all the aliases to MIPS ISA * @author Aleksandr Misevich * Copyright 2018 MIPT-MIPS */ #ifndef MIPS_H_ #define MIPS_H_ #include "mips_instr.h" #include <infra/instrcache/instr_cache_memory.h> template<MIPSVersion VERSION> struct MIPS { using Register = MIPSRegister; using RegisterUInt = MIPSRegisterUInt<VERSION>; using FuncInstr = MIPSInstr<VERSION>; using Memory = InstrMemory<FuncInstr>; static const auto& get_instr( uint32 bytes, Addr PC) { return FuncInstr( VERSION, bytes, PC); } }; // 32 bit MIPS using MIPSI = MIPS<MIPSVersion::I>; using MIPSII = MIPS<MIPSVersion::II>; using MIPS32 = MIPS<MIPSVersion::v32>; // 64 bit MIPS using MIPSIII = MIPS<MIPSVersion::III>; using MIPSIV = MIPS<MIPSVersion::IV>; using MIPS64 = MIPS<MIPSVersion::v64>; static_assert( std::is_same_v<MIPS32Instr, MIPS32::FuncInstr>); static_assert( std::is_same_v<MIPS64Instr, MIPS64::FuncInstr>); #endif // MIPS_H_
/** * mips.h - all the aliases to MIPS ISA * @author Aleksandr Misevich * Copyright 2018 MIPT-MIPS */ #ifndef MIPS_H_ #define MIPS_H_ #include "mips_instr.h" #include <infra/instrcache/instr_cache_memory.h> template<MIPSVersion version> struct MIPS { using Register = MIPSRegister; using RegisterUInt = MIPSRegisterUInt<version>; using FuncInstr = MIPSInstr<version>; using Memory = InstrMemory<FuncInstr>; static const auto& get_instr( uint32 bytes, Addr PC) { return FuncInstr( version, bytes, PC); } }; // 32 bit MIPS using MIPSI = MIPS<MIPSVersion::I>; using MIPSII = MIPS<MIPSVersion::II>; using MIPS32 = MIPS<MIPSVersion::v32>; // 64 bit MIPS using MIPSIII = MIPS<MIPSVersion::III>; using MIPSIV = MIPS<MIPSVersion::IV>; using MIPS64 = MIPS<MIPSVersion::v64>; static_assert( std::is_same_v<MIPS32Instr, MIPS32::FuncInstr>); static_assert( std::is_same_v<MIPS64Instr, MIPS64::FuncInstr>); #endif // MIPS_H_
Rename VERSION to avoid overlapping with external macros
Rename VERSION to avoid overlapping with external macros
C
mit
MIPT-ILab/mipt-mips,MIPT-ILab/mipt-mips-2015,MIPT-ILab/mipt-mips,MIPT-ILab/mipt-mips-2015,MIPT-ILab/mipt-mips-2015,MIPT-ILab/mipt-mips-2015
1243b447349640c14dc76a2f441edb77a9892186
include/knowledge/ClassSelector.h
include/knowledge/ClassSelector.h
#ifndef CLASS_SELECTOR_H_ #define CLASS_SELECTOR_H_ #include "llvm/IR/Module.h" #include "llvm/IR/Instruction.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Function.h" #include "llvm/IR/Operator.h" #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" #include "llvm/IR/User.h" #include "llvm/IR/Argument.h" #include "llvm/IR/Constant.h" #include "llvm/Analysis/RegionInfo.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/IR/GlobalVariable.h" #include "llvm/IR/GlobalValue.h" #include "llvm/IR/GlobalAlias.h" #include "llvm/IR/InlineAsm.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/DenseMap.h" #include "llvm/Support/Casting.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/Casting.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Analysis/RegionInfo.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/RegionPass.h" #include "llvm/Analysis/LoopPass.h" #include "llvm/ADT/Optional.h" namespace knowledge { template<typename T> struct ElectronClassNameSelector { static void selectName(llvm::raw_string_ostream& str) { str << ""; } }; #define X(__, type, className, ___) \ template<> \ struct ElectronClassNameSelector<type> { \ static void selectName(llvm::raw_string_ostream& str) { \ str << className ; \ } \ }; #include "knowledge/EngineNodes.def" #undef X } #endif // CLASS_SELECTOR_H_
Move class selection code out to a separate header
Move class selection code out to a separate header - makes it possible to be referenced by teh gen-clips-classes program
C
bsd-3-clause
DrItanium/durandal,DrItanium/durandal
f585f6437fb528405f2a9afb620b21be21bebfac
src/main.c
src/main.c
#include <stdio.h> int main(int argc, char *argv[]) { printf("gxtas - The GTA Text Assembler\n"); return 0; }
/* * Copyright (c) 2017 Wes Hampson <[email protected]> * * Licensed under the MIT License. See LICENSE at top level directory. */ #include <stdio.h> #include <string.h> #include "gxtas.h" void show_help_info(void) { printf("%s\n", GXTAS_HELP_MESSAGE); } void show_version_info(void) { printf("%s - %s\n", GXTAS_APP_NAME, GXTAS_APP_MOTTO); printf("Version %d.%d.%d%s\n", GXTAS_VERSION_MAJOR, GXTAS_VERSION_MINOR, GXTAS_VERSION_PATCH, GXTAS_VERSION_BUILD); printf("\n%s\n", GXTAS_COPYRIGHT_NOTICE); printf("\n%s\n", GXTAS_LICENSE_NOTICE); printf("\n%s\n", GXTAS_WARRANTY_NOTICE); } int main(int argc, char *argv[]) { if (argc < 2) { show_help_info(); } else if (strcmp(argv[1], "--version") == 0) { show_version_info(); } else { show_help_info(); } return 0; }
Add license header, add version and help info
Add license header, add version and help info
C
mit
thehambone93/gxtmaker,thehambone93/gxtmaker
0f262e2c5921e8febea95f259c41302714de5a6a
src/settings/types/Ratio.h
src/settings/types/Ratio.h
//Copyright (c) 2018 Ultimaker B.V. //CuraEngine is released under the terms of the AGPLv3 or higher. #ifndef RATIO_H #define RATIO_H namespace cura { /* * \brief Represents a ratio between two numbers. * * This is a facade. It behaves like a double. */ struct Ratio { /* * \brief Default constructor setting the ratio to 1. */ constexpr Ratio() : value(1.0) {}; /* * \brief Casts a double to a Ratio instance. */ constexpr Ratio(double value) : value(value / 100) {}; /* * \brief Casts the Ratio instance to a double. */ operator double() const { return value; } /* * \brief The actual ratio, as a double. */ double value = 0; }; constexpr Ratio operator "" _r(const long double ratio) { return Ratio(ratio); } } #endif //RATIO_H
//Copyright (c) 2018 Ultimaker B.V. //CuraEngine is released under the terms of the AGPLv3 or higher. #ifndef RATIO_H #define RATIO_H namespace cura { /* * \brief Represents a ratio between two numbers. * * This is a facade. It behaves like a double. */ struct Ratio { /* * \brief Default constructor setting the ratio to 1. */ constexpr Ratio() : value(1.0) {}; /* * \brief Casts a double to a Ratio instance. */ constexpr Ratio(double value) : value(value / 100) {}; /* * \brief Casts the Ratio instance to a double. */ operator double() const { return value; } /* * Some operators for arithmetic on ratios. */ Ratio operator *(const Ratio& other) const { return Ratio(value * other.value); } template<typename E> Ratio operator *(const E& other) const { return Ratio(value * other); } Ratio operator /(const Ratio& other) const { return Ratio(value / other.value); } template<typename E> Ratio operator /(const E& other) const { return Ratio(value / other); } Ratio& operator *=(const Ratio& other) { value *= other.value; return *this; } template<typename E> Ratio& operator *=(const E& other) { value *= other; return *this; } Ratio& operator /=(const Ratio& other) { value /= other.value; return *this; } template<typename E> Ratio& operator /=(const E& other) { value /= other; return *this; } /* * \brief The actual ratio, as a double. */ double value = 0; }; constexpr Ratio operator "" _r(const long double ratio) { return Ratio(ratio); } } #endif //RATIO_H
Add operators for arithmetic with ratios
Add operators for arithmetic with ratios Contributes to issue CURA-4410.
C
agpl-3.0
Ultimaker/CuraEngine,Ultimaker/CuraEngine
472c06e90366bc906d48caac6d9e6320e4823116
include/rocksdb/perf_level.h
include/rocksdb/perf_level.h
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. #ifndef INCLUDE_ROCKSDB_PERF_LEVEL_H_ #define INCLUDE_ROCKSDB_PERF_LEVEL_H_ #include <stdint.h> #include <string> namespace rocksdb { // How much perf stats to collect. Affects perf_context and iostats_context. enum PerfLevel { kDisable = 0, // disable perf stats kEnableCount = 1, // enable only count stats kEnableTimeExceptForMutex = 2, // Other than count stats, also enable time // stats except for mutexes kEnableTime = 3 // enable count and time stats }; // set the perf stats level for current thread void SetPerfLevel(PerfLevel level); // get current perf stats level for current thread PerfLevel GetPerfLevel(); } // namespace rocksdb #endif // INCLUDE_ROCKSDB_PERF_LEVEL_H_
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. #ifndef INCLUDE_ROCKSDB_PERF_LEVEL_H_ #define INCLUDE_ROCKSDB_PERF_LEVEL_H_ #include <stdint.h> #include <string> namespace rocksdb { // How much perf stats to collect. Affects perf_context and iostats_context. enum PerfLevel : char { kUninitialized = -1, // unknown setting kDisable = 0, // disable perf stats kEnableCount = 1, // enable only count stats kEnableTimeExceptForMutex = 2, // Other than count stats, also enable time // stats except for mutexes kEnableTime = 3, // enable count and time stats kOutOfBounds = 4 // N.B. Must always be the last value! }; // set the perf stats level for current thread void SetPerfLevel(PerfLevel level); // get current perf stats level for current thread PerfLevel GetPerfLevel(); } // namespace rocksdb #endif // INCLUDE_ROCKSDB_PERF_LEVEL_H_
Add low and upper bound values for rocksdb::PerfLevel enum
Add low and upper bound values for rocksdb::PerfLevel enum Summary: Add under and over limits for rocksdb::PerfLevel enum to allow us to do boundary checks before casting ints or unints to this enum. Test Plan: make all check -j32 Reviewers: sdong Reviewed By: sdong Subscribers: andrewkr, dhruba, leveldb Differential Revision: https://reviews.facebook.net/D58521
C
bsd-3-clause
wenduo/rocksdb,facebook/rocksdb,hobinyoon/rocksdb,hobinyoon/rocksdb,hobinyoon/rocksdb,SunguckLee/RocksDB,norton/rocksdb,wat-ze-hex/rocksdb,norton/rocksdb,wat-ze-hex/rocksdb,norton/rocksdb,SunguckLee/RocksDB,vmx/rocksdb,wenduo/rocksdb,SunguckLee/RocksDB,wat-ze-hex/rocksdb,ryneli/rocksdb,hobinyoon/rocksdb,bbiao/rocksdb,Andymic/rocksdb,jalexanderqed/rocksdb,ryneli/rocksdb,tsheasha/rocksdb,vmx/rocksdb,ryneli/rocksdb,wat-ze-hex/rocksdb,tsheasha/rocksdb,facebook/rocksdb,jalexanderqed/rocksdb,facebook/rocksdb,ryneli/rocksdb,norton/rocksdb,Andymic/rocksdb,OverlordQ/rocksdb,OverlordQ/rocksdb,OverlordQ/rocksdb,wenduo/rocksdb,Andymic/rocksdb,Andymic/rocksdb,vmx/rocksdb,hobinyoon/rocksdb,ryneli/rocksdb,tsheasha/rocksdb,hobinyoon/rocksdb,ryneli/rocksdb,bbiao/rocksdb,jalexanderqed/rocksdb,SunguckLee/RocksDB,bbiao/rocksdb,OverlordQ/rocksdb,bbiao/rocksdb,Andymic/rocksdb,Andymic/rocksdb,OverlordQ/rocksdb,tsheasha/rocksdb,facebook/rocksdb,wat-ze-hex/rocksdb,norton/rocksdb,SunguckLee/RocksDB,hobinyoon/rocksdb,tsheasha/rocksdb,OverlordQ/rocksdb,bbiao/rocksdb,vmx/rocksdb,SunguckLee/RocksDB,jalexanderqed/rocksdb,vmx/rocksdb,vmx/rocksdb,tsheasha/rocksdb,bbiao/rocksdb,OverlordQ/rocksdb,Andymic/rocksdb,facebook/rocksdb,wenduo/rocksdb,tsheasha/rocksdb,wenduo/rocksdb,bbiao/rocksdb,facebook/rocksdb,wenduo/rocksdb,facebook/rocksdb,norton/rocksdb,vmx/rocksdb,ryneli/rocksdb,jalexanderqed/rocksdb,SunguckLee/RocksDB,norton/rocksdb,wenduo/rocksdb,wenduo/rocksdb,facebook/rocksdb,wat-ze-hex/rocksdb,vmx/rocksdb,SunguckLee/RocksDB,bbiao/rocksdb,wat-ze-hex/rocksdb,norton/rocksdb,hobinyoon/rocksdb,jalexanderqed/rocksdb,wat-ze-hex/rocksdb,Andymic/rocksdb,jalexanderqed/rocksdb,tsheasha/rocksdb
eb7a693e0f6de7f3baf55f4fc3a744d6b2863c26
include/encode/SkWebpEncoder.h
include/encode/SkWebpEncoder.h
/* * Copyright 2017 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkWebpEncoder_DEFINED #define SkWebpEncoder_DEFINED #include "SkEncoder.h" class SkWStream; namespace SK_API SkWebpEncoder { struct Options { /** * |fQuality| must be in [0.0f, 100.0f] where 0.0f corresponds to the lowest quality. */ float fQuality = 100.0f; /** * If the input is premultiplied, this controls the unpremultiplication behavior. * The encoder can convert to linear before unpremultiplying or ignore the transfer * function and unpremultiply the input as is. */ SkTransferFunctionBehavior fUnpremulBehavior = SkTransferFunctionBehavior::kRespect; }; /** * Encode the |src| pixels to the |dst| stream. * |options| may be used to control the encoding behavior. * * Returns true on success. Returns false on an invalid or unsupported |src|. */ bool Encode(SkWStream* dst, const SkPixmap& src, const Options& options); }; #endif
/* * Copyright 2017 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkWebpEncoder_DEFINED #define SkWebpEncoder_DEFINED #include "SkEncoder.h" class SkWStream; namespace SkWebpEncoder { struct SK_API Options { /** * |fQuality| must be in [0.0f, 100.0f] where 0.0f corresponds to the lowest quality. */ float fQuality = 100.0f; /** * If the input is premultiplied, this controls the unpremultiplication behavior. * The encoder can convert to linear before unpremultiplying or ignore the transfer * function and unpremultiply the input as is. */ SkTransferFunctionBehavior fUnpremulBehavior = SkTransferFunctionBehavior::kRespect; }; /** * Encode the |src| pixels to the |dst| stream. * |options| may be used to control the encoding behavior. * * Returns true on success. Returns false on an invalid or unsupported |src|. */ SK_API bool Encode(SkWStream* dst, const SkPixmap& src, const Options& options); }; #endif
Move SK_API from namespace to function
Move SK_API from namespace to function Bug: skia: Change-Id: Ib538b77c28e323bbcc40634b0f3cd87d88d898e8 Reviewed-on: https://skia-review.googlesource.com/16496 Reviewed-by: Mike Reed <[email protected]> Reviewed-by: Matt Sarett <[email protected]> Commit-Queue: Matt Sarett <[email protected]>
C
bsd-3-clause
google/skia,HalCanary/skia-hc,HalCanary/skia-hc,HalCanary/skia-hc,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,HalCanary/skia-hc,rubenvb/skia,HalCanary/skia-hc,google/skia,HalCanary/skia-hc,google/skia,HalCanary/skia-hc,google/skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,rubenvb/skia,google/skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,rubenvb/skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,google/skia,rubenvb/skia,aosp-mirror/platform_external_skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,rubenvb/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia
b020472a9ad91dd6a7d950aeeb49af36170cd334
src/tests/marquise_util_test.c
src/tests/marquise_util_test.c
#include <glib.h> #include <stdlib.h> #include <stdint.h> #include <string.h> #include "../marquise.h" extern uint8_t valid_namespace(char *namespace); extern char* build_spool_path(const char *spool_prefix, char *namespace); void test_valid_namespace() { int ret = valid_namespace("abcdefghijklmn12345"); g_assert_cmpint(ret, ==, 1); } void test_invalid_namespace() { int ret = valid_namespace("a_b"); g_assert_cmpint(ret, ==, 0); } int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); g_test_add_func("/valid_namespace/valid", test_valid_namespace); g_test_add_func("/valid_namespace/invalid", test_invalid_namespace); return g_test_run(); }
#include <glib.h> #include <stdlib.h> #include <stdint.h> #include <string.h> #include "../marquise.h" extern uint8_t valid_namespace(char *namespace); extern char* build_spool_path(const char *spool_prefix, char *namespace); void test_valid_namespace() { int ret = valid_namespace("abcdefghijklmn12345"); g_assert_cmpint(ret, ==, 1); } void test_invalid_namespace() { int ret = valid_namespace("a_b"); g_assert_cmpint(ret, ==, 0); } void test_build_spool_path() { char *spool_path = build_spool_path("/tmp", "marquisetest"); char *expected_path = "/tmp/marquisetest/"; size_t expected_len = strlen(expected_path); int i; for (i=0; i < expected_len; i++) { if (expected_path[i] != spool_path[i]) { printf("Got path %s, expected path with prefix %s\n", spool_path, expected_path); g_test_fail(); } } } int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); g_test_add_func("/valid_namespace/valid", test_valid_namespace); g_test_add_func("/valid_namespace/invalid", test_invalid_namespace); g_test_add_func("/build_spool_path/path", test_build_spool_path); return g_test_run(); }
Add test for spool path construction
Add test for spool path construction Signed-off-by: Sharif Olorin <[email protected]>
C
bsd-3-clause
anchor/libmarquise,anchor/libmarquise
41f5a8559f2909ca28cffaa73eb138d6811a598c
elixir/src/main.c
elixir/src/main.c
// Regular C libs #include <stdio.h> // Elixir libs -- clang doesn't know where the hell this is #include "erl_nif.h" static ERL_NIF_TERM hello(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) { }
// Regular C libs #include <stdio.h> // Elixir libs -- clang doesn't know where the hell this is #include "erl_nif.h" // Needs to figure out what ERL_NIF_TERM means static ERL_NIF_TERM hello(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) { } static ErlNifFuncs funcs[] = { {"hello", 2, hello} }; ERL_NIF_INIT(Elixir.Hello, funcs, &hello)
Add basic setup for Elixir binding
Add basic setup for Elixir binding
C
unlicense
bentranter/binding,bentranter/binding,bentranter/binding
943c83c4943e375b18858c770378b2a74cadf74e
doc/doxy_examples.c
doc/doxy_examples.c
/** \defgroup mpg123_examples example programs using libmpg123 @{ */ /** \file mpg123_to_wav.c A simple MPEG audio to WAV converter using libmpg123 (read) and libsndfile (write). ...an excersize on two simple APIs. */ /** \file mpglib.c Example program mimicking the old mpglib test program. It takes an MPEG bitstream from standard input and writes raw audio to standard output. This is an use case of the mpg123_decode() in and out function in the feeder mode, quite close to classic mpglib usage and thus a template to convert from that to libmpg123. */ /** \file scan.c Example program that examines the exact length of an MPEG file. It opens a list of files and does mpg123_scan() on each and reporting the mpg123_length() before and after that. */ /** \file id3dump.c Parse ID3 info and print to standard output. */ /* @} */
/** \defgroup mpg123_examples example programs using libmpg123 @{ */ /** \file mpg123_to_wav.c A simple MPEG audio to WAV converter using libmpg123 (read) and libsndfile (write). ...an excersize on two simple APIs. */ /** \file mpglib.c Example program mimicking the old mpglib test program. It takes an MPEG bitstream from standard input and writes raw audio to standard output. This is an use case of the mpg123_decode() in and out function in the feeder mode, quite close to classic mpglib usage and thus a template to convert from that to libmpg123. */ /** \file scan.c Example program that examines the exact length of an MPEG file. It opens a list of files and does mpg123_scan() on each and reporting the mpg123_length() before and after that. */ /** \file id3dump.c Parse ID3 info and print to standard output. */ /** \file feedseek.c Fuzzy feeder seeking. */ /* @} */
Add feedseek example to API docs.
Add feedseek example to API docs. git-svn-id: 793bb72743a407948e3701719c462b6a765bc435@2963 35dc7657-300d-0410-a2e5-dc2837fedb53
C
lgpl-2.1
Distrotech/mpg123,Distrotech/mpg123,Distrotech/mpg123,Distrotech/mpg123,Distrotech/mpg123,Distrotech/mpg123,Distrotech/mpg123
f6db8b91f5cfb6203727754f5e1cf2a666a1cdba
BoxContentSDK/BoxContentSDK/QueueManagers/BOXAPIAccessTokenDelegate.h
BoxContentSDK/BoxContentSDK/QueueManagers/BOXAPIAccessTokenDelegate.h
// // BOXAPIAccessTokenDelegate.h // BoxContentSDK // // Created by Andrew Chun on 6/6/15. // Copyright (c) 2015 Box. All rights reserved. // /** * App Users are full-featured enterprise Box accounts that belong to your application not a Box user. Unlike typical Box accounts, * these accounts do not have an associated login and can only be accessed through the Content API by the controlling application * and associated Box User ID. This new user model allows your application to take advantage of groups, permissions, collaborations, * comments, tasks, and the many other features offered by the Box platform. * * For more information the documentation is linked below. * https://developers.box.com/developer-edition/#app_users * * BOXAPIAccessTokenDelegate allows developers to make network calls to their own servers to retrieve an access token * outside of the normal means of authentication (OAuth2). * * BOXAPIAccessTokenDelegate is a protocol that should only be conformed to if App Users is being used. */ @protocol BOXAPIAccessTokenDelegate <NSObject> /** * The method is meant to be used to make network requests to acquire access tokens and access token expiration dates. */ - (void)fetchAccessTokenWithCompletion:(void (^)(NSString *accessToken, NSDate *accessTokenExpiration, NSError *error))completion; @end
// // BOXAPIAccessTokenDelegate.h // BoxContentSDK // // Created by Andrew Chun on 6/6/15. // Copyright (c) 2015 Box. All rights reserved. // /** * App Users are full-featured enterprise Box accounts that belong to your application not a Box user. Unlike typical Box accounts, * these accounts do not have an associated login and can only be accessed through the Content API by the controlling application * and associated Box User ID. This new user model allows your application to take advantage of groups, permissions, collaborations, * comments, tasks, and the many other features offered by the Box platform. * * For more information the documentation is linked below. * https://developer.box.com/docs/app-users and https://developer.box.com/docs/service-account * * BOXAPIAccessTokenDelegate allows developers to make network calls to their own servers to retrieve an access token * outside of the normal means of authentication (OAuth2). * * BOXAPIAccessTokenDelegate is a protocol that should only be conformed to if App Users is being used. */ @protocol BOXAPIAccessTokenDelegate <NSObject> /** * The method is meant to be used to make network requests to acquire access tokens and access token expiration dates. */ - (void)fetchAccessTokenWithCompletion:(void (^)(NSString *accessToken, NSDate *accessTokenExpiration, NSError *error))completion; @end
Update the App Users documentation links
Update the App Users documentation links
C
apache-2.0
box/box-ios-sdk,box/box-ios-sdk,box/box-ios-sdk
41cdace7b9f4caf0e21119996ca2d8696c6abae0
mud/home/Http/lib/form/thing.c
mud/home/Http/lib/form/thing.c
inherit "/lib/string/sprint"; inherit "../support"; static string thing_form(object obj) { string buffer; buffer = "<h1>Object form</h1>\n"; buffer += "<form action=\"object.lpc?obj=" + object2string(obj) + "\" method=\"post\">\n"; buffer += "<p>Mass: <input type=\"text\" name=\"mass\" value=\"" + mixed_sprint(obj->query_mass()) + "\"/></p><br />\n"; buffer += "<input type=\"submit\" value=\"change mass\" />\n"; buffer += "</form>\n"; return buffer; }
inherit "/lib/string/sprint"; inherit "../support"; static string thing_form(object obj) { string buffer; buffer = "<h1>Object form</h1>\n"; buffer += "<form action=\"object.lpc?obj=" + object2string(obj) + "\" method=\"post\">\n"; buffer += "Mass: <input type=\"text\" name=\"mass\" value=\"" + mixed_sprint(obj->query_mass()) + "\"/>\n"; buffer += "<input type=\"submit\" value=\"change mass\" />\n"; buffer += "</form>\n"; buffer += "<form action=\"object.lpc?obj=" + object2string(obj) + "\" method=\"post\">\n"; buffer += "Local mass: <input type=\"text\" name=\"localmass\" value=\"" + mixed_sprint(obj->query_local_mass()) + "\"/>\n"; buffer += "<input type=\"submit\" value=\"change local mass\" />\n"; buffer += "</form>\n"; return buffer; }
Allow local mass and mass to be set separately by form
Allow local mass and mass to be set separately by form
C
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
77645b99f438be1a0906126be8052ad36761b1cd
src/include/port/bsdi.h
src/include/port/bsdi.h
#if defined(__i386__) #define NEED_I386_TAS_ASM #endif #if defined(__sparc__) #define NEED_SPARC_TAS_ASM #endif #define HAS_TEST_AND_SET typedef unsigned char slock_t;
#if defined(__i386__) #define NEED_I386_TAS_ASM #endif #if defined(__sparc__) #define NEED_SPARC_TAS_ASM #endif #define HAS_TEST_AND_SET typedef unsigned char slock_t; /* This is marked as obsoleted in BSD/OS 4.3. */ #ifndef EAI_ADDRFAMILY #define EAI_ADDRFAMILY 1 #endif
Add define for missing EAI_ADDRFAMILY in BSD/OS 4.3.
Add define for missing EAI_ADDRFAMILY in BSD/OS 4.3.
C
agpl-3.0
tpostgres-projects/tPostgres,yuanzhao/gpdb,chrishajas/gpdb,ahachete/gpdb,Postgres-XL/Postgres-XL,rubikloud/gpdb,lpetrov-pivotal/gpdb,yuanzhao/gpdb,greenplum-db/gpdb,foyzur/gpdb,atris/gpdb,greenplum-db/gpdb,yuanzhao/gpdb,postmind-net/postgres-xl,50wu/gpdb,rvs/gpdb,cjcjameson/gpdb,kaknikhil/gpdb,Chibin/gpdb,Quikling/gpdb,royc1/gpdb,janebeckman/gpdb,jmcatamney/gpdb,lisakowen/gpdb,ovr/postgres-xl,lisakowen/gpdb,lpetrov-pivotal/gpdb,jmcatamney/gpdb,ahachete/gpdb,tpostgres-projects/tPostgres,xinzweb/gpdb,jmcatamney/gpdb,zaksoup/gpdb,janebeckman/gpdb,lintzc/gpdb,0x0FFF/gpdb,oberstet/postgres-xl,edespino/gpdb,cjcjameson/gpdb,tangp3/gpdb,tpostgres-projects/tPostgres,tangp3/gpdb,xinzweb/gpdb,rvs/gpdb,atris/gpdb,chrishajas/gpdb,rvs/gpdb,atris/gpdb,ashwinstar/gpdb,kaknikhil/gpdb,lisakowen/gpdb,Postgres-XL/Postgres-XL,Chibin/gpdb,lisakowen/gpdb,edespino/gpdb,jmcatamney/gpdb,royc1/gpdb,xinzweb/gpdb,oberstet/postgres-xl,atris/gpdb,CraigHarris/gpdb,50wu/gpdb,kaknikhil/gpdb,yuanzhao/gpdb,xinzweb/gpdb,lintzc/gpdb,50wu/gpdb,lisakowen/gpdb,tangp3/gpdb,Chibin/gpdb,adam8157/gpdb,arcivanov/postgres-xl,kaknikhil/gpdb,yuanzhao/gpdb,Quikling/gpdb,techdragon/Postgres-XL,adam8157/gpdb,Chibin/gpdb,royc1/gpdb,tangp3/gpdb,ahachete/gpdb,adam8157/gpdb,zaksoup/gpdb,kmjungersen/PostgresXL,foyzur/gpdb,greenplum-db/gpdb,tangp3/gpdb,cjcjameson/gpdb,randomtask1155/gpdb,arcivanov/postgres-xl,edespino/gpdb,kaknikhil/gpdb,CraigHarris/gpdb,randomtask1155/gpdb,ovr/postgres-xl,chrishajas/gpdb,randomtask1155/gpdb,Chibin/gpdb,foyzur/gpdb,adam8157/gpdb,edespino/gpdb,cjcjameson/gpdb,adam8157/gpdb,zaksoup/gpdb,rvs/gpdb,Quikling/gpdb,ashwinstar/gpdb,arcivanov/postgres-xl,ashwinstar/gpdb,CraigHarris/gpdb,lisakowen/gpdb,CraigHarris/gpdb,0x0FFF/gpdb,kmjungersen/PostgresXL,arcivanov/postgres-xl,ashwinstar/gpdb,lpetrov-pivotal/gpdb,lpetrov-pivotal/gpdb,Quikling/gpdb,xuegang/gpdb,zeroae/postgres-xl,pavanvd/postgres-xl,ahachete/gpdb,ovr/postgres-xl,edespino/gpdb,atris/gpdb,zaksoup/gpdb,rvs/gpdb,postmind-net/postgres-xl,oberstet/postgres-xl,postmind-net/postgres-xl,lpetrov-pivotal/gpdb,adam8157/gpdb,randomtask1155/gpdb,50wu/gpdb,zeroae/postgres-xl,cjcjameson/gpdb,pavanvd/postgres-xl,zeroae/postgres-xl,foyzur/gpdb,zaksoup/gpdb,janebeckman/gpdb,kmjungersen/PostgresXL,techdragon/Postgres-XL,CraigHarris/gpdb,xinzweb/gpdb,zeroae/postgres-xl,chrishajas/gpdb,0x0FFF/gpdb,Postgres-XL/Postgres-XL,jmcatamney/gpdb,royc1/gpdb,0x0FFF/gpdb,snaga/postgres-xl,xuegang/gpdb,edespino/gpdb,ahachete/gpdb,lintzc/gpdb,yuanzhao/gpdb,edespino/gpdb,ovr/postgres-xl,ahachete/gpdb,xuegang/gpdb,tpostgres-projects/tPostgres,jmcatamney/gpdb,Quikling/gpdb,0x0FFF/gpdb,kmjungersen/PostgresXL,50wu/gpdb,kaknikhil/gpdb,rubikloud/gpdb,lintzc/gpdb,lpetrov-pivotal/gpdb,tangp3/gpdb,techdragon/Postgres-XL,lintzc/gpdb,rubikloud/gpdb,royc1/gpdb,lisakowen/gpdb,foyzur/gpdb,snaga/postgres-xl,techdragon/Postgres-XL,xinzweb/gpdb,lpetrov-pivotal/gpdb,rubikloud/gpdb,rvs/gpdb,Quikling/gpdb,ashwinstar/gpdb,lintzc/gpdb,chrishajas/gpdb,rvs/gpdb,Chibin/gpdb,rvs/gpdb,zaksoup/gpdb,cjcjameson/gpdb,yazun/postgres-xl,cjcjameson/gpdb,lpetrov-pivotal/gpdb,atris/gpdb,kaknikhil/gpdb,kaknikhil/gpdb,zaksoup/gpdb,0x0FFF/gpdb,chrishajas/gpdb,randomtask1155/gpdb,xuegang/gpdb,jmcatamney/gpdb,xuegang/gpdb,greenplum-db/gpdb,yazun/postgres-xl,tangp3/gpdb,50wu/gpdb,0x0FFF/gpdb,kmjungersen/PostgresXL,jmcatamney/gpdb,Chibin/gpdb,cjcjameson/gpdb,foyzur/gpdb,ahachete/gpdb,royc1/gpdb,cjcjameson/gpdb,atris/gpdb,janebeckman/gpdb,adam8157/gpdb,randomtask1155/gpdb,yuanzhao/gpdb,rubikloud/gpdb,Quikling/gpdb,Chibin/gpdb,xinzweb/gpdb,tpostgres-projects/tPostgres,yazun/postgres-xl,chrishajas/gpdb,edespino/gpdb,cjcjameson/gpdb,kaknikhil/gpdb,greenplum-db/gpdb,janebeckman/gpdb,yuanzhao/gpdb,oberstet/postgres-xl,zeroae/postgres-xl,arcivanov/postgres-xl,yazun/postgres-xl,rvs/gpdb,postmind-net/postgres-xl,janebeckman/gpdb,lisakowen/gpdb,snaga/postgres-xl,Quikling/gpdb,royc1/gpdb,50wu/gpdb,oberstet/postgres-xl,rubikloud/gpdb,snaga/postgres-xl,ashwinstar/gpdb,janebeckman/gpdb,lintzc/gpdb,edespino/gpdb,tangp3/gpdb,0x0FFF/gpdb,greenplum-db/gpdb,chrishajas/gpdb,CraigHarris/gpdb,CraigHarris/gpdb,janebeckman/gpdb,Postgres-XL/Postgres-XL,rvs/gpdb,Quikling/gpdb,xuegang/gpdb,snaga/postgres-xl,zaksoup/gpdb,yuanzhao/gpdb,yazun/postgres-xl,rubikloud/gpdb,CraigHarris/gpdb,kaknikhil/gpdb,pavanvd/postgres-xl,ashwinstar/gpdb,atris/gpdb,lintzc/gpdb,foyzur/gpdb,xinzweb/gpdb,royc1/gpdb,janebeckman/gpdb,pavanvd/postgres-xl,randomtask1155/gpdb,ahachete/gpdb,ovr/postgres-xl,xuegang/gpdb,xuegang/gpdb,edespino/gpdb,greenplum-db/gpdb,pavanvd/postgres-xl,Quikling/gpdb,ashwinstar/gpdb,Postgres-XL/Postgres-XL,foyzur/gpdb,xuegang/gpdb,postmind-net/postgres-xl,techdragon/Postgres-XL,greenplum-db/gpdb,yuanzhao/gpdb,randomtask1155/gpdb,Chibin/gpdb,janebeckman/gpdb,CraigHarris/gpdb,Chibin/gpdb,lintzc/gpdb,50wu/gpdb,rubikloud/gpdb,adam8157/gpdb,arcivanov/postgres-xl
4b32efb0f13060b1769d65a16a952b9b02b873a7
src/lib/mkdir-parents.c
src/lib/mkdir-parents.c
/* Copyright (c) 2003 Timo Sirainen */ #include "lib.h" #include "mkdir-parents.h" #include <sys/stat.h> int mkdir_parents(const char *path, mode_t mode) { const char *p; if (mkdir(path, mode) < 0 && errno != EEXIST) { if (errno != ENOENT) return -1; p = strrchr(path, '/'); if (p == NULL || p == path) return -1; /* shouldn't happen */ t_push(); if (mkdir_parents(t_strdup_until(path, p), mode) < 0) { t_pop(); return -1; } t_pop(); /* should work now */ if (mkdir(path, mode) < 0 && errno != EEXIST) return -1; } return 0; }
/* Copyright (c) 2003 Timo Sirainen */ #include "lib.h" #include "mkdir-parents.h" #include <sys/stat.h> int mkdir_parents(const char *path, mode_t mode) { const char *p; /* EISDIR check is for BSD/OS which returns it if path contains '/' at the end and it exists. */ if (mkdir(path, mode) < 0 && errno != EEXIST && errno != EISDIR) { if (errno != ENOENT) return -1; p = strrchr(path, '/'); if (p == NULL || p == path) return -1; /* shouldn't happen */ t_push(); if (mkdir_parents(t_strdup_until(path, p), mode) < 0) { t_pop(); return -1; } t_pop(); /* should work now */ if (mkdir(path, mode) < 0 && errno != EEXIST) return -1; } return 0; }
Check for EISDIR error as well. Fixed problems with BSD/OS.
Check for EISDIR error as well. Fixed problems with BSD/OS. --HG-- branch : HEAD
C
mit
dscho/dovecot,jwm/dovecot-notmuch,dscho/dovecot,jkerihuel/dovecot,jkerihuel/dovecot,jkerihuel/dovecot,jkerihuel/dovecot,dscho/dovecot,jkerihuel/dovecot,dscho/dovecot,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jwm/dovecot-notmuch,dscho/dovecot,jwm/dovecot-notmuch
c504a5c47a93476f4e28208bd8307e79e7340db0
JPetReaderInterface/JPetReaderInterface.h
JPetReaderInterface/JPetReaderInterface.h
/** * @copyright Copyright 2016 The J-PET Framework Authors. All rights reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may find a copy of the License in the LICENCE file. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @file JPetReaderInterface.h */ #ifndef JPETREADERINTERFACE_H #define JPETREADERINTERFACE_H #include <TNamed.h> // for Event typedef class JPetReaderInterface { public: typedef TObject MyEvent; virtual ~JPetReaderInterface() {;} virtual MyEvent& getCurrentEvent()=0; virtual bool nextEvent()=0; virtual bool firstEvent()=0; virtual bool lastEvent()=0; virtual bool nthEvent(int n)=0; virtual long long getCurrentEventNumber() const =0; virtual long long getNbOfAllEvents() const =0; virtual TObject* getObjectFromFile(const char* name)=0; virtual bool openFileAndLoadData(const char* filename, const char* treename)=0; virtual void closeFile()=0; }; #endif /* !JPETREADERINTERFACE_H */
/** * @copyright Copyright 2016 The J-PET Framework Authors. All rights reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may find a copy of the License in the LICENCE file. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @file JPetReaderInterface.h */ #ifndef JPETREADERINTERFACE_H #define JPETREADERINTERFACE_H #include <TNamed.h> // for Event typedef class JPetReaderInterface { public: typedef TObject MyEvent; virtual ~JPetReaderInterface() {;} virtual MyEvent& getCurrentEvent()=0; virtual bool nextEvent()=0; virtual bool firstEvent()=0; virtual bool lastEvent()=0; virtual bool nthEvent(long long int n)=0; virtual long long getCurrentEventNumber() const =0; virtual long long getNbOfAllEvents() const =0; virtual TObject* getObjectFromFile(const char* name)=0; virtual bool openFileAndLoadData(const char* filename, const char* treename)=0; virtual void closeFile()=0; }; #endif /* !JPETREADERINTERFACE_H */
Change int to long long
Change int to long long
C
apache-2.0
alexkernphysiker/j-pet-framework,alexkernphysiker/j-pet-framework,alexkernphysiker/j-pet-framework,alexkernphysiker/j-pet-framework,JPETTomography/j-pet-framework,JPETTomography/j-pet-framework,alexkernphysiker/j-pet-framework,JPETTomography/j-pet-framework
e192c702e056dd62480ac3a31fe44a4038d5cb0e
modules/template/src/hello.c
modules/template/src/hello.c
/* * Sample MPI "hello world" application in C * * J. Hursey * */ #include <stdio.h> #include "mpi.h" int main(int argc, char* argv[]) { int rank, size, len; char processor[MPI_MAX_PROCESSOR_NAME]; /* * Initialize the MPI library */ MPI_Init(&argc, &argv); /* * Get my 'rank' (unique ID) */ MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* * Get the size of the world (How many other 'processes' are there) */ MPI_Comm_size(MPI_COMM_WORLD, &size); /* * Get the processor name (usually the hostname) */ MPI_Get_processor_name(processor, &len); /* * Print a message from this process */ printf("Hello, world! I am %2d of %d on %s!\n", rank, size, processor); /* * Shutdown the MPI library before exiting */ MPI_Finalize(); return 0; }
/* * Sample MPI "hello world" application in C * * J. Hursey * */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include "mpi.h" int main(int argc, char* argv[]) { int rank, size, len; char processor[MPI_MAX_PROCESSOR_NAME]; char *name = NULL; /* * Initialize the MPI library */ MPI_Init(&argc, &argv); /* * Check to see if we have a command line argument for the name */ if( argc > 1 ) { name = strdup(argv[1]); } else { name = strdup("World"); } /* * Get my 'rank' (unique ID) */ MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* * Get the size of the world (How many other 'processes' are there) */ MPI_Comm_size(MPI_COMM_WORLD, &size); /* * Get the processor name (usually the hostname) */ MPI_Get_processor_name(processor, &len); /* * Print a message from this process */ printf("Hello, %s! I am %2d of %d on %s!\n", name, rank, size, processor); /* * Shutdown the MPI library before exiting */ MPI_Finalize(); /* * Cleanup */ if( NULL != name ) { free(name); name = NULL; } return 0; }
Add an optional command line parameter to demostrate a custom form field
Add an optional command line parameter to demostrate a custom form field
C
bsd-3-clause
OnRampOrg/onramp,OnRampOrg/onramp,ssfoley/onramp,koepked/onramp,koepked/onramp,koepked/onramp,koepked/onramp,koepked/onramp,ssfoley/onramp,OnRampOrg/onramp,OnRampOrg/onramp,koepked/onramp,ssfoley/onramp,OnRampOrg/onramp,OnRampOrg/onramp,ssfoley/onramp,OnRampOrg/onramp
90fd5ea47ef2c91bc908165a9acd946977155e86
include/flatcc/portable/pstdalign.h
include/flatcc/portable/pstdalign.h
#ifndef PSTDALIGN_H #define PSTDALIGN_H #ifndef __alignas_is_defined #ifndef __cplusplus #if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) /* C11 or newer */ #include <stdalign.h> #else #if defined(__GNUC__) || defined (__IBMC__) || defined(__clang__) #define _Alignas(t) __attribute__((__aligned__(t))) #define _Alignof(t) __alignof__(t) #elif defined(_MSC_VER) #define _Alignas(t) __declspec (align(t)) #define _Alignof(t) __alignof(t) #else #error please update pstdalign.h with support for current compiler #endif #define alignas _Alignas #define alignof _Alignof #define __alignas_is_defined 1 #define __alignof_is_defined 1 #endif /* __STDC_VERSION__ */ #endif /* __cplusplus */ #endif /* __alignas__is_defined */ #endif /* PSTDALIGN_H */
#ifndef PSTDALIGN_H #define PSTDALIGN_H #ifndef __alignas_is_defined #ifndef __cplusplus #if ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)) || defined(__IBMC__) #undef PORTABLE_C11_STDALIGN_MISSING #define PORTABLE_C11_STDALIGN_MISSING #endif #if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && \ !defined(PORTABLE_C11_STDALIGN_MISSING) /* C11 or newer */ #include <stdalign.h> #else #if defined(__GNUC__) || defined (__IBMC__) || defined(__clang__) #define _Alignas(t) __attribute__((__aligned__(t))) #define _Alignof(t) __alignof__(t) #elif defined(_MSC_VER) #define _Alignas(t) __declspec (align(t)) #define _Alignof(t) __alignof(t) #define alignas _Alignas #define alignof _Alignof #define __alignas_is_defined 1 #define __alignof_is_defined 1 #else #error please update pstdalign.h with support for current compiler #endif #endif /* __STDC__ */ #endif /* __cplusplus */ #endif /* __alignas__is_defined */ #endif /* PSTDALIGN_H */
Handle C11 compilers witout stdalign
Handle C11 compilers witout stdalign
C
apache-2.0
dvidelabs/flatcc,skhoroshavin/flatcc,skhoroshavin/flatcc,dvidelabs/flatcc,skhoroshavin/flatcc,dvidelabs/flatcc
9ebd09954a3b53fa5d87e8e3f1b1bb49c15b62e5
PolyMapGenerator/LineEquation.h
PolyMapGenerator/LineEquation.h
#ifndef LINE_EQUATION_H #define LINE_EQUATION_H #include "Vector2.h" class LineEquation { public: LineEquation(); LineEquation(Vector2 a, Vector2 b); LineEquation(Vector2 p, double m); ~LineEquation(); LineEquation(const LineEquation& e); LineEquation(LineEquation&& e); LineEquation& operator=(const LineEquation& e); LineEquation& operator=(LineEquation&& e); double operator()(const double x); void Move(const Vector2 v); Vector2 Intersection(LineEquation& e) const; bool IsHorizontal(); bool IsVertical(); double m; double b; bool vertical; }; #endif
#ifndef LINE_EQUATION_H #define LINE_EQUATION_H #include "Vector2.h" class LineEquation { public: LineEquation(); LineEquation(Vector2 p1, Vector2 p2); LineEquation(Vector2 p, double m); ~LineEquation(); LineEquation(const LineEquation& e); LineEquation(LineEquation&& e); LineEquation& operator=(const LineEquation& e); LineEquation& operator=(LineEquation&& e); double operator()(const double x); void Move(const Vector2 v); Vector2 Intersection(LineEquation& e) const; bool IsHorizontal(); bool IsVertical(); double m; double b; bool vertical; }; #endif
Modify parameter's name (name conflict)
Modify parameter's name (name conflict)
C
mit
utilForever/PolyMapGenerator
87239eaa106a3d4ada4f538b885d9372afa93c6c
include/GLState.h
include/GLState.h
// // Created by Asger Nyman Christiansen on 08/01/2017. // Copyright © 2017 Asger Nyman Christiansen. All rights reserved. // #pragma once namespace gle { class GLState { public: static void cull_back_faces(bool enable) { static bool currently_enabled = true; if(currently_enabled != enable) { if(enable) { glEnable(GL_CULL_FACE); glCullFace(GL_BACK); } else { glDisable(GL_CULL_FACE); } currently_enabled = enable; } } static void depth_test(bool enable) { static bool currently_enabled = false; if(currently_enabled != enable) { if(enable) { glEnable(GL_DEPTH_TEST); } else { glDisable(GL_DEPTH_TEST); } currently_enabled = enable; } } static void depth_write(bool enable) { static bool currently_enabled = true; if(currently_enabled != enable) { if(enable) { glDepthMask(GL_TRUE); } else { glDepthMask(GL_FALSE); } currently_enabled = enable; } } }; }
// // Created by Asger Nyman Christiansen on 08/01/2017. // Copyright © 2017 Asger Nyman Christiansen. All rights reserved. // #pragma once namespace gle { class GLState { public: static void cull_back_faces(bool enable) { static bool currently_enabled = false; if(currently_enabled != enable) { if(enable) { glEnable(GL_CULL_FACE); glCullFace(GL_BACK); } else { glDisable(GL_CULL_FACE); } currently_enabled = enable; } } static void depth_test(bool enable) { static bool currently_enabled = false; if(currently_enabled != enable) { if(enable) { glEnable(GL_DEPTH_TEST); } else { glDisable(GL_DEPTH_TEST); } currently_enabled = enable; } } static void depth_write(bool enable) { static bool currently_enabled = true; if(currently_enabled != enable) { if(enable) { glDepthMask(GL_TRUE); } else { glDepthMask(GL_FALSE); } currently_enabled = enable; } } }; }
Correct initialisation of cull back faces.
Bugfix: Correct initialisation of cull back faces.
C
mit
asny/GLEngine
7f34eeef5436765c791931b8a75fce002bf9e13a
src/app_mt/temp_profile.c
src/app_mt/temp_profile.c
#include "temp_profile.h" #include "sntp.h" float temp_profile_get_current_setpoint(const temp_profile_t* profile) { int i; uint32_t duration_into_profile = sntp_get_time() - profile->start_time; uint32_t step_begin = 0; float last_temp = profile->start_value.value; for (i = 0; i < profile->num_steps; ++i) { const temp_profile_step_t* step = &profile->steps[i]; uint32_t step_end = step_begin + step[i].duration; if (duration_into_profile >= step_begin && duration_into_profile < step_end) { if (step->type == STEP_HOLD) return step->value.value; else { return last_temp + ((last_temp - step->value.value) * (now - profile->start_time - step_begin) / step->duration); } } step_begin += step->duration; } return profile->steps[profile->num_steps-1].value.value; }
#include "temp_profile.h" #include "sntp.h" float temp_profile_get_current_setpoint(const temp_profile_t* profile) { int i; uint32_t duration_into_profile = sntp_get_time() - profile->start_time; uint32_t step_begin = 0; float last_temp = profile->start_value.value; for (i = 0; i < profile->num_steps; ++i) { const temp_profile_step_t* step = &profile->steps[i]; uint32_t step_end = step_begin + step[i].duration; if (duration_into_profile >= step_begin && duration_into_profile < step_end) { if (step->type == STEP_HOLD) return step->value.value; else { uint32_t duration_into_step = duration_into_profile - step_begin; return last_temp + ((last_temp - step->value.value) * duration_into_step / step->duration); } } step_begin += step->duration; } return profile->steps[profile->num_steps-1].value.value; }
Fix temp profile setpoint interpolation.
Fix temp profile setpoint interpolation.
C
mit
brewbit/model-t,brewbit/model-t,brewbit/model-t
ea731767b015872398bf555c4e5c813e2516d9a6
src/fclaw2d_include_all.h
src/fclaw2d_include_all.h
/* Copyright (c) 2012 Carsten Burstedde, Donna Calhoun All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef FCLAW2D_INCLUDE_ALL_H #define FCLAW2D_INCLUDE_ALL_H #include <fclaw_package.h> #include <fclaw2d_forestclaw.h> #include <fclaw2d_options.h> #include <fclaw2d_domain.h> #include <fclaw2d_diagnostics.h> #include <fclaw2d_convenience.h> #include <fclaw2d_global.h> #include <fclaw2d_vtable.h> #include <fclaw2d_map.h> #include <p4est_connectivity.h> #include <fclaw2d_map_query.h> #include <fclaw_math.h> #ifdef __cplusplus extern "C" { #if 0 } /* need this because indent is dumb */ #endif #endif /* This file is for convenience only and should only be used in applications ... */ #ifdef __cplusplus #if 0 { #endif } #endif #endif
Add big include file which can be used for applications
Add big include file which can be used for applications
C
bsd-2-clause
ForestClaw/forestclaw,ForestClaw/forestclaw,ForestClaw/forestclaw,ForestClaw/forestclaw,ForestClaw/forestclaw,ForestClaw/forestclaw
25b8cee970500b0b82324807ad058d55ce10be41
src/ios/ChromeBluetooth.h
src/ios/ChromeBluetooth.h
@interface ChromeBluetooth : CDVPlugin { } #pragma mark chrome.bluetoothLowEnergy interface // chrome.bluetooth and chrome.bluetoothLowEnergy uses same file because connect, and disconnect // a deivce requires the same instance of CBCentralManager that found the device. - (void)connect:(CDVInvokedUrlCommand*)command; - (void)disconnect:(CDVInvokedUrlCommand*)command; - (void)getService:(CDVInvokedUrlCommand*)command; - (void)getServices:(CDVInvokedUrlCommand*)command; - (void)getCharacteristic:(CDVInvokedUrlCommand*)command; - (void)getCharacteristics:(CDVInvokedUrlCommand*)command; - (void)getIncludedServices:(CDVInvokedUrlCommand*)command; - (void)getDescriptor:(CDVInvokedUrlCommand*)command; - (void)getDescriptors:(CDVInvokedUrlCommand*)command; - (void)readCharacteristicValue:(CDVInvokedUrlCommand*)command; - (void)writeCharacteristicValue:(CDVInvokedUrlCommand*)command; - (void)startCharacteristicNotifications:(CDVInvokedUrlCommand*)command; - (void)stopCharacteristicNotifications:(CDVInvokedUrlCommand*)command; - (void)readDescriptorValue:(CDVInvokedUrlCommand*)command; - (void)writeDescriptorValue:(CDVInvokedUrlCommand*)command; - (void)registerBluetoothLowEnergyEvents:(CDVInvokedUrlCommand*)command; @end
@interface ChromeBluetooth : CDVPlugin { } #pragma mark chrome.bluetoothLowEnergy interface // chrome.bluetooth and chrome.bluetoothLowEnergy uses same file because connect, and disconnect // a deivce requires the same instance of CBCentralManager that found the device. - (void)connect:(CDVInvokedUrlCommand*)command; - (void)disconnect:(CDVInvokedUrlCommand*)command; - (void)getService:(CDVInvokedUrlCommand*)command; - (void)getServices:(CDVInvokedUrlCommand*)command; - (void)getCharacteristic:(CDVInvokedUrlCommand*)command; - (void)getCharacteristics:(CDVInvokedUrlCommand*)command; - (void)getIncludedServices:(CDVInvokedUrlCommand*)command; - (void)getDescriptor:(CDVInvokedUrlCommand*)command; - (void)getDescriptors:(CDVInvokedUrlCommand*)command; - (void)readCharacteristicValue:(CDVInvokedUrlCommand*)command; - (void)writeCharacteristicValue:(CDVInvokedUrlCommand*)command; - (void)startCharacteristicNotifications:(CDVInvokedUrlCommand*)command; - (void)stopCharacteristicNotifications:(CDVInvokedUrlCommand*)command; - (void)readDescriptorValue:(CDVInvokedUrlCommand*)command; - (void)writeDescriptorValue:(CDVInvokedUrlCommand*)command; - (void)registerBluetoothLowEnergyEvents:(CDVInvokedUrlCommand*)command; @end
Fix up missing newlines at eof
Fix up missing newlines at eof
C
bsd-3-clause
pwnall/cordova-plugin-chrome-apps-bluetooth,MobileChromeApps/cordova-plugin-chrome-apps-bluetooth,pwnall/cordova-plugin-chrome-apps-bluetooth,MobileChromeApps/cordova-plugin-chrome-apps-bluetooth
bb50e22fd3ad82381dbf750a790b8380a1a1bba5
src/get_load.c
src/get_load.c
// vim:ts=8:expandtab #include "i3status.h" const char *get_load() { static char part[512]; /* Get load */ #ifdef LINUX slurp("/proc/loadavg", part, sizeof(part)); *skip_character(part, ' ', 3) = '\0'; #else /* TODO: correctly check for NetBSD, check if it works the same on *BSD */ struct loadavg load; size_t length = sizeof(struct loadavg); int mib[2] = { CTL_VM, VM_LOADAVG }; if (sysctl(mib, 2, &load, &length, NULL, 0) < 0) die("Could not sysctl({ CTL_VM, VM_LOADAVG })\n"); double scale = load.fscale; (void)snprintf(part, sizeof(part), "%.02f %.02f %.02f", (double)load.ldavg[0] / scale, (double)load.ldavg[1] / scale, (double)load.ldavg[2] / scale); #endif return part; }
// vim:ts=8:expandtab #include "i3status.h" #include <err.h> #include <stdlib.h> #include <stdio.h> #include <string.h> const char *get_load() { static char part[512]; /* Get load */ #if defined(__FreeBSD__) || defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(sun) double loadavg[3]; if (getloadavg(loadavg, 3) == -1) errx(-1, "getloadavg() failed\n"); (void)snprintf(part, sizeof(part), "%1.2f %1.2f %1.2f", loadavg[0], loadavg[1], loadavg[2]); #else part[0] = '\0'; #endif return part; }
Use getloadavg() instead of using /proc, patch by Baptiste Daroussin
Use getloadavg() instead of using /proc, patch by Baptiste Daroussin
C
bsd-3-clause
mkroman/i3status,dj95/i3status,lexszero/i3status,DSMan195276/i3status,afh/i3status,opntr/i3status,Watcom/i3status,lastorset/i3status,Yuhta/i3status,opntr/i3status,rpetrano/i3status,JSmith-BitFlipper/i3status,Gravemind/i3status,puiterwijk/i3status,rpetrano/i3status,i3/i3status,stettberger/i3status,lexszero/i3status,lahwaacz/i3status,dj95/i3status,Dettorer/i3status,Gravemind/i3status,rpetrano/i3status,ixjlyons/i3status,puiterwijk/i3status,KarboniteKream/i3status,Gravemind/i3status,jasperla/i3status,puiterwijk/i3status,Watcom/i3status,ixjlyons/i3status,lbonn/i3status,lahwaacz/i3status,Detegr/i3status,mkroman/i3status,puiterwijk/i3status,Dettorer/i3status,i3/i3status,afh/i3status,glittershark/i3status,bsdjhb/i3status,DSMan195276/i3status,Gravemind/i3status,afh/i3status,KarboniteKream/i3status,jasperla/i3status,dj95/i3status,lastorset/i3status,i3/i3status,Detegr/i3status,glittershark/i3status,jasperla/i3status,ghedamat/i3status,peder2tm/i3status-netdev,rpetrano/i3status,bsdjhb/i3status,ghedamat/i3status,Airblader/i3status,lahwaacz/i3status,JSmith-BitFlipper/i3status,Yuhta/i3status,lbonn/i3status,lahwaacz/i3status,flammi/i3status,stettberger/i3status,peder2tm/i3status-netdev,opntr/i3status,KarboniteKream/i3status,DSMan195276/i3status,ixjlyons/i3status,mkroman/i3status,dj95/i3status,lbonn/i3status,Dettorer/i3status,Airblader/i3status,mkroman/i3status,Detegr/i3status,JSmith-BitFlipper/i3status,i3/i3status,ghedamat/i3status,Yuhta/i3status,flammi/i3status,glittershark/i3status,lbonn/i3status,Airblader/i3status,Yuhta/i3status,bsdjhb/i3status,flammi/i3status,Watcom/i3status,KarboniteKream/i3status,jasperla/i3status,ghedamat/i3status,lexszero/i3status,DSMan195276/i3status,peder2tm/i3status-netdev,peder2tm/i3status-netdev,glittershark/i3status,ixjlyons/i3status,JSmith-BitFlipper/i3status,lexszero/i3status,Dettorer/i3status,afh/i3status,Detegr/i3status,bsdjhb/i3status,Airblader/i3status,opntr/i3status,Watcom/i3status,flammi/i3status
7e8c622d155d03fa0bdf039b9d935a44092004a3
lib/zip_err_str.c
lib/zip_err_str.c
/* This file was generated automatically by ./make_zip_err_str.sh from ./zip.h; make changes there. */ #include "zipint.h" const char * const _zip_err_str[] = { "No error", "Multi-disk zip archives not supported", "Renaming temporary file failed", "Closing zip archive failed", "Seek error", "Read error", "Write error", "CRC error", "Containing zip archive was closed", "No such file", "File already exists", "Can't open file", "Failure to create temporary file", "Zlib error", "Malloc failure", "Entry has been changed", "Compression method not supported", "Premature EOF", "Invalid argument", "Not a zip archive", "Internal error", "Zip archive inconsistent", "Can't remove file", "Entry has been deleted", "Encryption method not supported", "Read-only archive", "No password provided", "Wrong password provided", }; const int _zip_nerr_str = sizeof(_zip_err_str)/sizeof(_zip_err_str[0]); #define N ZIP_ET_NONE #define S ZIP_ET_SYS #define Z ZIP_ET_ZLIB const int _zip_err_type[] = { N, N, S, S, S, S, S, N, N, N, N, S, S, Z, N, N, N, N, N, N, N, N, S, N, N, N, N, N, };
Add generated file so that hg HEAD can be used with cmake.
Add generated file so that hg HEAD can be used with cmake.
C
bsd-3-clause
det/libzip,det/libzip,det/libzip,det/libzip
3893e7e397b3932a3e6e604d2e7a82b260a1133e
libc/stdio/gets.c
libc/stdio/gets.c
/* Copyright (C) 2004 Manuel Novoa III <[email protected]> * * GNU Library General Public License (LGPL) version 2 or later. * * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details. */ #include "_stdio.h" link_warning(gets, "the 'gets' function is dangerous and should not be used.") /* UNSAFE FUNCTION -- do not bother optimizing */ libc_hidden_proto(getchar_unlocked) libc_hidden_proto(__fgetc_unlocked) libc_hidden_proto(__stdin) char *gets(char *s) { register char *p = s; int c; __STDIO_AUTO_THREADLOCK_VAR; __STDIO_AUTO_THREADLOCK(stdin); /* Note: don't worry about performance here... this shouldn't be used! * Therefore, force actual function call. */ while (((c = getchar_unlocked()) != EOF) && ((*p = c) != '\n')) { ++p; } if ((c == EOF) || (s == p)) { s = NULL; } else { *p = 0; } __STDIO_AUTO_THREADUNLOCK(stdin); return s; }
/* Copyright (C) 2004 Manuel Novoa III <[email protected]> * * GNU Library General Public License (LGPL) version 2 or later. * * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details. */ #include "_stdio.h" link_warning(gets, "the 'gets' function is dangerous and should not be used.") /* UNSAFE FUNCTION -- do not bother optimizing */ libc_hidden_proto(getchar_unlocked) libc_hidden_proto(__fgetc_unlocked) #ifdef __STDIO_GETC_MACRO libc_hidden_proto(__stdin) #else #define __stdin stdin #endif char *gets(char *s) { register char *p = s; int c; __STDIO_AUTO_THREADLOCK_VAR; __STDIO_AUTO_THREADLOCK(stdin); /* Note: don't worry about performance here... this shouldn't be used! * Therefore, force actual function call. */ while (((c = getchar_unlocked()) != EOF) && ((*p = c) != '\n')) { ++p; } if ((c == EOF) || (s == p)) { s = NULL; } else { *p = 0; } __STDIO_AUTO_THREADUNLOCK(stdin); return s; }
Build if GETC_MACRO use is disabled
Build if GETC_MACRO use is disabled
C
lgpl-2.1
ndmsystems/uClibc,wbx-github/uclibc-ng,klee/klee-uclibc,mephi42/uClibc,waweber/uclibc-clang,groundwater/uClibc,ddcc/klee-uclibc-0.9.33.2,foss-xtensa/uClibc,ysat0/uClibc,hwoarang/uClibc,klee/klee-uclibc,kraj/uClibc,gittup/uClibc,czankel/xtensa-uclibc,groundwater/uClibc,foss-xtensa/uClibc,groundwater/uClibc,skristiansson/uClibc-or1k,brgl/uclibc-ng,majek/uclibc-vx32,gittup/uClibc,OpenInkpot-archive/iplinux-uclibc,groundwater/uClibc,groundwater/uClibc,mephi42/uClibc,waweber/uclibc-clang,klee/klee-uclibc,atgreen/uClibc-moxie,hwoarang/uClibc,atgreen/uClibc-moxie,ysat0/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,hwoarang/uClibc,OpenInkpot-archive/iplinux-uclibc,mephi42/uClibc,czankel/xtensa-uclibc,skristiansson/uClibc-or1k,hjl-tools/uClibc,brgl/uclibc-ng,ffainelli/uClibc,atgreen/uClibc-moxie,ffainelli/uClibc,hwoarang/uClibc,czankel/xtensa-uclibc,ddcc/klee-uclibc-0.9.33.2,ffainelli/uClibc,gittup/uClibc,majek/uclibc-vx32,mephi42/uClibc,skristiansson/uClibc-or1k,m-labs/uclibc-lm32,ysat0/uClibc,m-labs/uclibc-lm32,foss-xtensa/uClibc,hjl-tools/uClibc,m-labs/uclibc-lm32,kraj/uclibc-ng,kraj/uclibc-ng,ndmsystems/uClibc,brgl/uclibc-ng,hjl-tools/uClibc,ffainelli/uClibc,kraj/uclibc-ng,OpenInkpot-archive/iplinux-uclibc,waweber/uclibc-clang,ChickenRunjyd/klee-uclibc,hjl-tools/uClibc,majek/uclibc-vx32,gittup/uClibc,ChickenRunjyd/klee-uclibc,ffainelli/uClibc,ndmsystems/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,wbx-github/uclibc-ng,ddcc/klee-uclibc-0.9.33.2,foss-xtensa/uClibc,klee/klee-uclibc,m-labs/uclibc-lm32,czankel/xtensa-uclibc,ChickenRunjyd/klee-uclibc,brgl/uclibc-ng,ysat0/uClibc,kraj/uClibc,atgreen/uClibc-moxie,wbx-github/uclibc-ng,ddcc/klee-uclibc-0.9.33.2,foss-for-synopsys-dwc-arc-processors/uClibc,kraj/uClibc,wbx-github/uclibc-ng,kraj/uclibc-ng,waweber/uclibc-clang,ChickenRunjyd/klee-uclibc,majek/uclibc-vx32,OpenInkpot-archive/iplinux-uclibc,ndmsystems/uClibc,kraj/uClibc,skristiansson/uClibc-or1k,hjl-tools/uClibc
5781c503d06f05637262564eafbb324adb39b344
SVNetworking/SVNetworking/SVNetworking.h
SVNetworking/SVNetworking/SVNetworking.h
// // SVNetworking.h // SVNetworking // // Created by Nate Stedman on 3/14/14. // Copyright (c) 2014 Svpply. All rights reserved. // #import <SVNetworking/NSObject+SVBindings.h> #import <SVNetworking/NSObject+SVMultibindings.h> #import <SVNetworking/SVDataRequest.h> #import <SVNetworking/SVDiskCache.h> #import <SVNetworking/SVFunctional.h> #import <SVNetworking/SVJSONRequest.h> #import <SVNetworking/SVRemoteImage.h> #import <SVNetworking/SVRemoteDataResource.h> #import <SVNetworking/SVRemoteJSONResource.h> #import <SVNetworking/SVRemoteResource.h> #import <SVNetworking/SVRequest.h>
// // SVNetworking.h // SVNetworking // // Created by Nate Stedman on 3/14/14. // Copyright (c) 2014 Svpply. All rights reserved. // #import <SVNetworking/NSObject+SVBindings.h> #import <SVNetworking/NSObject+SVMultibindings.h> #import <SVNetworking/SVDataRequest.h> #import <SVNetworking/SVDiskCache.h> #import <SVNetworking/SVFunctional.h> #import <SVNetworking/SVJSONRequest.h> #import <SVNetworking/SVRemoteImage.h> #import <SVNetworking/SVRemoteDataRequestResource.h> #import <SVNetworking/SVRemoteDataResource.h> #import <SVNetworking/SVRemoteJSONRequestResource.h> #import <SVNetworking/SVRemoteJSONResource.h> #import <SVNetworking/SVRemoteResource.h> #import <SVNetworking/SVRequest.h>
Add new resource classes to the header.
Add new resource classes to the header.
C
bsd-3-clause
eBay/SVNetworking,eBay/SVNetworking