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
a36438803b5ad4058fd7177d09c851f356e4e69a
include/stdlib.h
include/stdlib.h
#ifndef _FXCG_STDLIB_H #define _FXCG_STDLIB_H #ifdef __cplusplus extern "C" { #endif #include <stddef.h> long abs(long n); void free(void *p); void *malloc(size_t sz); void *realloc(void *p, size_t sz); int rand(void); void srand(unsigned seed); long strtol(const char *str, char **str_end, int base); void qsort(void *base, size_t nel, size_t width, int (*compar)(const void *, const void *)); void exit(int status); #ifdef __cplusplus } #endif #endif
#ifndef _FXCG_STDLIB_H #define _FXCG_STDLIB_H #ifdef __cplusplus extern "C" { #endif #include <stddef.h> long abs(long n); void free(void *p); void *malloc(size_t sz); void *realloc(void *p, size_t sz); int rand(void); void srand(unsigned seed); long strtol(const char *str, char **str_end, int base); #define atoi(s) ((int)strtol(s, NULL, 10)) #define atol(s) strtol(s, NULL, 10) void qsort(void *base, size_t nel, size_t width, int (*compar)(const void *, const void *)); void exit(int status); #ifdef __cplusplus } #endif #endif
Add definitions for atio and atol.
Add definitions for atio and atol.
C
bsd-3-clause
Forty-Bot/libfxcg,ComputerNerd/libfxcg-copyleft,ComputerNerd/libfxcg-copyleft,ComputerNerd/libfxcg-copyleft,Forty-Bot/libfxcg,Forty-Bot/libfxcg,Jonimoose/libfxcg,Forty-Bot/libfxcg,Jonimoose/libfxcg,ComputerNerd/libfxcg-copyleft,Jonimoose/libfxcg
15b5dd569501f0e4a66d7970238a1a87b0d9c4a7
src/file/dl_posix.c
src/file/dl_posix.c
#if HAVE_CONFIG_H #include "config.h" #endif #include "dl.h" #include "util/macro.h" #include "util/logging.h" #include <stdlib.h> #include <dlfcn.h> #include <string.h> // Note the dlopen takes just the name part. "aacs", internally we // translate to "libaacs.so" "libaacs.dylib" or "aacs.dll". void *dl_dlopen ( const char* name ) { char *path; int len; void *result; #ifdef __APPLE__ len = strlen(name) + 3 + 6 + 1; path = (char *) malloc(len); if (!path) return NULL; snprintf(path, len, "lib%s.dylib", name); #else len = strlen(name) + 3 + 3 + 1; path = (char *) malloc(len); if (!path) return NULL; snprintf(path, len, "lib%s.so", name); #endif DEBUG(DBG_BDPLUS, "searching for library '%s' ...\n", path); result = dlopen(path, RTLD_LAZY); if (!result) { DEBUG(DBG_FILE | DBG_CRIT, "can't open library '%s': %s\n", path, dlerror()); } free(path); return result; } void *dl_dlsym ( void* handle, const char* symbol ) { void *result = dlsym(handle, symbol); if (!result) { DEBUG(DBG_FILE | DBG_CRIT, "dlsym(%p, '%s') failed: %s\n", handle, symbol, dlerror()); } return result; } int dl_dlclose ( void* handle ) { return dlclose(handle); }
#if HAVE_CONFIG_H #include "config.h" #endif #include "dl.h" #include "util/macro.h" #include "util/logging.h" #include <stdlib.h> #include <dlfcn.h> #include <string.h> void *dl_dlopen ( const char* path ) { DEBUG(DBG_BDPLUS, "searching for library '%s' ...\n", path); void *result = dlopen(path, RTLD_LAZY); if (!result) { DEBUG(DBG_FILE | DBG_CRIT, "can't open library '%s': %s\n", path, dlerror()); } return result; } void *dl_dlsym ( void* handle, const char* symbol ) { void *result = dlsym(handle, symbol); if (!result) { DEBUG(DBG_FILE | DBG_CRIT, "dlsym(%p, '%s') failed: %s\n", handle, symbol, dlerror()); } return result; } int dl_dlclose ( void* handle ) { return dlclose(handle); }
Change dlopening of libs to call libraries with their major version on linux systems
Change dlopening of libs to call libraries with their major version on linux systems
C
lgpl-2.1
ShiftMediaProject/libaacs,zxlooong/libaacs,mwgoldsmith/aacs,ShiftMediaProject/libaacs,mwgoldsmith/aacs,zxlooong/libaacs,rraptorr/libaacs,rraptorr/libaacs
7a15de88ba3e92564b3b7bdf6ab6ea6fd246de44
include/platform/compiler/msvc.h
include/platform/compiler/msvc.h
#pragma once // Clobber previous definitions with extreme prejudice #ifdef UNUSED # undef UNUSED #endif #ifdef likely # undef likely #endif #ifdef unlikely # undef unlikely #endif #ifdef alignment # undef alignment #endif #define UNUSED __pragma(warning(disable:4100)) #define unlikely(x) (x) #define likely(x) (x) #define alignment(x) __declspec(align(x)) #if (_MSC_VER >= 1400) # define restrict __restrict #else # define restrict #endif #if (MSC_VER <= 1500) && !defined(cplusplus) # define inline __inline #endif #pragma warning(disable:4201 4214) #ifndef HAVE_STDINT_H # include "platform/os/stdint_msvc.h" #endif #if !defined(HAVE_STDBOOL_H) && !defined(cplusplus) # include <Windows.h> typedef BOOL bool; # define true TRUE # define false FALSE #endif
#pragma once // Clobber previous definitions with extreme prejudice #ifdef UNUSED # undef UNUSED #endif #ifdef likely # undef likely #endif #ifdef unlikely # undef unlikely #endif #ifdef alignment # undef alignment #endif #define unlikely(x) (x) #define likely(x) (x) #define alignment(x) __declspec(align(x)) #if (_MSC_VER >= 1300) # define UNUSED __pragma(warning(disable:4100)) #else # define UNUSED #endif #if (_MSC_VER >= 1400) # define restrict __restrict #else # define restrict #endif #if (MSC_VER <= 1500) && !defined(cplusplus) # define inline __inline #endif #pragma warning(disable:4201 4214) #ifndef HAVE_STDINT_H # include "platform/os/stdint_msvc.h" #endif #if !defined(HAVE_STDBOOL_H) && !defined(cplusplus) # include <Windows.h> typedef BOOL bool; # define true TRUE # define false FALSE #endif
Fix build on older MSVC.
Fix build on older MSVC.
C
bsd-3-clause
foxkit-us/supergameherm,supergameherm/supergameherm
f69f3b12f10e133e9552d15291c1c9c236aed6b8
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 * 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
#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
Fix spacing in parameter for readability
Fix spacing in parameter for readability
C
mit
MaxLikelihood/CADT
4981c2107f53231c8a76b6b6ae8ebef10eaea32a
src/Numerics/Optimizers/AmoebaOptimizer/ExampleCostFunction.h
src/Numerics/Optimizers/AmoebaOptimizer/ExampleCostFunction.h
// // Created by Mathew Seng on 2019-06-03. // #ifndef ExampleCostFunction_h #define ExampleCostFunction_h #include "itkSingleValuedCostFunction.h" namespace itk { class ExampleCostFunction2 : public SingleValuedCostFunction { public: /** Standard class typedefs. */ typedef ExampleCostFunction2 Self; typedef SingleValuedCostFunction Superclass; typedef SmartPointer<Self> Pointer; typedef SmartPointer<const Self> ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(ExampleCostFunction2, SingleValuedCostfunction); unsigned int GetNumberOfParameters(void) const override { return 2; } // itk::CostFunction MeasureType GetValue(const ParametersType & parameters) const override { return pow(parameters[0] + 5, 2) + pow(parameters[1] - 7, 2) + 5; } void GetDerivative(const ParametersType &, DerivativeType & /*derivative*/) const override { throw itk::ExceptionObject(__FILE__, __LINE__, "No derivative is available for this cost function."); } protected: ExampleCostFunction2() = default; ; ~ExampleCostFunction2() override = default; ; private: ExampleCostFunction2(const Self &) = delete; // purposely not implemented void operator=(const Self &) = delete; // purposely not implemented }; } // end namespace itk #endif
// // Created by Mathew Seng on 2019-06-03. // #ifndef ExampleCostFunction_h #define ExampleCostFunction_h #include "itkSingleValuedCostFunction.h" namespace itk { class ExampleCostFunction2 : public SingleValuedCostFunction { public: /** Standard class typedefs. */ typedef ExampleCostFunction2 Self; typedef SingleValuedCostFunction Superclass; typedef SmartPointer<Self> Pointer; typedef SmartPointer<const Self> ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(ExampleCostFunction2, SingleValuedCostfunction); unsigned int GetNumberOfParameters() const override { return 2; } // itk::CostFunction MeasureType GetValue(const ParametersType & parameters) const override { return pow(parameters[0] + 5, 2) + pow(parameters[1] - 7, 2) + 5; } void GetDerivative(const ParametersType &, DerivativeType & /*derivative*/) const override { throw itk::ExceptionObject(__FILE__, __LINE__, "No derivative is available for this cost function."); } protected: ExampleCostFunction2() = default; ; ~ExampleCostFunction2() override = default; ; private: ExampleCostFunction2(const Self &) = delete; // purposely not implemented void operator=(const Self &) = delete; // purposely not implemented }; } // end namespace itk #endif
Remove redundant void argument lists
STYLE: Remove redundant void argument lists Find and remove redundant void argument lists.
C
apache-2.0
InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples
e80f1b331482c558a01f78b87704bc7c23b40639
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"); }
#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); }
Update file, Alura, Introdução a C, Aula 1
Update file, Alura, Introdução a C, Aula 1
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
646a3d3712809df66fa90bcd7ef21d3659a3e833
mudlib/mud/home/Test/initd.c
mudlib/mud/home/Test/initd.c
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2010, 2012, 2013, 2014 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kotaka/paths/system.h> inherit LIB_INITD; inherit UTILITY_COMPILE; static void create() { KERNELD->set_global_access("Test", 1); load_dir("obj", 1); load_dir("sys", 1); }
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2010, 2012, 2013, 2014 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kotaka/paths/system.h> inherit LIB_INITD; inherit UTILITY_COMPILE; static void create() { KERNELD->set_global_access("Test", 1); load_dir("obj", 1); load_dir("sys", 1); } void bomb(int quota) { if (quota) { quota--; clone_object("obj/bomb"); call_out("bomb", 0, quota); } }
Allow test subsystem to set off clone bombs
Allow test subsystem to set off clone bombs
C
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
42ee2e0938c7adec8da26ac544204d32f3af709b
include/fs/fs_interface.h
include/fs/fs_interface.h
/* * Copyright (c) 2016 Intel Corporation. * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_ #define ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_ #ifdef __cplusplus extern "C" { #endif #if defined(CONFIG_FILE_SYSTEM_LITTLEFS) #define MAX_FILE_NAME 256 #else /* FAT_FS */ #define MAX_FILE_NAME 12 /* Uses 8.3 SFN */ #endif struct fs_mount_t; /** * @brief File object representing an open file * * @param Pointer to FATFS file object structure * @param mp Pointer to mount point structure */ struct fs_file_t { void *filep; const struct fs_mount_t *mp; }; /** * @brief Directory object representing an open directory * * @param dirp Pointer to directory object structure * @param mp Pointer to mount point structure */ struct fs_dir_t { void *dirp; const struct fs_mount_t *mp; }; #ifdef __cplusplus } #endif #endif /* ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_ */
/* * Copyright (c) 2016 Intel Corporation. * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_ #define ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_ #ifdef __cplusplus extern "C" { #endif #if defined(CONFIG_FILE_SYSTEM_LITTLEFS) #define MAX_FILE_NAME 256 #elif defined(CONFIG_FAT_FILESYSTEM_ELM) #if defined(CONFIG_FS_FATFS_LFN) #define MAX_FILE_NAME CONFIG_FS_FATFS_MAX_LFN #else /* CONFIG_FS_FATFS_LFN */ #define MAX_FILE_NAME 12 /* Uses 8.3 SFN */ #endif /* CONFIG_FS_FATFS_LFN */ #else /* filesystem selection */ /* Use standard 8.3 when no filesystem is explicitly selected */ #define MAX_FILE_NAME 12 #endif /* filesystem selection */ struct fs_mount_t; /** * @brief File object representing an open file * * @param Pointer to FATFS file object structure * @param mp Pointer to mount point structure */ struct fs_file_t { void *filep; const struct fs_mount_t *mp; }; /** * @brief Directory object representing an open directory * * @param dirp Pointer to directory object structure * @param mp Pointer to mount point structure */ struct fs_dir_t { void *dirp; const struct fs_mount_t *mp; }; #ifdef __cplusplus } #endif #endif /* ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_ */
Set MAX_FILE_NAME appropiately with LFN and FATFS
fs: Set MAX_FILE_NAME appropiately with LFN and FATFS Try to define MAX_FILE_NAME to the appropriate max length based on the selected filesystm. Otherwise fallback to a standard filename of 12 (made up of 8.3 : <filename>.<extension>) Signed-off-by: Roman Vaughan <[email protected]>
C
apache-2.0
galak/zephyr,Vudentz/zephyr,finikorg/zephyr,galak/zephyr,nashif/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,Vudentz/zephyr,finikorg/zephyr,Vudentz/zephyr,finikorg/zephyr,Vudentz/zephyr,nashif/zephyr,Vudentz/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,finikorg/zephyr,galak/zephyr,finikorg/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr
089c2d931b6b68dd82527430da51881d23bbd9a6
tests/t0403-lists.c
tests/t0403-lists.c
#include "test_lib.h" #include "test_helpers.h" #include "commit.h" #include <git/odb.h> #include <git/commit.h> BEGIN_TEST(list_sort_test) git_commit_list list; git_commit_node *n; int i, t; time_t previous_time; #define TEST_SORTED() \ previous_time = 0;\ for (n = list.head; n != NULL; n = n->next)\ {\ must_be_true(n->commit->commit_time >= previous_time);\ previous_time = n->commit->commit_time;\ } memset(&list, 0x0, sizeof(git_commit_list)); srand(time(NULL)); for (t = 0; t < 20; ++t) { const int test_size = rand() % 500 + 500; // Purely random sorting test for (i = 0; i < test_size; ++i) { git_commit *c = git__malloc(sizeof(git_commit)); c->commit_time = (time_t)rand(); git_commit_list_append(&list, c); } git_commit_list_sort(&list); TEST_SORTED(); git_commit_list_clear(&list, 1); } // Try to sort list with all dates equal. for (i = 0; i < 200; ++i) { git_commit *c = git__malloc(sizeof(git_commit)); c->commit_time = 0; git_commit_list_append(&list, c); } git_commit_list_sort(&list); TEST_SORTED(); git_commit_list_clear(&list, 1); // Try to sort empty list git_commit_list_sort(&list); TEST_SORTED(); END_TEST
Add unit tests for list sorting.
Add unit tests for list sorting. Signed-off-by: Vicent Marti <[email protected]> Signed-off-by: Andreas Ericsson <[email protected]>
C
lgpl-2.1
mingyaaaa/libgit2,falqas/libgit2,mhp/libgit2,magnus98/TEST,raybrad/libit2,JIghtuse/libgit2,yongthecoder/libgit2,ardumont/libgit2,amyvmiwei/libgit2,jamieleecool/ptest,maxiaoqian/libgit2,swisspol/DEMO-libgit2,skabel/manguse,jeffhostetler/public_libgit2,sim0629/libgit2,spraints/libgit2,sygool/libgit2,iankronquist/libgit2,sygool/libgit2,joshtriplett/libgit2,evhan/libgit2,ardumont/libgit2,claudelee/libgit2,yosefhackmon/libgit2,rcorre/libgit2,Tousiph/Demo1,MrHacky/libgit2,leoyanggit/libgit2,mrksrm/Mingijura,raybrad/libit2,jflesch/libgit2-mariadb,swisspol/DEMO-libgit2,leoyanggit/libgit2,stewid/libgit2,yosefhackmon/libgit2,mrksrm/Mingijura,nokiddin/libgit2,leoyanggit/libgit2,swisspol/DEMO-libgit2,joshtriplett/libgit2,saurabhsuniljain/libgit2,Tousiph/Demo1,Tousiph/Demo1,jamieleecool/ptest,nokiddin/libgit2,sygool/libgit2,whoisj/libgit2,rcorre/libgit2,swisspol/DEMO-libgit2,nacho/libgit2,spraints/libgit2,kissthink/libgit2,raybrad/libit2,Snazz2001/libgit2,mrksrm/Mingijura,amyvmiwei/libgit2,jflesch/libgit2-mariadb,oaastest/libgit2,skabel/manguse,Corillian/libgit2,swisspol/DEMO-libgit2,mrksrm/Mingijura,jeffhostetler/public_libgit2,stewid/libgit2,dleehr/libgit2,KTXSoftware/libgit2,evhan/libgit2,claudelee/libgit2,kenprice/libgit2,magnus98/TEST,yongthecoder/libgit2,mcanthony/libgit2,nacho/libgit2,nokiddin/libgit2,iankronquist/libgit2,linquize/libgit2,MrHacky/libgit2,raybrad/libit2,jeffhostetler/public_libgit2,linquize/libgit2,leoyanggit/libgit2,linquize/libgit2,chiayolin/libgit2,Corillian/libgit2,saurabhsuniljain/libgit2,Aorjoa/libgit2_maked_lib,maxiaoqian/libgit2,rcorre/libgit2,yongthecoder/libgit2,Aorjoa/libgit2_maked_lib,KTXSoftware/libgit2,amyvmiwei/libgit2,t0xicCode/libgit2,spraints/libgit2,dleehr/libgit2,chiayolin/libgit2,nokiddin/libgit2,since2014/libgit2,yosefhackmon/libgit2,MrHacky/libgit2,sim0629/libgit2,t0xicCode/libgit2,sygool/libgit2,skabel/manguse,claudelee/libgit2,kenprice/libgit2,skabel/manguse,evhan/libgit2,claudelee/libgit2,Corillian/libgit2,magnus98/TEST,maxiaoqian/libgit2,amyvmiwei/libgit2,Snazz2001/libgit2,Corillian/libgit2,yongthecoder/libgit2,mcanthony/libgit2,saurabhsuniljain/libgit2,jeffhostetler/public_libgit2,yosefhackmon/libgit2,iankronquist/libgit2,stewid/libgit2,since2014/libgit2,since2014/libgit2,swisspol/DEMO-libgit2,mingyaaaa/libgit2,magnus98/TEST,mhp/libgit2,t0xicCode/libgit2,nokiddin/libgit2,Tousiph/Demo1,zodiac/libgit2.js,KTXSoftware/libgit2,ardumont/libgit2,oaastest/libgit2,mhp/libgit2,maxiaoqian/libgit2,stewid/libgit2,stewid/libgit2,ardumont/libgit2,iankronquist/libgit2,sim0629/libgit2,MrHacky/libgit2,Snazz2001/libgit2,zodiac/libgit2.js,yosefhackmon/libgit2,dleehr/libgit2,mhp/libgit2,raybrad/libit2,whoisj/libgit2,chiayolin/libgit2,dleehr/libgit2,mhp/libgit2,mrksrm/Mingijura,mcanthony/libgit2,saurabhsuniljain/libgit2,JIghtuse/libgit2,nacho/libgit2,magnus98/TEST,stewid/libgit2,kissthink/libgit2,linquize/libgit2,iankronquist/libgit2,jeffhostetler/public_libgit2,joshtriplett/libgit2,JIghtuse/libgit2,nokiddin/libgit2,yosefhackmon/libgit2,whoisj/libgit2,saurabhsuniljain/libgit2,joshtriplett/libgit2,Aorjoa/libgit2_maked_lib,spraints/libgit2,iankronquist/libgit2,Aorjoa/libgit2_maked_lib,linquize/libgit2,kenprice/libgit2,claudelee/libgit2,skabel/manguse,jflesch/libgit2-mariadb,Tousiph/Demo1,skabel/manguse,JIghtuse/libgit2,falqas/libgit2,jeffhostetler/public_libgit2,linquize/libgit2,since2014/libgit2,evhan/libgit2,kissthink/libgit2,zodiac/libgit2.js,mhp/libgit2,dleehr/libgit2,mingyaaaa/libgit2,chiayolin/libgit2,kissthink/libgit2,JIghtuse/libgit2,kenprice/libgit2,spraints/libgit2,since2014/libgit2,jamieleecool/ptest,saurabhsuniljain/libgit2,kenprice/libgit2,zodiac/libgit2.js,whoisj/libgit2,amyvmiwei/libgit2,Snazz2001/libgit2,dleehr/libgit2,JIghtuse/libgit2,yongthecoder/libgit2,sim0629/libgit2,whoisj/libgit2,claudelee/libgit2,leoyanggit/libgit2,sim0629/libgit2,nacho/libgit2,mingyaaaa/libgit2,jamieleecool/ptest,mcanthony/libgit2,falqas/libgit2,joshtriplett/libgit2,mcanthony/libgit2,jflesch/libgit2-mariadb,falqas/libgit2,jflesch/libgit2-mariadb,KTXSoftware/libgit2,mrksrm/Mingijura,chiayolin/libgit2,MrHacky/libgit2,since2014/libgit2,mingyaaaa/libgit2,zodiac/libgit2.js,whoisj/libgit2,Snazz2001/libgit2,falqas/libgit2,oaastest/libgit2,jflesch/libgit2-mariadb,kissthink/libgit2,t0xicCode/libgit2,kissthink/libgit2,maxiaoqian/libgit2,mingyaaaa/libgit2,rcorre/libgit2,maxiaoqian/libgit2,kenprice/libgit2,Tousiph/Demo1,ardumont/libgit2,KTXSoftware/libgit2,Corillian/libgit2,sygool/libgit2,oaastest/libgit2,MrHacky/libgit2,yongthecoder/libgit2,sim0629/libgit2,amyvmiwei/libgit2,Aorjoa/libgit2_maked_lib,chiayolin/libgit2,Snazz2001/libgit2,mcanthony/libgit2,rcorre/libgit2,oaastest/libgit2,t0xicCode/libgit2,Corillian/libgit2,t0xicCode/libgit2,falqas/libgit2,leoyanggit/libgit2,oaastest/libgit2,rcorre/libgit2,ardumont/libgit2,magnus98/TEST,spraints/libgit2,KTXSoftware/libgit2,sygool/libgit2,joshtriplett/libgit2
cfa41a9669ff7675bf6c92d4cbdf7e142c98e4ab
subsys/ChTerrain.h
subsys/ChTerrain.h
// ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All right reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top level of the distribution and at // http://projectchrono.org/license-chrono.txt. // // ============================================================================= // Authors: Radu Serban // ============================================================================= // // Base class for a terrain subsystem. // // ============================================================================= #ifndef CH_TERRAIN_H #define CH_TERRAIN_H #include "core/ChShared.h" #include "subsys/ChApiSubsys.h" namespace chrono { class CH_SUBSYS_API ChTerrain : public ChShared { public: ChTerrain() {} virtual ~ChTerrain() {} virtual void Update(double time) {} virtual void Advance(double step) {} virtual double GetHeight(double x, double y) const = 0; }; } // end namespace chrono #endif
// ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All right reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top level of the distribution and at // http://projectchrono.org/license-chrono.txt. // // ============================================================================= // Authors: Radu Serban // ============================================================================= // // Base class for a terrain subsystem. // // ============================================================================= #ifndef CH_TERRAIN_H #define CH_TERRAIN_H #include "core/ChShared.h" #include "core/ChVector.h" #include "subsys/ChApiSubsys.h" namespace chrono { class CH_SUBSYS_API ChTerrain : public ChShared { public: ChTerrain() {} virtual ~ChTerrain() {} virtual void Update(double time) {} virtual void Advance(double step) {} virtual double GetHeight(double x, double y) const = 0; //// TODO: make this a pure virtual function... virtual ChVector<> GetNormal(double x, double y) const { return ChVector<>(0, 0, 1); } }; } // end namespace chrono #endif
Add normal information to terrain.
Add normal information to terrain.
C
bsd-3-clause
hsu/chrono-vehicle,hsu/chrono-vehicle,hsu/chrono-vehicle
d1bf4f823e8ed76801004d53a71d9f1257aeccd9
pymue/seen_table_wrapper.h
pymue/seen_table_wrapper.h
#ifndef PYMUE_SEEN_TABLE_WRAPPER #define PYMUE_SEEN_TABLE_WRAPPER #include <memory> #include "seen_table.h" namespace pymue { class Seen_table_wrapper { private: std::shared_ptr<mue::Seen_table> _seen_table; Seen_table_wrapper(mue::Seen_table&& seen_table) : _seen_table(new mue::Seen_table(std::move(seen_table))) { } public: Seen_table_wrapper(int num_teams) : _seen_table(new mue::Seen_table(num_teams)) { } Seen_table_wrapper clone() const { return Seen_table_wrapper(_seen_table->clone()); } int generation() const { return _seen_table->generation(); } bool seen(mue::Team_id a, mue::Team_id b, mue::Team_id c) const { return _seen_table->seen(a, b, c); } void add_meeting(mue::Team_id a, mue::Team_id b, mue::Team_id c) { _seen_table->add_meeting(a, b, c); } }; } #endif
Add a wrapper between Seen_table and pymue.SeenTable
Add a wrapper between Seen_table and pymue.SeenTable This is necessary because python-wrapped objects need a working copy onstructor but mue::Seen_table is not copy-constructable. The wrapper solves this problem by sharing one instance of the Table between all Copies. Signed-off-by: Jan Losinski <[email protected]>
C
bsd-3-clause
janLo/meet-and-eat-distribution-tool,eXma/meet-and-eat-distribution-tool,eXma/meet-and-eat-distribution-tool,eXma/meet-and-eat-distribution-tool,janLo/meet-and-eat-distribution-tool,janLo/meet-and-eat-distribution-tool
5b8870f2f915415859e794b27d0bfd8d5521cf01
include/jwtxx/jwt.h
include/jwtxx/jwt.h
#pragma once #include <string> #include <memory> #include <stdexcept> namespace JWTXX { enum class Algorithm { HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, none }; class Key { public: struct Error : std::runtime_error { Error(const std::string& message) : runtime_error(error) {} }; Key(Algorithm alg, const std::string& keyData); std::string sign(const void* data, size_t size) const; bool verify(const void* data, size_t size, const std::string& signature) const; struct Impl; private: std::unique_ptr<Impl> m_impl; }; class JWT { public: typedef std::unordered_map<std::string, std::string> Pairs; JWT(const std::string& token, Key key); JWT(Algorithm alg, Pairs claims, Pairs header = Pairs()); Algorithm alg() const { return m_alg; } const Pairs& claims() const { return m_claims; } const Pairs& header() const { return m_header; } std::string claim(const std::string& name) const; std::string token(const std::string& keyData) const; private: Algorithm m_alg; Pairs m_header; Pairs m_claims; }; }
#pragma once #include <string> #include <unordered_map> #include <memory> #include <stdexcept> namespace JWTXX { enum class Algorithm { HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, none }; class Key { public: struct Error : std::runtime_error { Error(const std::string& message) : runtime_error(message) {} }; Key(Algorithm alg, const std::string& keyData); std::string sign(const void* data, size_t size) const; bool verify(const void* data, size_t size, const std::string& signature) const; struct Impl; private: std::unique_ptr<Impl> m_impl; }; class JWT { public: typedef std::unordered_map<std::string, std::string> Pairs; JWT(const std::string& token, Key key); JWT(Algorithm alg, Pairs claims, Pairs header = Pairs()); Algorithm alg() const { return m_alg; } const Pairs& claims() const { return m_claims; } const Pairs& header() const { return m_header; } std::string claim(const std::string& name) const; std::string token(const std::string& keyData) const; private: Algorithm m_alg; Pairs m_header; Pairs m_claims; }; }
Add missing include, fix variable name.
Add missing include, fix variable name.
C
mit
RealImage/jwtxx,RealImage/jwtxx,madf/jwtxx,madf/jwtxx
d7d1fe663dfb6df05530b490fa4b2973bec77afc
test/small2/metabug3.c
test/small2/metabug3.c
#include "../small1/testharness.h" #include "../small1/testkinds.h" #ifndef ERROR #define __WILD #endif // NUMERRORS 1 typedef struct foo Foo; struct bar { Foo * __WILD next; }; struct foo { int *base; unsigned int length; struct bar link; }; int main() { struct foo s, *sptr = &s; if(HAS_KIND(sptr->base, WILD_KIND)) E(1); //ERROR(1):Error 1 }
Add a new testcase where a points-to or esafe edge is not being added properly
Add a new testcase where a points-to or esafe edge is not being added properly
C
bsd-3-clause
samuelhavron/obliv-c,samuelhavron/obliv-c,samuelhavron/obliv-c,samuelhavron/obliv-c
ceed4a562f9e38f383c80035e9a59a42bc3363dd
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
8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler
506b70663d252ee7a184356634d98789e25d747e
lib.h
lib.h
#define NULL ((void *)0) #define MIN(_a, _b) \ ({ \ __typeof__(_a) __a = (_a); \ __typeof__(_b) __b = (_b); \ __a <= __b ? __a : __b; \ }) #define MAX(_a, _b) \ ({ \ __typeof__(_a) __a = (_a); \ __typeof__(_b) __b = (_b); \ __a >= __b ? __a : __b; \ }) #define NELEM(x) (sizeof(x)/sizeof((x)[0])) #define cmpswap(ptr, old, new) __sync_bool_compare_and_swap(ptr, old, new) #define subfetch(ptr, val) __sync_sub_and_fetch(ptr, val) #define fetchadd(ptr, val) __sync_fetch_and_add(ptr, val) #define __offsetof offsetof
#ifndef NULL #define NULL ((void *)0) #endif #define MIN(_a, _b) \ ({ \ __typeof__(_a) __a = (_a); \ __typeof__(_b) __b = (_b); \ __a <= __b ? __a : __b; \ }) #define MAX(_a, _b) \ ({ \ __typeof__(_a) __a = (_a); \ __typeof__(_b) __b = (_b); \ __a >= __b ? __a : __b; \ }) #define NELEM(x) (sizeof(x)/sizeof((x)[0])) #define cmpswap(ptr, old, new) __sync_bool_compare_and_swap(ptr, old, new) #define subfetch(ptr, val) __sync_sub_and_fetch(ptr, val) #define fetchadd(ptr, val) __sync_fetch_and_add(ptr, val) #define __offsetof offsetof
Check ifndef NULL before define NULL, because clang stddef.h defines NULL
Check ifndef NULL before define NULL, because clang stddef.h defines NULL
C
mit
aclements/sv6,bowlofstew/sv6,bowlofstew/sv6,aclements/sv6,aclements/sv6,aclements/sv6,bowlofstew/sv6,bowlofstew/sv6,aclements/sv6,bowlofstew/sv6
22507075f4c60981ee33a27037b36fba153d6fac
lsip.c
lsip.c
#include <arpa/inet.h> #include <net/if.h> #include <netinet/in.h> #include <stdio.h> #include <stdlib.h> #include <sys/ioctl.h> #include <sys/socket.h> #include <sys/types.h> #include <unistd.h> #if INET_ADDRSTRLEN > INET6_ADDRSTRLEN #define BUF_LEN #INET_ADDRSTRLEN #else #define BUF_LEN INET6_ADDRSTRLEN #endif int main() { if (access("/proc/net", R_OK)) { goto errorout; } if (access("/proc/net/if_inet6", R_OK)) { goto errorout; } int ipv4_fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); if (ipv4_fd == -1) { goto errorout; } struct ifconf stuff; stuff.ifc_len = 0; stuff.ifc_buf = NULL; if (ioctl(ipv4_fd, SIOCGIFCONF, &stuff)) { goto errorout; } if (!(stuff.ifc_buf = malloc(stuff.ifc_len))) { goto errorout; } if (ioctl(ipv4_fd, SIOCGIFCONF, &stuff)) { goto errorout; } int i, len; char addr[BUF_LEN]; for (i = 0, len = stuff.ifc_len / sizeof(struct ifreq); i < len; ++i) { if (!strncmp(stuff.ifc_req[i].ifr_name, "lo", 2)) { continue; } struct sockaddr_in *sockaddr = (struct sockaddr_in*) &stuff.ifc_req[i].ifr_addr; printf("%s\t%s\n", inet_ntop(AF_INET, &sockaddr->sin_addr, addr, BUF_LEN), stuff.ifc_req[i].ifr_name); } return 0; errorout: perror("something went wrong"); exit(EXIT_FAILURE); }
Add initial code to list IPv4 addresses
Add initial code to list IPv4 addresses
C
mit
kamalmarhubi/lsaddr
c46c6a4191ef841fb9e5c852985cbaef31846329
scipy/fftpack/src/zfftnd.c
scipy/fftpack/src/zfftnd.c
/* Interface to various FFT libraries. Double complex FFT and IFFT, arbitrary dimensions. Author: Pearu Peterson, August 2002 */ #include "fftpack.h" /* The following macro convert private backend specific function to the public * functions exported by the module */ #define GEN_PUBLIC_API(name) \ void destroy_zfftnd_cache(void)\ {\ destroy_zfftnd_##name##_caches();\ }\ \ void zfftnd(complex_double * inout, int rank,\ int *dims, int direction, int howmany, int normalize)\ {\ zfftnd_##name(inout, rank, dims, direction, howmany, normalize);\ } #if defined(WITH_FFTW) || defined(WITH_MKL) static int equal_dims(int rank,int *dims1,int *dims2) { int i; for (i=0;i<rank;++i) if (dims1[i]!=dims2[i]) return 0; return 1; } #endif #ifdef WITH_FFTW3 #include "zfftnd_fftw3.c" GEN_PUBLIC_API(fftw3) #elif defined WITH_FFTW #include "zfftnd_fftw.c" GEN_PUBLIC_API(fftw) #elif defined WITH_MKL #include "zfftnd_mkl.c" GEN_PUBLIC_API(mkl) #else /* Use fftpack by default */ #include "zfftnd_fftpack.c" GEN_PUBLIC_API(fftpack) #endif
/* Interface to various FFT libraries. Double complex FFT and IFFT, arbitrary dimensions. Author: Pearu Peterson, August 2002 */ #include "fftpack.h" /* The following macro convert private backend specific function to the public * functions exported by the module */ #define GEN_PUBLIC_API(name) \ void destroy_zfftnd_cache(void)\ {\ destroy_zfftnd_##name##_caches();\ }\ \ void zfftnd(complex_double * inout, int rank,\ int *dims, int direction, int howmany, int normalize)\ {\ zfftnd_##name(inout, rank, dims, direction, howmany, normalize);\ } #include "zfftnd_fftpack.c" GEN_PUBLIC_API(fftpack)
Remove any non-fftpack code for complex, multi-dimension fft.
Remove any non-fftpack code for complex, multi-dimension fft.
C
bsd-3-clause
lhilt/scipy,zaxliu/scipy,behzadnouri/scipy,andyfaff/scipy,andim/scipy,newemailjdm/scipy,gef756/scipy,jor-/scipy,fernand/scipy,witcxc/scipy,Eric89GXL/scipy,behzadnouri/scipy,futurulus/scipy,gef756/scipy,gfyoung/scipy,ogrisel/scipy,mdhaber/scipy,maciejkula/scipy,bkendzior/scipy,ilayn/scipy,chatcannon/scipy,aarchiba/scipy,cpaulik/scipy,juliantaylor/scipy,pyramania/scipy,felipebetancur/scipy,jseabold/scipy,juliantaylor/scipy,Dapid/scipy,minhlongdo/scipy,haudren/scipy,petebachant/scipy,fernand/scipy,sargas/scipy,jsilter/scipy,minhlongdo/scipy,jor-/scipy,mingwpy/scipy,felipebetancur/scipy,maciejkula/scipy,vhaasteren/scipy,matthewalbani/scipy,mortonjt/scipy,niknow/scipy,pschella/scipy,vberaudi/scipy,felipebetancur/scipy,mortada/scipy,vanpact/scipy,zxsted/scipy,FRidh/scipy,aman-iitj/scipy,ales-erjavec/scipy,maciejkula/scipy,zerothi/scipy,perimosocordiae/scipy,jamestwebber/scipy,jor-/scipy,jakevdp/scipy,sauliusl/scipy,vigna/scipy,ales-erjavec/scipy,mgaitan/scipy,vberaudi/scipy,fernand/scipy,chatcannon/scipy,mortonjt/scipy,dominicelse/scipy,juliantaylor/scipy,mingwpy/scipy,dominicelse/scipy,WillieMaddox/scipy,mingwpy/scipy,surhudm/scipy,sriki18/scipy,anntzer/scipy,piyush0609/scipy,matthewalbani/scipy,mdhaber/scipy,surhudm/scipy,pyramania/scipy,juliantaylor/scipy,Kamp9/scipy,sauliusl/scipy,apbard/scipy,aarchiba/scipy,richardotis/scipy,aeklant/scipy,raoulbq/scipy,sargas/scipy,aman-iitj/scipy,sonnyhu/scipy,mortada/scipy,trankmichael/scipy,Kamp9/scipy,kleskjr/scipy,jakevdp/scipy,ales-erjavec/scipy,lukauskas/scipy,giorgiop/scipy,hainm/scipy,cpaulik/scipy,pnedunuri/scipy,Stefan-Endres/scipy,giorgiop/scipy,zerothi/scipy,mgaitan/scipy,Dapid/scipy,ales-erjavec/scipy,hainm/scipy,newemailjdm/scipy,jsilter/scipy,matthew-brett/scipy,nvoron23/scipy,rgommers/scipy,lhilt/scipy,befelix/scipy,nmayorov/scipy,minhlongdo/scipy,bkendzior/scipy,endolith/scipy,andyfaff/scipy,nvoron23/scipy,behzadnouri/scipy,kleskjr/scipy,haudren/scipy,gfyoung/scipy,sonnyhu/scipy,vhaasteren/scipy,raoulbq/scipy,dch312/scipy,FRidh/scipy,perimosocordiae/scipy,woodscn/scipy,aeklant/scipy,aman-iitj/scipy,pizzathief/scipy,mgaitan/scipy,pschella/scipy,newemailjdm/scipy,mgaitan/scipy,mhogg/scipy,kleskjr/scipy,jor-/scipy,rgommers/scipy,sonnyhu/scipy,dominicelse/scipy,mikebenfield/scipy,anntzer/scipy,witcxc/scipy,jakevdp/scipy,zxsted/scipy,e-q/scipy,petebachant/scipy,richardotis/scipy,nmayorov/scipy,rmcgibbo/scipy,gfyoung/scipy,pbrod/scipy,njwilson23/scipy,anntzer/scipy,gfyoung/scipy,vberaudi/scipy,grlee77/scipy,richardotis/scipy,ilayn/scipy,lukauskas/scipy,matthew-brett/scipy,andim/scipy,nvoron23/scipy,vhaasteren/scipy,larsmans/scipy,vigna/scipy,person142/scipy,trankmichael/scipy,lukauskas/scipy,matthewalbani/scipy,Stefan-Endres/scipy,ChanderG/scipy,gfyoung/scipy,befelix/scipy,mortonjt/scipy,apbard/scipy,witcxc/scipy,argriffing/scipy,pnedunuri/scipy,sauliusl/scipy,cpaulik/scipy,pyramania/scipy,WarrenWeckesser/scipy,piyush0609/scipy,vhaasteren/scipy,person142/scipy,vanpact/scipy,maniteja123/scipy,Shaswat27/scipy,andim/scipy,witcxc/scipy,apbard/scipy,trankmichael/scipy,kleskjr/scipy,e-q/scipy,Dapid/scipy,zxsted/scipy,niknow/scipy,sonnyhu/scipy,futurulus/scipy,mortada/scipy,cpaulik/scipy,piyush0609/scipy,Srisai85/scipy,FRidh/scipy,futurulus/scipy,sauliusl/scipy,njwilson23/scipy,woodscn/scipy,FRidh/scipy,scipy/scipy,teoliphant/scipy,rgommers/scipy,ilayn/scipy,argriffing/scipy,mtrbean/scipy,Gillu13/scipy,Gillu13/scipy,teoliphant/scipy,Newman101/scipy,zxsted/scipy,mhogg/scipy,mikebenfield/scipy,behzadnouri/scipy,haudren/scipy,felipebetancur/scipy,lhilt/scipy,rmcgibbo/scipy,maniteja123/scipy,futurulus/scipy,fredrikw/scipy,chatcannon/scipy,jseabold/scipy,surhudm/scipy,pbrod/scipy,njwilson23/scipy,anntzer/scipy,josephcslater/scipy,njwilson23/scipy,ogrisel/scipy,vigna/scipy,tylerjereddy/scipy,fredrikw/scipy,maniteja123/scipy,gertingold/scipy,cpaulik/scipy,grlee77/scipy,grlee77/scipy,piyush0609/scipy,pnedunuri/scipy,ilayn/scipy,Srisai85/scipy,pyramania/scipy,mhogg/scipy,Kamp9/scipy,Stefan-Endres/scipy,jseabold/scipy,WarrenWeckesser/scipy,raoulbq/scipy,lhilt/scipy,lukauskas/scipy,apbard/scipy,gertingold/scipy,kalvdans/scipy,aeklant/scipy,pbrod/scipy,jsilter/scipy,petebachant/scipy,Kamp9/scipy,mtrbean/scipy,argriffing/scipy,juliantaylor/scipy,andyfaff/scipy,Eric89GXL/scipy,haudren/scipy,mtrbean/scipy,hainm/scipy,hainm/scipy,pyramania/scipy,aman-iitj/scipy,pnedunuri/scipy,gertingold/scipy,vhaasteren/scipy,mdhaber/scipy,argriffing/scipy,gdooper/scipy,sriki18/scipy,ChanderG/scipy,zerothi/scipy,ilayn/scipy,zaxliu/scipy,befelix/scipy,Gillu13/scipy,matthewalbani/scipy,larsmans/scipy,mhogg/scipy,mtrbean/scipy,aeklant/scipy,Gillu13/scipy,anielsen001/scipy,nonhermitian/scipy,vigna/scipy,trankmichael/scipy,jamestwebber/scipy,Gillu13/scipy,zerothi/scipy,kalvdans/scipy,rmcgibbo/scipy,richardotis/scipy,WarrenWeckesser/scipy,aarchiba/scipy,person142/scipy,woodscn/scipy,pbrod/scipy,efiring/scipy,gef756/scipy,ortylp/scipy,WillieMaddox/scipy,pizzathief/scipy,arokem/scipy,zaxliu/scipy,vanpact/scipy,fredrikw/scipy,ortylp/scipy,Stefan-Endres/scipy,vanpact/scipy,anielsen001/scipy,e-q/scipy,petebachant/scipy,mhogg/scipy,fredrikw/scipy,pschella/scipy,ales-erjavec/scipy,WillieMaddox/scipy,anielsen001/scipy,ndchorley/scipy,ortylp/scipy,vanpact/scipy,ilayn/scipy,anielsen001/scipy,fredrikw/scipy,kalvdans/scipy,sargas/scipy,trankmichael/scipy,jakevdp/scipy,felipebetancur/scipy,Srisai85/scipy,mingwpy/scipy,kalvdans/scipy,behzadnouri/scipy,Gillu13/scipy,Srisai85/scipy,futurulus/scipy,jseabold/scipy,ogrisel/scipy,anntzer/scipy,chatcannon/scipy,hainm/scipy,efiring/scipy,tylerjereddy/scipy,perimosocordiae/scipy,petebachant/scipy,ortylp/scipy,pbrod/scipy,e-q/scipy,nonhermitian/scipy,raoulbq/scipy,andyfaff/scipy,raoulbq/scipy,rgommers/scipy,ChanderG/scipy,gdooper/scipy,minhlongdo/scipy,Eric89GXL/scipy,Kamp9/scipy,petebachant/scipy,woodscn/scipy,Dapid/scipy,argriffing/scipy,futurulus/scipy,scipy/scipy,endolith/scipy,richardotis/scipy,gdooper/scipy,gef756/scipy,perimosocordiae/scipy,nmayorov/scipy,Srisai85/scipy,sonnyhu/scipy,grlee77/scipy,jor-/scipy,vberaudi/scipy,jonycgn/scipy,maciejkula/scipy,pnedunuri/scipy,zaxliu/scipy,fernand/scipy,newemailjdm/scipy,grlee77/scipy,chatcannon/scipy,pizzathief/scipy,matthew-brett/scipy,jamestwebber/scipy,nvoron23/scipy,dch312/scipy,josephcslater/scipy,Newman101/scipy,jonycgn/scipy,jamestwebber/scipy,sriki18/scipy,mortada/scipy,woodscn/scipy,pbrod/scipy,WarrenWeckesser/scipy,woodscn/scipy,argriffing/scipy,ndchorley/scipy,ndchorley/scipy,ogrisel/scipy,josephcslater/scipy,tylerjereddy/scipy,apbard/scipy,bkendzior/scipy,anntzer/scipy,giorgiop/scipy,haudren/scipy,arokem/scipy,jonycgn/scipy,WillieMaddox/scipy,vberaudi/scipy,andim/scipy,niknow/scipy,sauliusl/scipy,dch312/scipy,sriki18/scipy,surhudm/scipy,mdhaber/scipy,zerothi/scipy,teoliphant/scipy,endolith/scipy,behzadnouri/scipy,jsilter/scipy,person142/scipy,scipy/scipy,ndchorley/scipy,larsmans/scipy,person142/scipy,jamestwebber/scipy,jjhelmus/scipy,jseabold/scipy,mtrbean/scipy,lukauskas/scipy,andyfaff/scipy,larsmans/scipy,Dapid/scipy,perimosocordiae/scipy,matthew-brett/scipy,fredrikw/scipy,mikebenfield/scipy,nonhermitian/scipy,ortylp/scipy,gef756/scipy,aman-iitj/scipy,rgommers/scipy,niknow/scipy,jjhelmus/scipy,rmcgibbo/scipy,sauliusl/scipy,Dapid/scipy,efiring/scipy,sargas/scipy,WillieMaddox/scipy,efiring/scipy,nvoron23/scipy,Stefan-Endres/scipy,Stefan-Endres/scipy,efiring/scipy,tylerjereddy/scipy,ChanderG/scipy,josephcslater/scipy,lukauskas/scipy,maciejkula/scipy,anielsen001/scipy,felipebetancur/scipy,mdhaber/scipy,vhaasteren/scipy,tylerjereddy/scipy,giorgiop/scipy,bkendzior/scipy,chatcannon/scipy,Kamp9/scipy,richardotis/scipy,sriki18/scipy,maniteja123/scipy,raoulbq/scipy,piyush0609/scipy,Newman101/scipy,mikebenfield/scipy,ChanderG/scipy,giorgiop/scipy,arokem/scipy,giorgiop/scipy,gdooper/scipy,niknow/scipy,ortylp/scipy,dominicelse/scipy,matthew-brett/scipy,minhlongdo/scipy,zerothi/scipy,Eric89GXL/scipy,mtrbean/scipy,aarchiba/scipy,Shaswat27/scipy,scipy/scipy,hainm/scipy,aman-iitj/scipy,rmcgibbo/scipy,lhilt/scipy,fernand/scipy,gef756/scipy,mingwpy/scipy,maniteja123/scipy,larsmans/scipy,dch312/scipy,sriki18/scipy,Shaswat27/scipy,mortonjt/scipy,pnedunuri/scipy,arokem/scipy,befelix/scipy,jjhelmus/scipy,andyfaff/scipy,nvoron23/scipy,pschella/scipy,Newman101/scipy,FRidh/scipy,nmayorov/scipy,teoliphant/scipy,jakevdp/scipy,pschella/scipy,jseabold/scipy,kleskjr/scipy,Newman101/scipy,mortada/scipy,ndchorley/scipy,ales-erjavec/scipy,ogrisel/scipy,endolith/scipy,jsilter/scipy,gertingold/scipy,Shaswat27/scipy,Newman101/scipy,efiring/scipy,matthewalbani/scipy,minhlongdo/scipy,cpaulik/scipy,rmcgibbo/scipy,mikebenfield/scipy,Shaswat27/scipy,newemailjdm/scipy,piyush0609/scipy,anielsen001/scipy,maniteja123/scipy,vigna/scipy,ChanderG/scipy,josephcslater/scipy,zaxliu/scipy,endolith/scipy,sargas/scipy,bkendzior/scipy,mgaitan/scipy,gdooper/scipy,kalvdans/scipy,zaxliu/scipy,surhudm/scipy,fernand/scipy,arokem/scipy,pizzathief/scipy,aeklant/scipy,kleskjr/scipy,mgaitan/scipy,Shaswat27/scipy,zxsted/scipy,teoliphant/scipy,aarchiba/scipy,trankmichael/scipy,nmayorov/scipy,dch312/scipy,gertingold/scipy,vberaudi/scipy,endolith/scipy,mdhaber/scipy,zxsted/scipy,jjhelmus/scipy,mortonjt/scipy,andim/scipy,jonycgn/scipy,dominicelse/scipy,njwilson23/scipy,pizzathief/scipy,Eric89GXL/scipy,nonhermitian/scipy,mhogg/scipy,FRidh/scipy,vanpact/scipy,WarrenWeckesser/scipy,WarrenWeckesser/scipy,witcxc/scipy,njwilson23/scipy,mortada/scipy,haudren/scipy,jonycgn/scipy,surhudm/scipy,andim/scipy,e-q/scipy,larsmans/scipy,perimosocordiae/scipy,newemailjdm/scipy,scipy/scipy,sonnyhu/scipy,mingwpy/scipy,Srisai85/scipy,niknow/scipy,nonhermitian/scipy,mortonjt/scipy,ndchorley/scipy,jonycgn/scipy,scipy/scipy,WillieMaddox/scipy,Eric89GXL/scipy,jjhelmus/scipy,befelix/scipy
9ae82cb0b9b30a8276acf36d7abd6fdaefbdaab8
test/CodeGen/preserve-as-comments.c
test/CodeGen/preserve-as-comments.c
// RUN: %clang_cc1 -S -fno-preserve-as-comments %s -o - | FileCheck %s --check-prefix=NOASM --check-prefix=CHECK // RUN: %clang_cc1 -S %s -o - | FileCheck %s --check-prefix=ASM --check-prefix=CHECK // CHECK-LABEL: main // CHECK: #APP // ASM: #comment // NOASM-NOT: #comment // CHECK: #NO_APP int main() { __asm__("/*comment*/"); return 0; }
// RUN: %clang_cc1 -S -triple=x86_64-unknown-unknown -fno-preserve-as-comments %s -o - | FileCheck %s --check-prefix=NOASM --check-prefix=CHECK // RUN: %clang_cc1 -S %s -triple=x86_64-unknown-unknown -o - | FileCheck %s --check-prefix=ASM --check-prefix=CHECK // CHECK-LABEL: main // CHECK: #APP // ASM: #comment // NOASM-NOT: #comment // CHECK: #NO_APP int main() { __asm__("/*comment*/"); return 0; }
Add target triple in test
Add target triple in test git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@276915 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
b3dff4d84df5f1b4b0ad59ac760c32f531321d32
test/CodeGen/link-bitcode-file.c
test/CodeGen/link-bitcode-file.c
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -emit-llvm-bc -o %t.bc %s // RUN: %clang_cc1 -triple i386-pc-linux-gnu -mlink-bitcode-file %t.bc -O3 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-NO-BC %s // RUN: not %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -mlink-bitcode-file %t.bc -O3 -emit-llvm -o - %s 2>&1 | FileCheck -check-prefix=CHECK-BC %s int f(void); #ifdef BITCODE // CHECK-BC: 'f': symbol multiply defined int f(void) { return 42; } #else // CHECK-NO-BC-LABEL: define i32 @g // CHECK-NO-BC: ret i32 42 int g(void) { return f(); } // CHECK-NO-BC-LABEL: define i32 @f #endif
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -emit-llvm-bc -o %t.bc %s // RUN: %clang_cc1 -triple i386-pc-linux-gnu -mlink-bitcode-file %t.bc -O3 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-NO-BC %s // RUN: not %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -mlink-bitcode-file %t.bc -O3 -emit-llvm -o - %s 2>&1 | FileCheck -check-prefix=CHECK-BC %s int f(void); #ifdef BITCODE // CHECK-BC: fatal error: cannot link module {{.*}}'f': symbol multiply defined int f(void) { return 42; } #else // CHECK-NO-BC-LABEL: define i32 @g // CHECK-NO-BC: ret i32 42 int g(void) { return f(); } // CHECK-NO-BC-LABEL: define i32 @f #endif
Make this test a bit stricter by checking clang's output too.
Make this test a bit stricter by checking clang's output too. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@220604 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
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,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
d6b7b885b5cdd4ef12b2ba4f4b071dddbc092c4a
exercise112.c
exercise112.c
/* Exercise 1-12: Write a program that prints its input one word per line. */ #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { int16_t character; bool in_whitespace; while ((character = getchar()) != EOF) { if ((character == ' ') || (character == '\t')) { if (in_whitespace == false) { putchar('\n'); in_whitespace = true; } } else { putchar(character); in_whitespace = false; } } return EXIT_SUCCESS; }
Add solution to Exercise 1-12.
Add solution to Exercise 1-12.
C
unlicense
damiendart/knr-solutions,damiendart/knr-solutions,damiendart/knr-solutions
ca910100761ba025d9b7156d1030184a42bdd486
test/Analysis/null-deref-path-notes.c
test/Analysis/null-deref-path-notes.c
// RUN: %clang_analyze_cc1 -w -x c -analyzer-checker=core -analyzer-output=text -verify %s // Avoid the crash when finding the expression for tracking the origins // of the null pointer for path notes. Apparently, not much actual tracking // needs to be done in this example. void pr34373() { int *a = 0; // expected-note{{'a' initialized to a null pointer value}} (a + 0)[0]; // expected-warning{{Array access results in a null pointer dereference}} // expected-note@-1{{Array access results in a null pointer dereference}} }
// RUN: %clang_analyze_cc1 -w -x c -analyzer-checker=core -analyzer-output=text -verify %s // Avoid the crash when finding the expression for tracking the origins // of the null pointer for path notes. void pr34373() { int *a = 0; // expected-note{{'a' initialized to a null pointer value}} (a + 0)[0]; // expected-warning{{Array access results in a null pointer dereference}} // expected-note@-1{{Array access results in a null pointer dereference}} }
Fix an outdated comment in a test. NFC.
[analyzer] Fix an outdated comment in a test. NFC. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@314298 91177308-0d34-0410-b5e6-96231b3b80d8 (cherry picked from commit a0d7ea7ad167665974775befd200847e5d84dd02)
C
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang
731240cc5d0e396fd67f9ca85086226a1d34c8de
test/CFrontend/2002-07-30-UnionTest.c
test/CFrontend/2002-07-30-UnionTest.c
union X; struct Empty {}; union F {}; union Q { union Q *X; }; union X { char C; int A, Z; long long B; void *b1; struct { int A; long long Z; } Q; }; union X foo(union X A) { A.C = 123; A.A = 39249; //A.B = (void*)123040123321; A.B = 12301230123123LL; A.Z = 1; return A; }
Add test of newly checked in Union support!
Add test of newly checked in Union support! git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@3151 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm
b35bac92d94f94f957ff680de05f36a0100219c0
Classes/EEEOperationCenter.h
Classes/EEEOperationCenter.h
#import <Foundation/Foundation.h> #define EEEPrepareBlockSelf() __weak __typeof__(self) __weakSelf = self #define EEEUseBlockSelf() __typeof__(__weakSelf) __weak blockSelf = __weakSelf @class EEEInjector; @class EEEOperation; @interface EEEOperationCenter : NSObject @property(nonatomic, strong) NSOperationQueue *mainCommandQueue; @property(nonatomic, strong) NSOperationQueue *backgroundCommandQueue; @property NSInteger maxConcurrentOperationCount; + (EEEOperationCenter *)currentOperationCenter; + (EEEOperationCenter *)setCurrentOperationCenter:(EEEOperationCenter *)defaultCenter; - (id)initWithInjector:(EEEInjector *)injector; - (id)queueOperation:(EEEOperation *)operation; - (id)inlineOperation:(EEEOperation *)operation withTimeout:(NSTimeInterval)seconds; @end
#import <Foundation/Foundation.h> #define EEEPrepareBlockSelf() __weak __typeof__(self) __weakSelf = self #define EEEUseBlockSelf() __strong __typeof__(__weakSelf) blockSelf = __weakSelf @class EEEInjector; @class EEEOperation; @interface EEEOperationCenter : NSObject @property(nonatomic, strong) NSOperationQueue *mainCommandQueue; @property(nonatomic, strong) NSOperationQueue *backgroundCommandQueue; @property NSInteger maxConcurrentOperationCount; + (EEEOperationCenter *)currentOperationCenter; + (EEEOperationCenter *)setCurrentOperationCenter:(EEEOperationCenter *)defaultCenter; - (id)initWithInjector:(EEEInjector *)injector; - (id)queueOperation:(EEEOperation *)operation; - (id)inlineOperation:(EEEOperation *)operation withTimeout:(NSTimeInterval)seconds; @end
Fix the two-step-macro behavior, tests pass
Fix the two-step-macro behavior, tests pass
C
unlicense
epologee/EEEOperationCenter,epologee/EEEOperationCenter,epologee/EEEOperationCenter
60f44581f2077d3f5a00cad006a2bb1c86d80f2a
src/condor_includes/condor_fix_stdio.h
src/condor_includes/condor_fix_stdio.h
#ifndef FIX_STDIO_H #define FIX_STDIO_H #include <stdio.h> #if defined(__cplusplus) extern "C" { #endif /* For some reason the stdio.h on OSF1 fails to provide prototypes for popen() and pclose() if _POSIX_SOURCE is defined. */ #if defined(OSF1) #if defined(__STDC__) || defined(__cplusplus) FILE *popen( char *, char * ); int pclose( FILE *__stream ); #else FILE *popen(); int pclose(); #endif #endif /* OSF1 */ /* For some reason the stdio.h on Ultrix 4.3 fails to provide a prototype for pclose() if _POSIX_SOURCE is defined - even though it does provide a prototype for popen(). */ #if defined(ULTRIX43) #if defined(__STDC__) || defined(__cplusplus) int pclose( FILE *__stream ); #else int pclose(); #endif #endif /* ULTRIX43 */ #if defined(__cplusplus) } #endif #endif
#ifndef FIX_STDIO_H #define FIX_STDIO_H #include <stdio.h> #if defined(__cplusplus) extern "C" { #endif /* For some reason the stdio.h on OSF1 fails to provide prototypes for popen() and pclose() if _POSIX_SOURCE is defined. */ #if defined(OSF1) #if defined(__STDC__) || defined(__cplusplus) FILE *popen( char *, char * ); int pclose( FILE *__stream ); extern void setbuffer(FILE*, char*, int); extern void setlinebuf(FILE*); #else FILE *popen(); int pclose(); extern void setbuffer(); extern void setlinebuf(); #endif #endif /* OSF1 */ /* For some reason the stdio.h on Ultrix 4.3 fails to provide a prototype for pclose() if _POSIX_SOURCE is defined - even though it does provide a prototype for popen(). */ #if defined(ULTRIX43) #if defined(__STDC__) || defined(__cplusplus) int pclose( FILE *__stream ); #else int pclose(); #endif #endif /* ULTRIX43 */ #if defined(__cplusplus) } #endif #endif
Add prototypes for setbuffer() and setlinebuf(). Questionable as these should probably be replaced with ANSI stype setbuf() calls.
Add prototypes for setbuffer() and setlinebuf(). Questionable as these should probably be replaced with ANSI stype setbuf() calls.
C
apache-2.0
djw8605/htcondor,djw8605/condor,mambelli/osg-bosco-marco,htcondor/htcondor,djw8605/condor,clalancette/condor-dcloud,htcondor/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,neurodebian/htcondor,htcondor/htcondor,djw8605/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,htcondor/htcondor,bbockelm/condor-network-accounting,djw8605/condor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,htcondor/htcondor,htcondor/htcondor,djw8605/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,zhangzhehust/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,zhangzhehust/htcondor,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,zhangzhehust/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,clalancette/condor-dcloud,zhangzhehust/htcondor,djw8605/condor,neurodebian/htcondor,djw8605/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,neurodebian/htcondor,djw8605/condor,djw8605/htcondor,djw8605/condor,zhangzhehust/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,htcondor/htcondor,mambelli/osg-bosco-marco,neurodebian/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,djw8605/condor,clalancette/condor-dcloud,djw8605/condor,neurodebian/htcondor
5ca658382bf487b2da30a83a3449e16de8e98c36
examples/test.c
examples/test.c
#include <stdio.h> #include <string.h> #include "../src/mlist.h" int main (int argc, char *argv[]) { mlist_t *list; int *n; char *c; char *s = NULL; const char *name = "cubicdaiya"; list = mlist_create(); n = mlist_palloc(list, sizeof(int)); list = mlist_extend(list); c = mlist_palloc(list, sizeof(char)); list = mlist_extend(list); s = mlist_palloc(list, strlen(name) + 1); list = mlist_extend(list); *n = 5; *c = 'a'; strncpy(s, name, strlen(name) + 1); printf("n = %d\n", *n); printf("c = %c\n", *c); printf("name = %s\n", s); mlist_destroy(list); return 0; }
#include <stdio.h> #include <string.h> #include "mlist.h" int main (int argc, char *argv[]) { mlist_t *list; int *n; char *c; char *s = NULL; const char *name = "cubicdaiya"; list = mlist_create(); n = mlist_palloc(list, sizeof(int)); list = mlist_extend(list); c = mlist_palloc(list, sizeof(char)); list = mlist_extend(list); s = mlist_palloc(list, strlen(name) + 1); list = mlist_extend(list); *n = 5; *c = 'a'; strncpy(s, name, strlen(name) + 1); printf("n = %d\n", *n); printf("c = %c\n", *c); printf("name = %s\n", s); mlist_destroy(list); return 0; }
Revert "mv example source code"
Revert "mv example source code" This reverts commit 7f0d00f7ff862b812cdf427dc717dee6b02ac84b.
C
bsd-3-clause
cubicdaiya/mlist
56e734d78f593b0da4fce749ead8c841e3453ba8
Source/DHScatterGraph.h
Source/DHScatterGraph.h
// Douglas Hill, May 2015 // https://github.com/douglashill/DHScatterGraph #import <DHScatterGraph/DHScatterGraphLineAttributes.h> #import <DHScatterGraph/DHScatterGraphPointSet.h> #import <DHScatterGraph/DHScatterGraphView.h>
// Douglas Hill, May 2015 // https://github.com/douglashill/DHScatterGraph extern double const DHScatterGraphVersionNumber; extern unsigned char const DHScatterGraphVersionString[]; #import <DHScatterGraph/DHScatterGraphLineAttributes.h> #import <DHScatterGraph/DHScatterGraphPointSet.h> #import <DHScatterGraph/DHScatterGraphView.h>
Add framework version info to umbrella header
Add framework version info to umbrella header The values of these constants are provided by Xcode’s automatically generated DerivedSources/DHScatterGraph_vers.c.
C
mit
douglashill/DHScatterGraph
e755a1bd1be67de62108b36de65d8efc64dadd1c
src/util/PIDexternaltime.h
src/util/PIDexternaltime.h
#ifndef PIDEXTERNALTIME_H #define PIDEXTERNALTIME_H #include "Arduino.h" #include "util/PIDparameters.h" class PIDexternaltime{ private: PIDparameters* param; float setPoint; float previous; float acc; boolean stopped; public: PIDexternaltime(PIDparameters* pid): param(pid), setPoint(0), previous(0), acc(0), stopped(true) {} void tune(PIDparameters* pid){ param = pid; } void clearAccumulator(){ train(0); } void train(float out){ acc = constrain(out, param->lowerBound, param->upperBound); } void set(float input){ setPoint = input; stopped = false; } void stop() { clearAccumulator(); stopped = true; } /** * Update the PID controller * current - the current process value * ms - milliseconds since last update */ float update(float current, float ms){ uint32_t cTime = micros(); if(stopped) { time = cTime; previous = 0; return 0; } const float dt = min(ms/1000.0, 1.0); //convert to seconds, cap at 1 const float error = setPoint-current; const float newAcc = acc + param->I*error*dt; const float output = param->P * error + newAcc + param->D * (previous-current)/dt; previous = current; if (output > param->upperBound) { acc = min(acc, newAcc); //only let acc decrease return param->upperBound; } else if (output < param->lowerBound) { acc = max(acc, newAcc); //only let acc increase return param->lowerBound; } //to prevent integral windup, we only change the integral if the output //is not fully saturated acc = newAcc; return output; } }; #endif
Add a PID implementation that doesn't independently keep track of time
Add a PID implementation that doesn't independently keep track of time
C
apache-2.0
MINDS-i/MINDS-i-Drone,MINDS-i/MINDS-i-Drone
70705c03128c4cf0594a1dcf91a62a91b8b566e2
lib/libc/gen/semctl.c
lib/libc/gen/semctl.c
#include <sys/cdefs.h> __FBSDID("$FreeBSD$"); #include <sys/types.h> #include <sys/ipc.h> #include <sys/sem.h> #include <stdarg.h> #include <stdlib.h> int semctl(int semid, int semnum, int cmd, ...) { va_list ap; union semun semun; union semun *semun_ptr; va_start(ap, cmd); if (cmd == IPC_SET || cmd == IPC_STAT || cmd == GETALL || cmd == SETVAL || cmd == SETALL) { semun = va_arg(ap, union semun); semun_ptr = &semun; } else { semun_ptr = NULL; } va_end(ap); return (__semctl(semid, semnum, cmd, semun_ptr)); }
/*- * Copyright (c) 2002 Doug Rabson * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); #include <sys/types.h> #include <sys/ipc.h> #include <sys/sem.h> #include <stdarg.h> #include <stdlib.h> int semctl(int semid, int semnum, int cmd, ...) { va_list ap; union semun semun; union semun *semun_ptr; va_start(ap, cmd); if (cmd == IPC_SET || cmd == IPC_STAT || cmd == GETALL || cmd == SETVAL || cmd == SETALL) { semun = va_arg(ap, union semun); semun_ptr = &semun; } else { semun_ptr = NULL; } va_end(ap); return (__semctl(semid, semnum, cmd, semun_ptr)); }
Add a missing copyright for Doug. There are other files missing this copyright in -stable.
Add a missing copyright for Doug. There are other files missing this copyright in -stable. PR: 41397 Submitted 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
d3c92bbf60ad44338dc87655191e8baa5fc4d96a
src/vio/csync_vio_handle.h
src/vio/csync_vio_handle.h
/* * libcsync -- a library to sync a directory with another * * Copyright (c) 2008 by Andreas Schneider <[email protected]> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * vim: ft=c.doxygen ts=2 sw=2 et cindent */ #ifndef _CSYNC_VIO_HANDLE_H #define _CSYNC_VIO_HANDLE_H typedef void *csync_vio_method_handle_t; typedef struct csync_vio_handle_s csync_vio_handle_t; #endif /* _CSYNC_VIO_HANDLE_H */
/* * libcsync -- a library to sync a directory with another * * Copyright (c) 2008 by Andreas Schneider <[email protected]> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * vim: ft=c.doxygen ts=2 sw=2 et cindent */ #ifndef _CSYNC_VIO_HANDLE_H #define _CSYNC_VIO_HANDLE_H typedef void csync_vio_method_handle_t; typedef struct csync_vio_handle_s csync_vio_handle_t; #endif /* _CSYNC_VIO_HANDLE_H */
Use the right type for the csync_vio_method_handle_t.
Use the right type for the csync_vio_method_handle_t.
C
lgpl-2.1
gco/csync,gco/csync,gco/csync,meeh420/csync,meeh420/csync,meeh420/csync,gco/csync
20a03ffdbb3469cf9d24afd1007ca1f16196a195
libc/stdlib/bsearch.c
libc/stdlib/bsearch.c
/* * This file lifted in toto from 'Dlibs' on the atari ST (RdeBath) * * * Dale Schumacher 399 Beacon Ave. * (alias: Dalnefre') St. Paul, MN 55104 * [email protected] United States of America * "It's not reality that's important, but how you perceive things." */ #include <stdio.h> static int _bsearch; /* index of element found, or where to * insert */ char *bsearch(key, base, num, size, cmp) register char *key; /* item to search for */ register char *base; /* base address */ int num; /* number of elements */ register int size; /* element size in bytes */ register int (*cmp) (); /* comparison function */ { register int a, b, c, dir; a = 0; b = num - 1; while (a <= b) { c = (a + b) >> 1; /* == ((a + b) / 2) */ if ((dir = (*cmp) (key, (base + (c * size))))) { if (dir < 0) b = c - 1; else /* (dir > 0) */ a = c + 1; } else { _bsearch = c; return (base + (c * size)); } } _bsearch = b; return (NULL); }
/* * This file originally lifted in toto from 'Dlibs' on the atari ST (RdeBath) * * * Dale Schumacher 399 Beacon Ave. * (alias: Dalnefre') St. Paul, MN 55104 * [email protected] United States of America * "It's not reality that's important, but how you perceive things." * * Reworked by Erik Andersen <[email protected]> */ #include <stdio.h> void * bsearch (const void *key, const void *base, size_t num, size_t size, int (*cmp) (const void *, const void *)) { int dir; size_t a, b, c; const void *p; a = 0; b = num; while (a < b) { c = (a + b) >> 1; /* == ((a + b) / 2) */ p = (void *)(((const char *) base) + (c * size)); dir = (*cmp)(key, p); if (dir < 0) { b = c; } else if (dir > 0) { a = c + 1; } else { return (void *)p; } } return NULL; }
Rework and kill pointless static variable -Erik
Rework and kill pointless static variable -Erik
C
lgpl-2.1
joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc
32cd7b3a779cf2ec3341c56802df50c72607f5a1
lin-client/src/main.c
lin-client/src/main.c
static char startmessage[] = "Linux Backup Client"; #include<stdio.h> #include<string.h> #include"db.h" int main(int argc, char **argv) { int argindex = 0; puts(startmessage); for(argindex = 1; argindex < argc; argindex++) { if(strcmp(argv[argindex], "version") == 0) { puts("This should display version"); } else if(strcmp(argv[argindex], "new") == 0) { puts("This should create a new block"); printf("Creating new block with name '%s'\n", argv[argindex + 1]); ++argindex; write_database(argv[argindex + 1]); } else if(strcmp(argv[argindex], "create") == 0) { if(create_database(argv[argindex + 1])) { puts("Cannot open file."); } ++argindex; } else { printf("Command '%s' not regognized\n", argv[argindex]); } } return 0; }
static char startmessage[] = "Linux Backup Client"; #include<stdio.h> #include<string.h> #include"db.h" int main(int argc, char **argv) { THIS WILL BREAK THE BUILD! int argindex = 0; puts(startmessage); for(argindex = 1; argindex < argc; argindex++) { if(strcmp(argv[argindex], "version") == 0) { puts("This should display version"); } else if(strcmp(argv[argindex], "new") == 0) { puts("This should create a new block"); printf("Creating new block with name '%s'\n", argv[argindex + 1]); ++argindex; write_database(argv[argindex + 1]); } else if(strcmp(argv[argindex], "create") == 0) { if(create_database(argv[argindex + 1])) { puts("Cannot open file."); } ++argindex; } else { printf("Command '%s' not regognized\n", argv[argindex]); } } return 0; }
Test to see what jenkins will do
Test to see what jenkins will do
C
mit
paulkramme/backup
2ff0d3cfdd0920c179616e8d0738c376f787d22a
scripts/testScreens/setup/stuffCheckBox.c
scripts/testScreens/setup/stuffCheckBox.c
testScreens: setup: stuffCheckBox Go to Field [ ] If [ tempSetup::InventoryLibaryYN = "" ] Set Field [ tempSetup::layoutLtagK; "" ] Set Field [ tempSetup::layoutRtagK; "" ] Set Field [ tempSetup::layoutLtagN; "" ] Set Field [ tempSetup::layoutRtagN; "" ] Else Set Field [ tempSetup::layoutLtagK; "moreltagNKs2" ] Set Field [ tempSetup::layoutRtagK; "moreReferenceMenu2SkeywordOrNode1" ] Set Field [ tempSetup::layoutLtagN; "moreltagNKs2" ] Set Field [ tempSetup::layoutRtagN; "moreReferenceMenu2SkeywordOrNode1" ] End If May 4, 平成27 21:28:07 Library.fp7 - stuffCheckBox -1-
changeLibraryOrLibraryName: stuffCheckBox # #Exit the checkbox. Go to Field [ ] # #Set default layouts for a reference library. If [ tempSetup::InventoryLibaryYN = "" ] Set Field [ tempSetup::layoutLtagK; "" ] Set Field [ tempSetup::layoutRtagK; "" ] Set Field [ tempSetup::layoutLtagN; "" ] Set Field [ tempSetup::layoutRtagN; "" ] # #Designate library as a reference library. Set Field [ sectionAttributionInfo::order; "" ] Else # #Set default layouts for a stuff/inventory library. Set Field [ tempSetup::layoutLtagK; "moreltagNKs2" ] Set Field [ tempSetup::layoutRtagK; "moreReferenceMenu2SkeywordOrNode1" ] Set Field [ tempSetup::layoutLtagN; "moreltagNKs2" ] Set Field [ tempSetup::layoutRtagN; "moreReferenceMenu2SkeywordOrNode1" ] # #Designate library as a stuff/inventory library. Set Field [ sectionAttributionInfo::order; 1 ] End If December 27, ଘ౮27 19:05:50 Library.fp7 - stuffCheckBox -1-
Make library type checkbox part of the library record.
Make library type checkbox part of the library record.
C
apache-2.0
HelpGiveThanks/Library,HelpGiveThanks/Library
7461cac37cacffb49f7084332a9e39eeafb39f6f
COFF/Error.h
COFF/Error.h
//===- Error.h --------------------------------------------------*- C++ -*-===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLD_COFF_ERROR_H #define LLD_COFF_ERROR_H #include "lld/Core/LLVM.h" #include "llvm/Support/Error.h" namespace lld { namespace coff { LLVM_ATTRIBUTE_NORETURN void error(const Twine &Msg); void error(std::error_code EC, const Twine &Prefix); void error(llvm::Error E, const Twine &Prefix); template <typename T> void error(const ErrorOr<T> &V, const Twine &Prefix) { error(V.getError(), Prefix); } template <class T> T check(Expected<T> E, const Twine &Prefix) { if (!E) return std::move(*E); error(E.takeError(), Prefix); return T(); } } // namespace coff } // namespace lld #endif
//===- Error.h --------------------------------------------------*- C++ -*-===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLD_COFF_ERROR_H #define LLD_COFF_ERROR_H #include "lld/Core/LLVM.h" #include "llvm/Support/Error.h" namespace lld { namespace coff { LLVM_ATTRIBUTE_NORETURN void error(const Twine &Msg); void error(std::error_code EC, const Twine &Prefix); void error(llvm::Error E, const Twine &Prefix); template <typename T> void error(const ErrorOr<T> &V, const Twine &Prefix) { error(V.getError(), Prefix); } template <class T> T check(Expected<T> E, const Twine &Prefix) { if (E) return std::move(*E); error(E.takeError(), Prefix); return T(); } } // namespace coff } // namespace lld #endif
Fix logic error in check() function.
Fix logic error in check() function. git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@274195 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/lld,llvm-mirror/lld
51450367c482ab3e47ee0a09e7196d772b81d7ed
src/moints/moints_cutil.c
src/moints/moints_cutil.c
#if defined(CRAY_T3E) || defined(CRAY_T3D) int ONBITMASK( int *len ) #else int onbitmask_( int *len ) #endif { unsigned int mask; mask = ~((~0) << *len); return ((int)mask); }
#include <stdio.h> void c_print_sparsemat( int, int, int *, int *, int, double * ); #if defined(CRAY_T3E) || defined(CRAY_T3D) int ONBITMASK( int *len ) #else int onbitmask_( int *len ) #endif { unsigned int mask; mask = ~((~0) << *len); return ((int)mask); } #ifdef NOCOMPILE void print_sparsemat_( int *nc, int *nr, int *cpi, int *ir, int *nnz, double *v ) { c_print_sparsemat( *nc, *nr, cpi, ir, *nnz, v ); } void c_print_sparsemat( int nc, int nr, int *cpi, int *ir, int nnz, double *v ) { int ic, colmax, cvlo, cvhi, ncv; int npr, hasprint, ii2r, iiv, iir, mask16bit; int ilab; colmax = nc < 6 ? nc : 6; mask16bit = ~((~0) << 16); /* printf("\n"); for (ic=0; ic<colmax; ++ic) { printf(" %3d %3d ", cpi[2*ic], cpi[2*ic+1] ); } printf("\n"); */ ii2r = sizeof(int)/2; /* num of labels packed per int - 16 bits per label */ npr = 1; hasprint = 1; while (hasprint) { hasprint = 0; for (ic=0; ic<colmax; ++ic) { cvlo = cpi[2*ic]; cvhi = cpi[2*ic+1]; ncv = cvhi - cvlo + 1; if ((cvlo>0)&&(ncv>=npr)) { iiv = cvlo + npr - 1; iir = iiv/ii2r + ((iiv%ii2r) ? 1 : 0); ilab = (ir[iir-1] >> (16*(iiv%ii2r))) & mask16bit; printf(" %2d %8.4f", ilab, v[iiv-1] ); ++hasprint; } else { printf(" "); } } printf("\n"); ++npr; } } #endif
Add routines to print sparse data structures
ATW: Add routines to print sparse data structures
C
mit
rangsimanketkaew/NWChem
23fdae0727101cefbb02f756edd49729b707a0b9
Practice/2d_array.c
Practice/2d_array.c
#include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <assert.h> #include <limits.h> #include <stdbool.h> int main(){ int arr[6][6]; int max = 0; int sum = 0; int n = 0; for(int arr_i = 0; arr_i < 6; arr_i++){ for(int arr_j = 0; arr_j < 6; arr_j++){ scanf("%d",&arr[arr_i][arr_j]); } } for(int arr_i = 2, mid = arr_i + 1; arr_i < 5; arr_i++){ for(int arr_j = 0; arr_j < 3; arr_j++){ if(arr_i == mid) { sum += arr[mid][arr_j + 1]; break; } else { sum += arr[arr_i][arr_j]; max = (sum > max) ? sum : max; } } } printf("%i\n", max); return max; }
#include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <assert.h> #include <limits.h> #include <stdbool.h> int hourglass(int *array); int main(){ int arr[6][6]; int max = 0; int sum = 0; int n = 0; int i = 0; int j = 0; for(int row = 0; row < 6; row++){ for(int column = 0; column < 6; column++){ scanf("%d", &arr[row][column]); } } while(n < 16) { for(int row = i; row < i + 3; row++){ for(int column = j; column < j + 3; column++){ if(row == i + 1) { sum += arr[i + 1][j + 1]; break; } sum += arr[row][column]; } } if(j + 3 < 6) { j++; } else { j = 0; i++; } if(sum > max || n == 0) { max = sum; sum = 0; } else { sum = 0; } n++; } printf("%i\n", max); return max; }
Add 2D Array - DS Challenge
Add 2D Array - DS Challenge
C
mit
Kunal57/C_Problems,Kunal57/C_Problems
fc855344ec4e97aa8de49c52c15fdb854fc2c310
Ansi.c
Ansi.c
#include <stdio.h> #include <stdlib.h> #include <string.h> /* * ʾǺ궨ʱõһּ * 1) ĺһǸ * 2) ΪͨԺǿ׳Ҫ󣬲ܶԺʹ÷κμ */ #define PRINT_GREETINGS do { \ printf("Hi there!\n"); \ } while (0) int main(const int argc, const char* const* argv) { // Invoke function via macro PRINT_GREETINGS; return 0; }
#include <stdio.h> #include <stdlib.h> #include <string.h> /* * ʾǺ궨ʱõһּ * 1) ĺһǸ * 2) ΪͨԺǿ׳Ҫ󣬲ܶԺʹ÷κμ */ #define PRINT_GREETINGS do { \ printf("Hi there!\n"); \ } while (0) int main(const int argc, const char* const* argv) { // Invoke function via macro PRINT_GREETINGS; return EXIT_SUCCESS; }
Return errorlevel with macro EXIT_SUCCESS.
Return errorlevel with macro EXIT_SUCCESS.
C
mit
niucheng/Snippets,niucheng/Snippets,niucheng/Snippets
d940b57163ff5ab118821be7ad3e9ede057f5a75
Mac/Python/macsetfiletype.c
Mac/Python/macsetfiletype.c
/* * macsetfiletype - Set the mac's idea of file type * */ #include <Files.h> #include <pascal.h> int setfiletype(name, creator, type) char *name; long creator, type; { FInfo info; unsigned char *pname; pname = c2pstr(name); if ( GetFInfo(pname, 0, &info) < 0 ) return -1; info.fdType = type; info.fdCreator = creator; return SetFInfo(pname, 0, &info); }
/* * macsetfiletype - Set the mac's idea of file type * */ #include "macdefs.h" int setfiletype(name, creator, type) char *name; long creator, type; { FInfo info; unsigned char *pname; pname = (StringPtr) c2pstr(name); if ( GetFInfo(pname, 0, &info) < 0 ) return -1; info.fdType = type; info.fdCreator = creator; return SetFInfo(pname, 0, &info); }
Make it work under MPW too.
Make it work under MPW too.
C
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
ebf2d2689de551d90965090bb991fc640a0c0d41
arch/x86/lib/usercopy.c
arch/x86/lib/usercopy.c
/* * User address space access functions. * * For licencing details see kernel-base/COPYING */ #include <linux/highmem.h> #include <linux/module.h> #include <asm/word-at-a-time.h> #include <linux/sched.h> /* * We rely on the nested NMI work to allow atomic faults from the NMI path; the * nested NMI paths are careful to preserve CR2. */ unsigned long copy_from_user_nmi(void *to, const void __user *from, unsigned long n) { unsigned long ret; if (__range_not_ok(from, n, TASK_SIZE)) return 0; /* * Even though this function is typically called from NMI/IRQ context * disable pagefaults so that its behaviour is consistent even when * called form other contexts. */ pagefault_disable(); ret = __copy_from_user_inatomic(to, from, n); pagefault_enable(); return ret; } EXPORT_SYMBOL_GPL(copy_from_user_nmi);
/* * User address space access functions. * * For licencing details see kernel-base/COPYING */ #include <linux/highmem.h> #include <linux/module.h> #include <asm/word-at-a-time.h> #include <linux/sched.h> /* * We rely on the nested NMI work to allow atomic faults from the NMI path; the * nested NMI paths are careful to preserve CR2. */ unsigned long copy_from_user_nmi(void *to, const void __user *from, unsigned long n) { unsigned long ret; if (__range_not_ok(from, n, TASK_SIZE)) return n; /* * Even though this function is typically called from NMI/IRQ context * disable pagefaults so that its behaviour is consistent even when * called form other contexts. */ pagefault_disable(); ret = __copy_from_user_inatomic(to, from, n); pagefault_enable(); return ret; } EXPORT_SYMBOL_GPL(copy_from_user_nmi);
Fix copy_from_user_nmi() return if range is not ok
perf/x86: Fix copy_from_user_nmi() return if range is not ok Commit 0a196848ca36 ("perf: Fix arch_perf_out_copy_user default"), changes copy_from_user_nmi() to return the number of remaining bytes so that it behave like copy_from_user(). Unfortunately, when the range is outside of the process memory, the return value is still the number of byte copied, eg. 0, instead of the remaining bytes. As all users of copy_from_user_nmi() were modified as part of commit 0a196848ca36, the function should be fixed to return the total number of bytes if range is not correct. Signed-off-by: Yann Droneaud <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/1435001923-30986-1-git-send-email-32f7bf5a1f07a8b363256f1773dbeada59d65244@opteya.com Signed-off-by: Ingo Molnar <[email protected]>
C
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
0ded12b69f0834a48f2310cc7f1a5f1852b2b41f
asylo/platform/posix/include/byteswap.h
asylo/platform/posix/include/byteswap.h
/* * * Copyright 2017 Asylo authors * * 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 ASYLO_PLATFORM_POSIX_INCLUDE_BYTESWAP_H_ #define ASYLO_PLATFORM_POSIX_INCLUDE_BYTESWAP_H_ #include <stdint.h> #ifdef __cplusplus extern "C" { #endif inline uint16_t bswap_16(uint16_t n) { return __builtin_bswap16(n); } inline uint32_t bswap_32(uint32_t n) { return __builtin_bswap32(n); } inline uint64_t bswap_64(uint64_t n) { return __builtin_bswap64(n); } #ifdef __cplusplus } #endif #endif // ASYLO_PLATFORM_POSIX_INCLUDE_BYTESWAP_H_
/* * * Copyright 2017 Asylo authors * * 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 ASYLO_PLATFORM_POSIX_INCLUDE_BYTESWAP_H_ #define ASYLO_PLATFORM_POSIX_INCLUDE_BYTESWAP_H_ #include <stdint.h> #ifdef __cplusplus extern "C" { #endif static inline uint16_t bswap_16(uint16_t n) { return __builtin_bswap16(n); } static inline uint32_t bswap_32(uint32_t n) { return __builtin_bswap32(n); } static inline uint64_t bswap_64(uint64_t n) { return __builtin_bswap64(n); } #ifdef __cplusplus } #endif #endif // ASYLO_PLATFORM_POSIX_INCLUDE_BYTESWAP_H_
Declare bswap functions as static inline
Declare bswap functions as static inline Change declaration to static inline to avoid multiple definition during linking. PiperOrigin-RevId: 207000800
C
apache-2.0
google/asylo,google/asylo,google/asylo,google/asylo,google/asylo,google/asylo
125eec8781231cf21041b742dccd906ef1c55738
include/integrator/path_integrator.h
include/integrator/path_integrator.h
#ifndef PATH_INTEGRATOR_H #define PATH_INTEGRATOR_H #include "surface_integrator.h" #include "renderer/renderer.h" /* * Surface integrator that uses Path tracing for computing illumination at a point on the surface */ class PathIntegrator : public SurfaceIntegrator { const int min_depth, max_depth; public: /* * Create the path tracing integrator and set the min and max depth for paths * rays are randomly stopped by Russian roulette after reaching min_depth and are stopped * at max_depth */ PathIntegrator(int min_depth, int max_depth); /* * Compute the illumination at a point on a surface in the scene */ Colorf illumination(const Scene &scene, const Renderer &renderer, const RayDifferential &ray, DifferentialGeometry &dg, Sampler &sampler, MemoryPool &pool) const override; private: /* * Trace a camera path starting from the first hit at dg returning the throughput of the * path and the BSDF of the last object hit and the direction we hit it from so that we * can connect the path to a light path */ Colorf trace_camera(const Scene &scene, const Renderer &renderer, const RayDifferential &ray, DifferentialGeometry &dg, Sampler &sampler, MemoryPool &pool, BSDF *&bsdf, Vector &w_o) const; /* * Trace a light path returning the illumination along the path and the BSDF of * of the last object hit and the direction we hit it from so that we */ Colorf trace_light(const Scene &scene, const Renderer &renderer, Sampler &sampler, MemoryPool &pool, BSDF *&bsdf, Vector &w_o) const; }; #endif
#ifndef PATH_INTEGRATOR_H #define PATH_INTEGRATOR_H #include "surface_integrator.h" #include "renderer/renderer.h" /* * Surface integrator that uses Path tracing for computing illumination at a point on the surface */ class PathIntegrator : public SurfaceIntegrator { const int min_depth, max_depth; public: /* * Create the path tracing integrator and set the min and max depth for paths * rays are randomly stopped by Russian roulette after reaching min_depth and are stopped * at max_depth */ PathIntegrator(int min_depth, int max_depth); /* * Compute the illumination at a point on a surface in the scene */ Colorf illumination(const Scene &scene, const Renderer &renderer, const RayDifferential &ray, DifferentialGeometry &dg, Sampler &sampler, MemoryPool &pool) const override; }; #endif
Remove the unused bidir functions from path tracer
Remove the unused bidir functions from path tracer
C
mit
Twinklebear/tray,Twinklebear/tray
289440851590e50387cf1a121abad63c704b84ab
src/exercise102.c
src/exercise102.c
/* * A solution to Exercise 1-2 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 <stdio.h> #include <stdlib.h> int main(void) { puts("\\a produces an audible or visual alert: \a"); puts("\\f produces a formfeed: \f"); puts("\\r produces a carriage return: \rlololol"); puts("\\v produces a vertical tab: \t"); return EXIT_SUCCESS; }
/* * A solution to Exercise 1-2 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 <stdio.h> #include <stdlib.h> int main(void) { puts("An audible or visual alert: \a"); puts("A form feed: \f"); puts("A carriage return: \r"); puts("A vertical tab: \v"); return EXIT_SUCCESS; }
Fix solution to Exercise 1-2.
Fix solution to Exercise 1-2.
C
unlicense
damiendart/knr-solutions,damiendart/knr-solutions,damiendart/knr-solutions
b0183a9c878d330245437728c658360eb84e895d
src/shared/log.h
src/shared/log.h
/* * This file is part of buxton. * * Copyright (C) 2013 Intel Corporation * * buxton is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 * of the License, or (at your option) any later version. */ #pragma once #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef DEBUG #define buxton_debug() buxton_log() #else #define buxton_debug do {} while(0); #endif /* DEBUG */ void buxton_log(const char* fmt, ...); /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
/* * This file is part of buxton. * * Copyright (C) 2013 Intel Corporation * * buxton is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 * of the License, or (at your option) any later version. */ #pragma once #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef DEBUG #define buxton_debug(...) buxton_log(__VA_ARGS__) #else #define buxton_debug(...) do {} while(0); #endif /* DEBUG */ void buxton_log(const char* fmt, ...); /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
Fix the buxton_debug macro to support arguments
Fix the buxton_debug macro to support arguments
C
lgpl-2.1
sofar/buxton,sofar/buxton
754205371f3d3bb2c1b6332fba4b7eee575fd1db
src/system_res.h
src/system_res.h
/* * system_res.h * * Author: Ben Lai, Ming Tsang, Peggy Lau * Copyright (c) 2014-2015 HKUST SmartCar Team * Refer to LICENSE for details */ namespace camera { struct SystemRes { }; }
/* * system_res.h * * Author: Ben Lai, Ming Tsang, Peggy Lau * Copyright (c) 2014-2015 HKUST SmartCar Team * Refer to LICENSE for details */ namespace camera { class Car; } namespace camera { struct SystemRes { Car *car; }; }
Add car to system res
Add car to system res
C
mit
travistang/Camera15-T1,travistang/Camera15-T1,hkust-smartcar/Camera15-T1,hkust-smartcar/Camera15-T1
98069b8a5962874e664f11dc5eb9f0ba76591eb7
src/event_detection.h
src/event_detection.h
#ifndef EVENT_DETECTION_H # define EVENT_DETECTION_H # include "scrappie_structures.h" typedef struct { size_t window_length1; size_t window_length2; float threshold1; float threshold2; float peak_height; } detector_param; static detector_param const event_detection_defaults = { .window_length1 = 3, .window_length2 = 6, .threshold1 = 1.4f, .threshold2 = 1.1f, .peak_height = 0.2f }; event_table detect_events(raw_table const rt, detector_param const edparam); #endif /* EVENT_DETECTION_H */
#ifndef EVENT_DETECTION_H # define EVENT_DETECTION_H # include "scrappie_structures.h" typedef struct { size_t window_length1; size_t window_length2; float threshold1; float threshold2; float peak_height; } detector_param; static detector_param const event_detection_defaults = { .window_length1 = 3, .window_length2 = 6, .threshold1 = 1.4f, .threshold2 = 9.0f, .peak_height = 0.2f }; event_table detect_events(raw_table const rt, detector_param const edparam); #endif /* EVENT_DETECTION_H */
Update threshold for second window
Update threshold for second window
C
mpl-2.0
nanoporetech/scrappie,nanoporetech/scrappie,nanoporetech/scrappie
1c54410af3ed87100eca258bc58533ad434e618e
testing/unittest/special_types.h
testing/unittest/special_types.h
#pragma once template <typename T, unsigned int N> struct FixedVector { T data[N]; __host__ __device__ FixedVector() { } __host__ __device__ FixedVector(T init) { for(unsigned int i = 0; i < N; i++) data[i] = init; } __host__ __device__ FixedVector operator+(const FixedVector& bs) const { FixedVector output; for(unsigned int i = 0; i < N; i++) output.data[i] = data[i] + bs.data[i]; return output; } __host__ __device__ bool operator<(const FixedVector& bs) const { for(unsigned int i = 0; i < N; i++) { if(data[i] < bs.data[i]) return true; else if(bs.data[i] < data[i]) return false; } return false; } __host__ __device__ bool operator==(const FixedVector& bs) const { for(unsigned int i = 0; i < N; i++) { if(!(data[i] == bs.data[i])) return false; } return true; } };
#pragma once template <typename T, unsigned int N> struct FixedVector { T data[N]; __host__ __device__ FixedVector() : data() { } __host__ __device__ FixedVector(T init) { for(unsigned int i = 0; i < N; i++) data[i] = init; } __host__ __device__ FixedVector operator+(const FixedVector& bs) const { FixedVector output; for(unsigned int i = 0; i < N; i++) output.data[i] = data[i] + bs.data[i]; return output; } __host__ __device__ bool operator<(const FixedVector& bs) const { for(unsigned int i = 0; i < N; i++) { if(data[i] < bs.data[i]) return true; else if(bs.data[i] < data[i]) return false; } return false; } __host__ __device__ bool operator==(const FixedVector& bs) const { for(unsigned int i = 0; i < N; i++) { if(!(data[i] == bs.data[i])) return false; } return true; } };
Initialize FixedVector's member in its null constructor to eliminate a Wall warning.
Initialize FixedVector's member in its null constructor to eliminate a Wall warning.
C
apache-2.0
google-code-export/thrust,allendaicool/thrust,hemmingway/thrust,hemmingway/thrust,levendlee/thrust,hemmingway/thrust,julianromera/thrust,levendlee/thrust,malenie/thrust,bfurtaw/thrust,rdmenezes/thrust,UIKit0/thrust,h1arshad/thrust,UIKit0/thrust,malenie/thrust,hemmingway/thrust,rdmenezes/thrust,levendlee/thrust,lishi0927/thrust,Vishwa07/thrust,rdmenezes/thrust,allendaicool/thrust,julianromera/thrust,allendaicool/thrust,julianromera/thrust,Vishwa07/thrust,Vishwa07/thrust,google-code-export/thrust,Vishwa07/thrust,allendaicool/thrust,lishi0927/thrust,UIKit0/thrust,julianromera/thrust,lishi0927/thrust,malenie/thrust,UIKit0/thrust,levendlee/thrust,h1arshad/thrust,lishi0927/thrust,bfurtaw/thrust,bfurtaw/thrust,bfurtaw/thrust,h1arshad/thrust,google-code-export/thrust,h1arshad/thrust,google-code-export/thrust,rdmenezes/thrust,malenie/thrust
cd73593a424a38f7e79b749086d6e3543ba88356
io/file_descriptor.h
io/file_descriptor.h
#ifndef FILE_DESCRIPTOR_H #define FILE_DESCRIPTOR_H #include <io/channel.h> class FileDescriptor : public Channel { LogHandle log_; protected: int fd_; public: FileDescriptor(int); ~FileDescriptor(); virtual Action *close(EventCallback *); virtual Action *read(size_t, EventCallback *); virtual Action *write(Buffer *, EventCallback *); virtual bool shutdown(bool, bool) { return (false); } }; #endif /* !FILE_DESCRIPTOR_H */
#ifndef FILE_DESCRIPTOR_H #define FILE_DESCRIPTOR_H #include <io/channel.h> class FileDescriptor : public Channel { LogHandle log_; protected: int fd_; public: FileDescriptor(int); ~FileDescriptor(); virtual Action *close(EventCallback *); virtual Action *read(size_t, EventCallback *); virtual Action *write(Buffer *, EventCallback *); virtual bool shutdown(bool, bool) { return (true); } }; #endif /* !FILE_DESCRIPTOR_H */
Return success rather than failure from shutdown() on FileDescriptor, since it is entirely immaterial.
Return success rather than failure from shutdown() on FileDescriptor, since it is entirely immaterial.
C
bsd-2-clause
wanproxy/wanproxy,wanproxy/wanproxy,wanproxy/wanproxy
8dd70959300cd08be029518be56bc64ccfe271df
test/Analysis/dump_egraph.c
test/Analysis/dump_egraph.c
// RUN: %clang_analyze_cc1 -analyzer-checker=core \ // RUN: -analyzer-dump-egraph=%t.dot %s // RUN: cat %t.dot | FileCheck %s // RUN: %clang_analyze_cc1 -analyzer-checker=core \ // RUN: -analyzer-dump-egraph=%t.dot \ // RUN: -trim-egraph %s // RUN: cat %t.dot | FileCheck %s // REQUIRES: asserts int getJ(); int foo() { int *x = 0, *y = 0; char c = '\x13'; return *x + *y; } // CHECK: \"program_points\": [\l&nbsp;&nbsp;&nbsp;&nbsp;\{ \"kind\": \"Edge\", \"src_id\": 2, \"dst_id\": 1, \"terminator\": null, \"term_kind\": null, \"tag\": null, \"node_id\": 1, \"is_sink\":0, \"has_report\": 0 \}\l&nbsp;&nbsp;],\l&nbsp;&nbsp;\"program_state\": null // CHECK: \"program_points\": [\l&nbsp;&nbsp;&nbsp;&nbsp;\{ \"kind\": \"BlockEntrance\", \"block_id\": 1 // CHECK: \"pretty\": \"*x\", \"location\": \{ \"line\": 18, \"column\": 10, \"file\": \"{{(.+)}}dump_egraph.c\" \} // CHECK: \"pretty\": \"'\\\\x13'\" // CHECK: \"has_report\": 1
// RUN: %clang_analyze_cc1 -analyzer-checker=core \ // RUN: -analyzer-dump-egraph=%t.dot %s // RUN: cat %t.dot | FileCheck %s // RUN: %clang_analyze_cc1 -analyzer-checker=core \ // RUN: -analyzer-dump-egraph=%t.dot \ // RUN: -trim-egraph %s // RUN: cat %t.dot | FileCheck %s // REQUIRES: asserts int getJ(); int foo() { int *x = 0, *y = 0; char c = '\x13'; return *x + *y; } // CHECK: \"program_points\": [\l&nbsp;&nbsp;&nbsp;&nbsp;\{ \"kind\": \"Edge\", \"src_id\": 2, \"dst_id\": 1, \"terminator\": null, \"term_kind\": null, \"tag\": null, \"node_id\": 1, \"is_sink\": 0, \"has_report\": 0 \}\l&nbsp;&nbsp;],\l&nbsp;&nbsp;\"program_state\": null // CHECK: \"program_points\": [\l&nbsp;&nbsp;&nbsp;&nbsp;\{ \"kind\": \"BlockEntrance\", \"block_id\": 1 // CHECK: \"pretty\": \"*x\", \"location\": \{ \"line\": 18, \"column\": 10, \"file\": \"{{(.+)}}dump_egraph.c\" \} // CHECK: \"pretty\": \"'\\\\x13'\" // CHECK: \"has_report\": 1
Fix typo in r375186. Unbreaks tests.
[analyzer] exploded-graph-rewriter: Fix typo in r375186. Unbreaks tests. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@375189 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
8f7bbd87a709803e90aacd4e5fd9810b110b799d
test/src/testfw.h
test/src/testfw.h
#ifndef LOG_TESTFW_H #define LOG_TESTFW_H #include <stdio.h> #define NEUTRAL "\x1B[0m" #define GREEN "\x1B[32m" #define RED "\x1B[31m" void testfw_add(void (*)(int*), const char*); int testfw_run(); #define TEST(name) void name(int*); void __attribute__((constructor)) pre_##name() {testfw_add(name, #name);} void name(int* __errors __attribute__((unused))) #define FAILED(name) fprintf(stderr, "[ %sFAILED%s ] %s (%s:%d)\n", RED, NEUTRAL, name, __FILE__, __LINE__) #define PASSED(name) printf("[ %sPASSED%s ] %s\n", GREEN, NEUTRAL, name); #define ASSERT(stmt) if (!(stmt)) {++(*__errors); FAILED(__FUNCTION__);} #endif
#ifndef LOG_TESTFW_H #define LOG_TESTFW_H #include <stdio.h> #define NEUTRAL "\x1B[0m" #define GREEN "\x1B[32m" #define RED "\x1B[31m" void testfw_add(void (*)(int*), const char*); int testfw_run(); #define TEST(name) void name(int*); void __attribute__((constructor)) pre_##name() {testfw_add(name, #name);} void name(int* __errors __attribute__((unused))) #define FAILED(name) fprintf(stderr, "[ %sFAILED%s ] %s (%s:%d)\n", RED, NEUTRAL, name, __FILE__, __LINE__) #define PASSED(name) printf("[ %sPASSED%s ] %s\n", GREEN, NEUTRAL, name); #define ASSERT(stmt) if (!(stmt)) {++(*__errors); FAILED(__func__);} #endif
Use __func__ instead of __FUNCTION__
Use __func__ instead of __FUNCTION__ __FUNCTION__ does not work with gcc version 5. https://gcc.gnu.org/gcc-5/porting_to.html.
C
bsd-3-clause
rbruggem/mqlog,rbruggem/mqlog
3ea9ea8edc499da466a8555e9424a8d92e3e7526
cc1/tests/test062.c
cc1/tests/test062.c
/* name: TEST062 description: Test for hexadecimal numbers in upper and lower case error: output: G2 I F "main { \ h #I1 } */ int main(void) { return 0xa == 0xA && 0xb == 0xB && 0xc == 0xC && 0xd == 0xD && 0xe == 0xE && 0xf == 0xF; }
Add test for hexadecimal numbers with upper and lower case
[cc1] Add test for hexadecimal numbers with upper and lower case
C
isc
k0gaMSX/scc,k0gaMSX/scc,k0gaMSX/scc
c49c6113ab8ca9293cad0fc766c6b4bd90e22a75
test/small1/strloop.c
test/small1/strloop.c
#include <testharness.h> #include <stdio.h> void BuildWord(char * pchWord) { int i; char * pch = pchWord; /* original code: * while ((i = *pch++) != '\0') { } */ do { i = *pch; pch++; } while (i != '\0'); printf("%s\n",pchWord); } int main() { char *test = "foo"; BuildWord(test); SUCCESS; }
#include <testharness.h> #include <stdio.h> void BuildWord(char * pchWord) { int i; char * pch = pchWord; /* original code: * while ((i = *pch++) != '\0') { } */ do { i = *pch; // printf("i = '%c'\n",i); pch++; } while (i != '\0'); printf("%s\n",pchWord); } int main() { char *test = "foo"; test++; test--; BuildWord(test); SUCCESS; }
Switch the world over to the new 'paper' solver. Local regression tests indicate that it shouldn't be that bad: new models and wrappers have been added to support it. INFERBOX=infer is now the new solver, INFERBOX=old gives the old behavior (will be removed later).
Switch the world over to the new 'paper' solver. Local regression tests indicate that it shouldn't be that bad: new models and wrappers have been added to support it. INFERBOX=infer is now the new solver, INFERBOX=old gives the old behavior (will be removed later).
C
bsd-3-clause
samuelhavron/obliv-c,samuelhavron/obliv-c,samuelhavron/obliv-c,samuelhavron/obliv-c
d28671f7429cc1f47346d9eb5451bc36cbc9f15d
src/zt_stdint.h
src/zt_stdint.h
#ifndef _ZT_STDINT_H_ #define _ZT_STDINT_H_ #if !defined(_MSC_VER) || _MSC_VER >= 1600 #include <stdint.h> #else typedef __int8 int8_t; typedef unsigned __int8 uint8_t; typedef __int16 int16_t; typedef unsigned __int16 uint16_t; typedef __int32 int32_t; typedef unsigned __int32 uint32_t; typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #endif #endif
#ifndef _ZT_STDINT_H_ #define _ZT_STDINT_H_ #if !defined(_MSC_VER) || _MSC_VER >= 1600 #include <stdint.h> #else typedef signed char int8_t; typedef unsigned char uint8_t; typedef short int16_t; typedef unsigned short uint16_t; typedef int int32_t; typedef unsigned int uint32_t; typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #endif #endif
Use integer types that are consistent with what tend to be the underlying types for stdint typedefs
Use integer types that are consistent with what tend to be the underlying types for stdint typedefs Windows treats signed char and __int8 as distinct types.
C
mit
zerotao/libzt,zerotao/libzt,zerotao/libzt,zerotao/libzt
cd22627f781080fb245dd6999f2158c8099379b0
py/mpconfig.h
py/mpconfig.h
// This file contains default configuration settings for MicroPython. // You can override any of these options using mpconfigport.h file located // in a directory of your port. #include <mpconfigport.h> #ifndef INT_FMT // printf format spec to use for machine_int_t and friends #ifdef __LP64__ // Archs where machine_int_t == long, long != int #define UINT_FMT "%lu" #define INT_FMT "%ld" #else // Archs where machine_int_t == int #define UINT_FMT "%u" #define INT_FMT "%d" #endif #endif //INT_FMT // Any options not explicitly set in mpconfigport.h will get default // values below. // Whether to collect memory allocation stats #ifndef MICROPY_MEM_STATS #define MICROPY_MEM_STATS (1) #endif
// This file contains default configuration settings for MicroPython. // You can override any of these options using mpconfigport.h file located // in a directory of your port. #include <mpconfigport.h> #ifndef INT_FMT // printf format spec to use for machine_int_t and friends #ifdef __LP64__ // Archs where machine_int_t == long, long != int #define UINT_FMT "%lu" #define INT_FMT "%ld" #else // Archs where machine_int_t == int #define UINT_FMT "%u" #define INT_FMT "%d" #endif #endif //INT_FMT // Any options not explicitly set in mpconfigport.h will get default // values below. // Whether to collect memory allocation stats #ifndef MICROPY_MEM_STATS #define MICROPY_MEM_STATS (1) #endif // Whether to support slice object and correspondingly // slice subscript operators #ifndef MICROPY_ENABLE_SLICE #define MICROPY_ENABLE_SLICE (1) #endif
Enable slice support in config.
Enable slice support in config.
C
mit
SHA2017-badge/micropython-esp32,selste/micropython,xyb/micropython,xuxiaoxin/micropython,suda/micropython,KISSMonX/micropython,ceramos/micropython,orionrobots/micropython,trezor/micropython,adafruit/micropython,blmorris/micropython,SungEun-Steve-Kim/test-mp,ericsnowcurrently/micropython,praemdonck/micropython,cloudformdesign/micropython,hiway/micropython,oopy/micropython,oopy/micropython,infinnovation/micropython,stonegithubs/micropython,AriZuu/micropython,alex-robbins/micropython,lbattraw/micropython,Timmenem/micropython,ericsnowcurrently/micropython,danicampora/micropython,mgyenik/micropython,puuu/micropython,alex-march/micropython,dhylands/micropython,kostyll/micropython,dxxb/micropython,cwyark/micropython,infinnovation/micropython,misterdanb/micropython,firstval/micropython,mianos/micropython,jlillest/micropython,jmarcelino/pycom-micropython,firstval/micropython,pfalcon/micropython,vriera/micropython,drrk/micropython,vitiral/micropython,cloudformdesign/micropython,mhoffma/micropython,alex-march/micropython,selste/micropython,martinribelotta/micropython,pfalcon/micropython,mgyenik/micropython,emfcamp/micropython,EcmaXp/micropython,MrSurly/micropython,noahchense/micropython,drrk/micropython,tdautc19841202/micropython,adafruit/circuitpython,warner83/micropython,oopy/micropython,skybird6672/micropython,warner83/micropython,xuxiaoxin/micropython,tobbad/micropython,pramasoul/micropython,dmazzella/micropython,toolmacher/micropython,xhat/micropython,blazewicz/micropython,ryannathans/micropython,swegener/micropython,ganshun666/micropython,suda/micropython,vriera/micropython,heisewangluo/micropython,ganshun666/micropython,cwyark/micropython,Vogtinator/micropython,feilongfl/micropython,MrSurly/micropython-esp32,neilh10/micropython,HenrikSolver/micropython,noahwilliamsson/micropython,blazewicz/micropython,blmorris/micropython,ahotam/micropython,henriknelson/micropython,lbattraw/micropython,vriera/micropython,paul-xxx/micropython,mianos/micropython,adamkh/micropython,slzatz/micropython,lowRISC/micropython,galenhz/micropython,Vogtinator/micropython,redbear/micropython,kerneltask/micropython,hosaka/micropython,vitiral/micropython,orionrobots/micropython,alex-march/micropython,chrisdearman/micropython,adafruit/micropython,firstval/micropython,swegener/micropython,alex-march/micropython,misterdanb/micropython,utopiaprince/micropython,alex-march/micropython,mianos/micropython,tobbad/micropython,praemdonck/micropython,dinau/micropython,deshipu/micropython,omtinez/micropython,Peetz0r/micropython-esp32,SungEun-Steve-Kim/test-mp,turbinenreiter/micropython,ceramos/micropython,stonegithubs/micropython,ryannathans/micropython,EcmaXp/micropython,heisewangluo/micropython,drrk/micropython,pfalcon/micropython,adafruit/circuitpython,micropython/micropython-esp32,orionrobots/micropython,hosaka/micropython,redbear/micropython,methoxid/micropystat,suda/micropython,lowRISC/micropython,skybird6672/micropython,methoxid/micropystat,henriknelson/micropython,supergis/micropython,pozetroninc/micropython,kerneltask/micropython,omtinez/micropython,ahotam/micropython,puuu/micropython,cwyark/micropython,HenrikSolver/micropython,adafruit/circuitpython,adafruit/micropython,vriera/micropython,xhat/micropython,xyb/micropython,utopiaprince/micropython,alex-robbins/micropython,PappaPeppar/micropython,ceramos/micropython,toolmacher/micropython,kostyll/micropython,rubencabrera/micropython,cwyark/micropython,aitjcize/micropython,ryannathans/micropython,EcmaXp/micropython,skybird6672/micropython,oopy/micropython,ceramos/micropython,turbinenreiter/micropython,pramasoul/micropython,MrSurly/micropython,mhoffma/micropython,cwyark/micropython,mhoffma/micropython,blmorris/micropython,vitiral/micropython,infinnovation/micropython,mgyenik/micropython,misterdanb/micropython,bvernoux/micropython,puuu/micropython,ChuckM/micropython,alex-robbins/micropython,vriera/micropython,ChuckM/micropython,skybird6672/micropython,trezor/micropython,supergis/micropython,ernesto-g/micropython,torwag/micropython,tdautc19841202/micropython,mianos/micropython,ganshun666/micropython,dmazzella/micropython,aitjcize/micropython,rubencabrera/micropython,TDAbboud/micropython,tdautc19841202/micropython,aethaniel/micropython,methoxid/micropystat,neilh10/micropython,toolmacher/micropython,ruffy91/micropython,kostyll/micropython,dhylands/micropython,slzatz/micropython,mpalomer/micropython,adafruit/circuitpython,lowRISC/micropython,SHA2017-badge/micropython-esp32,chrisdearman/micropython,Timmenem/micropython,ahotam/micropython,pozetroninc/micropython,torwag/micropython,jimkmc/micropython,micropython/micropython-esp32,dinau/micropython,matthewelse/micropython,praemdonck/micropython,kerneltask/micropython,henriknelson/micropython,ceramos/micropython,aitjcize/micropython,ernesto-g/micropython,skybird6672/micropython,aethaniel/micropython,noahchense/micropython,redbear/micropython,emfcamp/micropython,hiway/micropython,trezor/micropython,noahwilliamsson/micropython,ruffy91/micropython,AriZuu/micropython,mgyenik/micropython,torwag/micropython,swegener/micropython,Peetz0r/micropython-esp32,KISSMonX/micropython,dxxb/micropython,infinnovation/micropython,ChuckM/micropython,stonegithubs/micropython,galenhz/micropython,tobbad/micropython,praemdonck/micropython,mhoffma/micropython,tobbad/micropython,deshipu/micropython,SungEun-Steve-Kim/test-mp,MrSurly/micropython,HenrikSolver/micropython,orionrobots/micropython,slzatz/micropython,SHA2017-badge/micropython-esp32,noahwilliamsson/micropython,tuc-osg/micropython,warner83/micropython,tuc-osg/micropython,emfcamp/micropython,xuxiaoxin/micropython,PappaPeppar/micropython,rubencabrera/micropython,adamkh/micropython,Timmenem/micropython,warner83/micropython,paul-xxx/micropython,toolmacher/micropython,ernesto-g/micropython,mpalomer/micropython,ernesto-g/micropython,xhat/micropython,micropython/micropython-esp32,martinribelotta/micropython,Timmenem/micropython,ahotam/micropython,deshipu/micropython,hiway/micropython,Vogtinator/micropython,jlillest/micropython,noahchense/micropython,aitjcize/micropython,noahchense/micropython,suda/micropython,cnoviello/micropython,methoxid/micropystat,martinribelotta/micropython,xuxiaoxin/micropython,deshipu/micropython,utopiaprince/micropython,SHA2017-badge/micropython-esp32,supergis/micropython,galenhz/micropython,MrSurly/micropython-esp32,galenhz/micropython,heisewangluo/micropython,kerneltask/micropython,danicampora/micropython,trezor/micropython,chrisdearman/micropython,alex-robbins/micropython,utopiaprince/micropython,stonegithubs/micropython,jmarcelino/pycom-micropython,jimkmc/micropython,cloudformdesign/micropython,paul-xxx/micropython,vitiral/micropython,MrSurly/micropython-esp32,EcmaXp/micropython,mpalomer/micropython,TDAbboud/micropython,blazewicz/micropython,chrisdearman/micropython,paul-xxx/micropython,TDAbboud/micropython,blmorris/micropython,Vogtinator/micropython,dhylands/micropython,PappaPeppar/micropython,cloudformdesign/micropython,emfcamp/micropython,adafruit/circuitpython,trezor/micropython,xyb/micropython,jmarcelino/pycom-micropython,feilongfl/micropython,drrk/micropython,dinau/micropython,adamkh/micropython,methoxid/micropystat,pfalcon/micropython,xhat/micropython,ruffy91/micropython,warner83/micropython,tuc-osg/micropython,PappaPeppar/micropython,PappaPeppar/micropython,neilh10/micropython,tobbad/micropython,henriknelson/micropython,adafruit/circuitpython,SungEun-Steve-Kim/test-mp,pramasoul/micropython,bvernoux/micropython,infinnovation/micropython,HenrikSolver/micropython,Vogtinator/micropython,redbear/micropython,HenrikSolver/micropython,xyb/micropython,jimkmc/micropython,dinau/micropython,alex-robbins/micropython,neilh10/micropython,feilongfl/micropython,ericsnowcurrently/micropython,AriZuu/micropython,aethaniel/micropython,pfalcon/micropython,cnoviello/micropython,hosaka/micropython,kostyll/micropython,tralamazza/micropython,henriknelson/micropython,ryannathans/micropython,lbattraw/micropython,drrk/micropython,matthewelse/micropython,praemdonck/micropython,blazewicz/micropython,jlillest/micropython,utopiaprince/micropython,danicampora/micropython,noahwilliamsson/micropython,SHA2017-badge/micropython-esp32,dmazzella/micropython,paul-xxx/micropython,omtinez/micropython,dxxb/micropython,emfcamp/micropython,SungEun-Steve-Kim/test-mp,neilh10/micropython,lowRISC/micropython,galenhz/micropython,tralamazza/micropython,jlillest/micropython,kerneltask/micropython,matthewelse/micropython,jimkmc/micropython,TDAbboud/micropython,lbattraw/micropython,ChuckM/micropython,misterdanb/micropython,tdautc19841202/micropython,rubencabrera/micropython,chrisdearman/micropython,jimkmc/micropython,aethaniel/micropython,TDAbboud/micropython,dhylands/micropython,jlillest/micropython,MrSurly/micropython-esp32,micropython/micropython-esp32,Peetz0r/micropython-esp32,slzatz/micropython,tdautc19841202/micropython,supergis/micropython,mgyenik/micropython,blazewicz/micropython,turbinenreiter/micropython,hosaka/micropython,cnoviello/micropython,xhat/micropython,AriZuu/micropython,danicampora/micropython,EcmaXp/micropython,cloudformdesign/micropython,turbinenreiter/micropython,supergis/micropython,xyb/micropython,ChuckM/micropython,omtinez/micropython,slzatz/micropython,cnoviello/micropython,hiway/micropython,misterdanb/micropython,mpalomer/micropython,adafruit/micropython,dmazzella/micropython,swegener/micropython,selste/micropython,rubencabrera/micropython,mhoffma/micropython,matthewelse/micropython,suda/micropython,ahotam/micropython,redbear/micropython,ericsnowcurrently/micropython,kostyll/micropython,deshipu/micropython,martinribelotta/micropython,xuxiaoxin/micropython,ganshun666/micropython,adamkh/micropython,ruffy91/micropython,bvernoux/micropython,MrSurly/micropython,adafruit/micropython,tuc-osg/micropython,cnoviello/micropython,swegener/micropython,Peetz0r/micropython-esp32,tralamazza/micropython,hiway/micropython,dhylands/micropython,bvernoux/micropython,tralamazza/micropython,hosaka/micropython,martinribelotta/micropython,dxxb/micropython,selste/micropython,noahwilliamsson/micropython,MrSurly/micropython-esp32,matthewelse/micropython,heisewangluo/micropython,ernesto-g/micropython,lbattraw/micropython,pramasoul/micropython,AriZuu/micropython,mpalomer/micropython,ryannathans/micropython,KISSMonX/micropython,feilongfl/micropython,heisewangluo/micropython,KISSMonX/micropython,matthewelse/micropython,torwag/micropython,adamkh/micropython,lowRISC/micropython,bvernoux/micropython,ruffy91/micropython,dxxb/micropython,tuc-osg/micropython,pozetroninc/micropython,feilongfl/micropython,Timmenem/micropython,micropython/micropython-esp32,ganshun666/micropython,puuu/micropython,mianos/micropython,ericsnowcurrently/micropython,orionrobots/micropython,jmarcelino/pycom-micropython,vitiral/micropython,torwag/micropython,pozetroninc/micropython,oopy/micropython,Peetz0r/micropython-esp32,firstval/micropython,danicampora/micropython,turbinenreiter/micropython,omtinez/micropython,blmorris/micropython,selste/micropython,pozetroninc/micropython,stonegithubs/micropython,firstval/micropython,puuu/micropython,MrSurly/micropython,noahchense/micropython,pramasoul/micropython,jmarcelino/pycom-micropython,KISSMonX/micropython,dinau/micropython,toolmacher/micropython,aethaniel/micropython
b883b10aef5ff23e7ad6c9342b5d27db26632837
lib/schedule/index.c
lib/schedule/index.c
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> #include <area51/hashmap.h> #include <area51/list.h> #include <area51/log.h> #include <libxml/xmlreader.h> #include <nre/reference.h> #include <nre/schedule.h> /* * Callback to add a schedule to the crs locations map */ static bool indexAll(void *k, void *v, void *c) { int *ridId = k; struct Schedule *sched = v; struct Schedules *s = c; Node *n = list_getHead(&sched->locations); while (list_isNode(n)) { struct SchedLoc *sl = (struct SchedLoc *) n; n = list_getNext(n); struct LocationRef *l = hashmapGet(s->ref->tiploc, &sl->tpl); if (l && l->crs > 0) hashmapAddList(s->crs, &l->crs, s); } return true; } /** * Index all schedules adding them to the crs hashmap so we have a list of entries for each station * @param s */ void indexSchedules(struct Schedules *s) { logconsole("Indexing %d schedules", hashmapSize(s->schedules)); // Run through each crs hashmapForEach(s->schedules, indexAll, s); }
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> #include <area51/hashmap.h> #include <area51/list.h> #include <area51/log.h> #include <nre/reference.h> #include <nre/schedule.h> /* * Callback to add a schedule to the crs locations map */ static bool indexAll(void *k, void *v, void *c) { int *ridId = k; struct Schedule *sched = v; struct Schedules *s = c; Node *n = list_getHead(&sched->locations); while (list_isNode(n)) { struct SchedLoc *sl = (struct SchedLoc *) n; n = list_getNext(n); struct LocationRef *l = hashmapGet(s->ref->tiploc, &sl->tpl); if (l && l->crs > 0) hashmapAddList(s->crs, &l->crs, sched); } return true; } /** * Index all schedules adding them to the crs hashmap so we have a list of entries for each station * @param s */ void indexSchedules(struct Schedules *s) { logconsole("Indexing %d schedules", hashmapSize(s->schedules)); // Run through each crs hashmapForEach(s->schedules, indexAll, s); }
Index schedule not the main struct
Index schedule not the main struct
C
apache-2.0
peter-mount/departureboards,peter-mount/departureboards,peter-mount/departureboards
87b199ef6122299199b14b0ed971558b03b97526
vm.h
vm.h
#define TREE // A mapping of a chunk of an address space to // a specific memory object. enum vmatype { PRIVATE, COW}; struct vma { uptr va_start; // start of mapping uptr va_end; // one past the last byte enum vmatype va_type; struct vmnode *n; struct spinlock lock; // serialize fault/unmap char lockname[16]; }; // A memory object (physical pages or inode). enum vmntype { EAGER, ONDEMAND}; struct vmnode { u64 npages; char *page[128]; u64 ref; enum vmntype type; struct inode *ip; u64 offset; u64 sz; }; // An address space: a set of vmas plus h/w page table. // The elements of e[] are not ordered by address. struct vmap { #ifdef TREE // struct node* root; struct crange* cr; #else struct vma* e[16]; #endif struct spinlock lock; // serialize map/lookup/unmap u64 ref; u64 alloc; pml4e_t *pml4; // Page table char lockname[16]; };
//#define TREE // A mapping of a chunk of an address space to // a specific memory object. enum vmatype { PRIVATE, COW}; struct vma { uptr va_start; // start of mapping uptr va_end; // one past the last byte enum vmatype va_type; struct vmnode *n; struct spinlock lock; // serialize fault/unmap char lockname[16]; }; // A memory object (physical pages or inode). enum vmntype { EAGER, ONDEMAND}; struct vmnode { u64 npages; char *page[128]; u64 ref; enum vmntype type; struct inode *ip; u64 offset; u64 sz; }; // An address space: a set of vmas plus h/w page table. // The elements of e[] are not ordered by address. struct vmap { #ifdef TREE // struct node* root; struct crange* cr; #else struct vma* e[16]; #endif struct spinlock lock; // serialize map/lookup/unmap u64 ref; u64 alloc; pml4e_t *pml4; // Page table char lockname[16]; };
Disable crange while fixing bugs in other systems.
Disable crange while fixing bugs in other systems.
C
mit
aclements/sv6,bowlofstew/sv6,bowlofstew/sv6,aclements/sv6,bowlofstew/sv6,aclements/sv6,aclements/sv6,aclements/sv6,bowlofstew/sv6,bowlofstew/sv6
c7ec6be4fb2c243155bcba7a41262fe683933ea9
sys/sys/snoop.h
sys/sys/snoop.h
/* * Copyright (c) 1995 Ugen J.S.Antsilevich * * Redistribution and use in source forms, with and without modification, * are permitted provided that this entire comment appears intact. * * Redistribution in binary form may occur without any restrictions. * Obviously, it would be nice if you gave credit where credit is due * but requiring it would be too onerous. * * This software is provided ``AS IS'' without any warranties of any kind. * * Snoop stuff. * * $FreeBSD$ */ #ifndef _SYS_SNOOP_H_ #define _SYS_SNOOP_H_ #include <sys/ioccom.h> /* * Theese are snoop io controls * SNPSTTY accepts 'struct snptty' as input. * If ever type or unit set to -1,snoop device * detached from its current tty. */ #define SNPSTTY _IOW('T', 90, dev_t) #define SNPGTTY _IOR('T', 89, dev_t) /* * Theese values would be returned by FIONREAD ioctl * instead of number of characters in buffer in case * of specific errors. */ #define SNP_OFLOW -1 #define SNP_TTYCLOSE -2 #define SNP_DETACH -3 #endif /* !_SYS_SNOOP_H_ */
/* * Copyright (c) 1995 Ugen J.S.Antsilevich * * Redistribution and use in source forms, with and without modification, * are permitted provided that this entire comment appears intact. * * Redistribution in binary form may occur without any restrictions. * Obviously, it would be nice if you gave credit where credit is due * but requiring it would be too onerous. * * This software is provided ``AS IS'' without any warranties of any kind. * * Snoop stuff. * * $FreeBSD$ */ #ifndef _SYS_SNOOP_H_ #define _SYS_SNOOP_H_ #ifndef _KERNEL #include <sys/types.h> #endif #include <sys/ioccom.h> /* * Theese are snoop io controls * SNPSTTY accepts 'struct snptty' as input. * If ever type or unit set to -1,snoop device * detached from its current tty. */ #define SNPSTTY _IOW('T', 90, dev_t) #define SNPGTTY _IOR('T', 89, dev_t) /* * Theese values would be returned by FIONREAD ioctl * instead of number of characters in buffer in case * of specific errors. */ #define SNP_OFLOW -1 #define SNP_TTYCLOSE -2 #define SNP_DETACH -3 #endif /* !_SYS_SNOOP_H_ */
Include <sys/types.h> in the !_KERNEL case so that this file is self-sufficient in that case (it needs dev_t). This is normal pollution for most headers that define ioctl numbers.
Include <sys/types.h> in the !_KERNEL case so that this file is self-sufficient in that case (it needs dev_t). This is normal pollution for most headers that define ioctl numbers.
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
02139c2e5a05287105b41c9a418f2a6f848d484d
src/clientversion.h
src/clientversion.h
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 1 #define CLIENT_VERSION_MINOR 0 #define CLIENT_VERSION_REVISION 1 #define CLIENT_VERSION_BUILD 0 // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! #define STRINGIZE(X) DO_STRINGIZE(X) #define DO_STRINGIZE(X) #X #endif // CLIENTVERSION_H
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 1 #define CLIENT_VERSION_MINOR 0 #define CLIENT_VERSION_REVISION 0 #define CLIENT_VERSION_BUILD 0 // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! #define STRINGIZE(X) DO_STRINGIZE(X) #define DO_STRINGIZE(X) #X #endif // CLIENTVERSION_H
Revert "client version to 1.0.1"
Revert "client version to 1.0.1" This reverts commit 4d1baddde849c46969e1d189224cc1a507c33b01.
C
mit
boxxa/SMAC,boxxa/SMAC,boxxa/SMAC,boxxa/SMAC,boxxa/SMAC
efb2710d75e39e0297d88636001c43185a92c407
vector/Dot.h
vector/Dot.h
//##################################################################### // Function Dot //##################################################################### #pragma once namespace other { template<class T,int d> class Vector; inline float dot(const float a1,const float a2) {return a1*a2;} inline double dot(const double a1,const double a2) {return a1*a2;} template<class T,int d> inline double dot_double_precision(const Vector<T,d>& v1,const Vector<T,d>& v2) {return dot(v1,v2);} inline double dot_double_precision(const float a1,const float a2) {return a1*a2;} inline double dot_double_precision(const double a1,const double a2) {return a1*a2;} }
//##################################################################### // Function Dot //##################################################################### #pragma once namespace other { template<class T,int d> class Vector; static inline float dot(const float a1,const float a2) {return a1*a2;} static inline double dot(const double a1,const double a2) {return a1*a2;} template<class T,int d> static inline double dot_double_precision(const Vector<T,d>& v1,const Vector<T,d>& v2) {return dot(v1,v2);} static inline double dot_double_precision(const float a1,const float a2) {return a1*a2;} static inline double dot_double_precision(const double a1,const double a2) {return a1*a2;} }
Mark some functions static inline
vector/dot: Mark some functions static inline
C
bsd-3-clause
omco/geode,mikest/geode,omco/geode,mikest/geode,mikest/geode,omco/geode,omco/geode,mikest/geode
2a89aa4717266b044b3dae5a235f3ecc6610f4d2
week1/task.c
week1/task.c
#include <stdio.h> #include <fcntl.h> #include <unistd.h> int main(int argc, char* argv[]) { int f; if (argc > 1) f = open(argv[1], O_RDONLY); else f = open("aa", O_RDONLY); int i, readCount; char buffer[5]; for(i = 5; i >= 1; --i) { execlp("wc", "wc", "-l", "aa", 0); lseek(f, -3, SEEK_END); readCount = read(f, buffer, i); write(1, buffer, readCount); } return 0; }
Add old file from week1
Add old file from week1
C
mit
zdravkoandonov/sysprog
ad315659a48175b2875adc400413808a68d951ca
src/libaten/types.h
src/libaten/types.h
#pragma once #include <stdint.h> #include <climits> //#define TYPE_DOUBLE #ifdef TYPE_DOUBLE using real = double; #else using real = float; #endif
#pragma once #include <stdint.h> #include <climits> //#define TYPE_DOUBLE #ifdef TYPE_DOUBLE using real = double; #define AT_IS_TYPE_DOUBLE (true) #else using real = float; #define AT_IS_TYPE_DOUBLE (false) #endif
Add macro to know if "real" is double.
Add macro to know if "real" is double.
C
mit
nakdai/aten,nakdai/aten
93c2f9bd8b058b28016e6db2421e5b38eac0606c
src/unionfs.h
src/unionfs.h
/* * License: BSD-style license * Copyright: Radek Podgorny <[email protected]>, * Bernd Schubert <[email protected]> */ #ifndef UNIONFS_H #define UNIONFS_H #define PATHLEN_MAX 1024 #define HIDETAG "_HIDDEN~" #define METANAME ".unionfs-fuse" #define METADIR (METANAME "/") // string concetanation! // fuse meta files, we might want to hide those #define FUSE_META_FILE ".fuse_hidden" #define FUSE_META_LENGTH 12 // file access protection mask #define S_PROT_MASK (S_ISUID| S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) typedef struct { char *path; int path_len; // strlen(path) int fd; // used to prevent accidental umounts of path unsigned char rw; // the writable flag } branch_entry_t; #endif
/* * License: BSD-style license * Copyright: Radek Podgorny <[email protected]>, * Bernd Schubert <[email protected]> */ #ifndef UNIONFS_H #define UNIONFS_H #define PATHLEN_MAX 1024 #define HIDETAG "_HIDDEN~" #define METANAME ".unionfs" #define METADIR (METANAME "/") // string concetanation! // fuse meta files, we might want to hide those #define FUSE_META_FILE ".fuse_hidden" #define FUSE_META_LENGTH 12 // file access protection mask #define S_PROT_MASK (S_ISUID| S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) typedef struct { char *path; int path_len; // strlen(path) int fd; // used to prevent accidental umounts of path unsigned char rw; // the writable flag } branch_entry_t; #endif
Revert to old pre-1.0 meta directory
Revert to old pre-1.0 meta directory Unionfs changed its meta directory from .unionfs to .unionfs-fuse with the unionfs -> unionfs-fuse rename. The rename later got reverted everywhere but the meta directory, so now unionfs doesn't find the whiteout files from older releases. Revert back to the pre-1.0 behaviour to fix this. Signed-off-by: Peter Korsgaard <[email protected]>
C
bsd-3-clause
evnu/unionfs-fuse,evnu/unionfs-fuse,yogoloth/unionfs-fuse,yogoloth/unionfs-fuse,yogoloth/unionfs-fuse,evnu/unionfs-fuse
a1a426ea206ffa5ad8aea089f7d70d8d04a3a210
crypto/opensslv.h
crypto/opensslv.h
#ifndef HEADER_OPENSSLV_H #define HEADER_OPENSSLV_H /* Numeric release version identifier: * MMNNFFRBB: major minor fix final beta/patch * For example: * 0.9.3-dev 0x00903000 * 0.9.3beta1 0x00903001 * 0.9.3beta2-dev 0x00903002 * 0.9.3beta2 0x00903002 (same as ...beta2-dev) * 0.9.3 0x00903100 * 0.9.3a 0x00903101 * 0.9.4 0x00904100 * 1.2.3z 0x1020311a * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) */ #define OPENSSL_VERSION_NUMBER 0x00905002L #define OPENSSL_VERSION_TEXT "OpenSSL 0.9.5beta2-dev 24 Feb 2000" #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT #endif /* HEADER_OPENSSLV_H */
#ifndef HEADER_OPENSSLV_H #define HEADER_OPENSSLV_H /* Numeric release version identifier: * MMNNFFRBB: major minor fix final beta/patch * For example: * 0.9.3-dev 0x00903000 * 0.9.3beta1 0x00903001 * 0.9.3beta2-dev 0x00903002 * 0.9.3beta2 0x00903002 (same as ...beta2-dev) * 0.9.3 0x00903100 * 0.9.3a 0x00903101 * 0.9.4 0x00904100 * 1.2.3z 0x1020311a * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) */ #define OPENSSL_VERSION_NUMBER 0x00905002L #define OPENSSL_VERSION_TEXT "OpenSSL 0.9.5beta2 27 Feb 2000" #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT #endif /* HEADER_OPENSSLV_H */
Change version string to reflect the release of beta 2.
Change version string to reflect the release of beta 2.
C
apache-2.0
openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl
545ae42ea7d0489da564dd61fd3b1b18bf0ebe9c
kernel/arch/x86/boot/boot.h
kernel/arch/x86/boot/boot.h
#ifndef __BOOT_H__ #define __BOOT_H__ /* multiboot definitions */ #define MB_HEADER_MAGIC 0x1BADB002 #define MB_BOOT_MAGIC 0x2BADB002 #define MB_PAGE_ALIGN 0x00000001 #define MB_MEMORY_INFO 0x00000002 /* common boot definitions */ #define BOOT_TIME_STACK_SIZE 0x4000 #endif /*__BOOT_H__*/
#ifndef __BOOT_H__ #define __BOOT_H__ /* multiboot definitions */ #define MB_HEADER_MAGIC 0x1BADB002 #define MB_BOOT_MAGIC 0x2BADB002 #define MB_PAGE_ALIGN 0x00000001 #define MB_MEMORY_INFO 0x00000002 /* common boot definitions */ #define BOOT_TIME_STACK_SIZE 0x4000 #define BOOT_CS_ENTRY 1 #define BOOT_CS (BOOT_CS_ENTRY << 3) #define BOOT_DS_ENTRY 2 #define BOOT_DS (BOOT_DS_ENTRY << 3) #define PTE_INIT_ATTR 0x00000003 #define PDE_INIT_ATTR 0x00000003 #endif /*__BOOT_H__*/
Add code and data segments definitions.
Add code and data segments definitions. This patch adds boot time data and code segments definitions.
C
mit
krinkinmu/auos,krinkinmu/auos,krinkinmu/auos,krinkinmu/auos
4c1fdd21e54c1a7192b4c84a15f88361af466894
autotests/vktestbase.h
autotests/vktestbase.h
/* * Unit tests for libkvkontakte. * Copyright (C) 2015 Alexander Potashev <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef VKTESTBASE_H #define VKTESTBASE_H #include <libkvkontakte/apppermissions.h> #include <QtCore/QObject> #include <QtCore/QVector> namespace Vkontakte { class VkApi; } class VkTestBase : public QObject { Q_OBJECT public: VkTestBase(); ~VkTestBase(); protected: void authenticate(Vkontakte::AppPermissions::Value permissions); QString accessToken() const; private: QString getSavedToken() const; Vkontakte::VkApi *m_vkapi; }; #endif // VKTESTBASE_H
/* * Unit tests for libkvkontakte. * Copyright (C) 2015 Alexander Potashev <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef VKTESTBASE_H #define VKTESTBASE_H #include <libkvkontakte/apppermissions.h> #include <QtCore/QObject> #include <QtCore/QVector> namespace Vkontakte { class VkApi; } class VkTestBase : public QObject { Q_OBJECT public: VkTestBase(); virtual ~VkTestBase(); protected: void authenticate(Vkontakte::AppPermissions::Value permissions); QString accessToken() const; private: QString getSavedToken() const; Vkontakte::VkApi *m_vkapi; }; #endif // VKTESTBASE_H
Fix memory leak by making dtor virtual
VkTestBase: Fix memory leak by making dtor virtual
C
lgpl-2.1
KDE/libkvkontakte,KDE/libkvkontakte
2257bf9a133c6b5c96c28578fff59910b017f335
engine/src/common/pixelboost/graphics/device/vertexBuffer.h
engine/src/common/pixelboost/graphics/device/vertexBuffer.h
#pragma once #include "pixelboost/graphics/device/bufferFormats.h" namespace pb { class GraphicsDevice; struct Vertex_P3 { float position[3]; float __padding; }; struct Vertex_P3_UV { float position[3]; float uv[2]; float __padding[3]; // for 32-byte alignment }; struct Vertex_P3_C4 { float position[3]; float color[4]; }; struct Vertex_P3_C4_UV { float position[3]; float uv[2]; float color[4]; float __padding[2]; // for 48-byte alignment }; struct Vertex_P3_N3_UV { float position[3]; float normal[3]; float uv[2]; }; struct Vertex_P3_N3_UV_BW { float position[3]; float normal[3]; float uv[2]; char bones[4]; float boneWeights[4]; }; class VertexBuffer { protected: VertexBuffer(GraphicsDevice* device, BufferFormat bufferFormat, VertexFormat vertexFormat, int maxSize); ~VertexBuffer(); public: BufferFormat GetBufferFormat(); VertexFormat GetVertexFormat(); int GetMaxSize(); int GetCurrentSize(); void* GetData(); void Lock(); void Unlock(int numElements=-1); private: GraphicsDevice* _Device; BufferFormat _BufferFormat; VertexFormat _VertexFormat; int _MaxSize; int _CurrentSize; void* _Data; int _Locked; friend class GraphicsDevice; }; }
#pragma once #include "pixelboost/graphics/device/bufferFormats.h" namespace pb { class GraphicsDevice; struct Vertex_P3 { float position[3]; }; struct Vertex_P3_UV { float position[3]; float uv[2]; }; struct Vertex_P3_C4 { float position[3]; float color[4]; }; struct Vertex_P3_C4_UV { float position[3]; float uv[2]; float color[4]; }; struct Vertex_P3_N3_UV { float position[3]; float normal[3]; float uv[2]; }; struct Vertex_P3_N3_UV_BW { float position[3]; float normal[3]; float uv[2]; char bones[4]; float boneWeights[4]; }; class VertexBuffer { protected: VertexBuffer(GraphicsDevice* device, BufferFormat bufferFormat, VertexFormat vertexFormat, int maxSize); ~VertexBuffer(); public: BufferFormat GetBufferFormat(); VertexFormat GetVertexFormat(); int GetMaxSize(); int GetCurrentSize(); void* GetData(); void Lock(); void Unlock(int numElements=-1); private: GraphicsDevice* _Device; BufferFormat _BufferFormat; VertexFormat _VertexFormat; int _MaxSize; int _CurrentSize; void* _Data; int _Locked; friend class GraphicsDevice; }; }
Remove padding from vertex buffers
Remove padding from vertex buffers
C
mit
pixelballoon/pixelboost,pixelballoon/pixelboost,pixelballoon/pixelboost,pixelballoon/pixelboost,pixelballoon/pixelboost
5d7f99083bba3bf34f6fc715683b33989842c0c2
docs/example/example.c
docs/example/example.c
#include <chopsui.h> void say_hi_clicked(sui_t *button, sui_event_t *event) { sui_alert("Hello world!"); } void exit_clicked(sui_t *button, sui_event_t *event) { sui_exit(); } int main(int argc, char **argv) { init_sui(); sui_t *window = sui_load("window.sui"); sui_load_css("window.css"); sui_add_handler(window, exit_clicked); sui_add_handler(window, say_hi_clicked); sui_show(window); sui_run(); return 0; }
#include <chopsui.h> void say_hi_clicked(sui_t *button, sui_event_t *event) { sui_alert("Hello world!"); } void exit_clicked(sui_t *button, sui_event_t *event) { sui_exit(); } int main(int argc, char **argv) { init_sui(); sui_t *window = sui_load("window.sui"); sui_css_t *css = sui_load_css("window.css"); sui_add_handler(window, exit_clicked); sui_add_handler(window, say_hi_clicked); sui_style(window, css); sui_show(window); sui_run(); return 0; }
Change how CSS would be used
Change how CSS would be used
C
mit
GrayHatter/chopsui,GrayHatter/chopsui
b814282dc2db635d31fbe219e99a423337aa2dbf
alsa.c
alsa.c
#include <alsa/asoundlib.h> snd_seq_t *hdl; static snd_midi_event_t *mbuf; static int midiport; /* open */ int midiopen(void) { snd_midi_event_new(32, &mbuf); if (snd_seq_open(&hdl, "default", SND_SEQ_OPEN_OUTPUT, 0) != 0) { return 1; } else { snd_seq_set_client_name(hdl, "svmidi"); if ((midiport = snd_seq_create_simple_port(hdl, "svmidi", SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_SUBS_READ, SND_SEQ_PORT_TYPE_APPLICATION)) < 0) { return 1; } return 0; } } /* send message */ void _midisend(unsigned char message[], size_t count) { snd_seq_event_t ev; snd_midi_event_encode(mbuf, message, count, &ev); snd_seq_ev_set_subs(&ev); snd_seq_ev_set_direct(&ev); snd_seq_ev_set_source(&ev, midiport); snd_seq_event_output_direct(hdl, &ev); } /* close */ void midiclose(void) { snd_midi_event_free(mbuf); snd_seq_close(hdl); }
#include <alsa/asoundlib.h> snd_seq_t *hdl; static snd_midi_event_t *mbuf; static int midiport; /* open */ int midiopen(void) { snd_midi_event_new(32, &mbuf); if (snd_seq_open(&hdl, "default", SND_SEQ_OPEN_OUTPUT, 0) != 0) { return 1; } else { snd_seq_set_client_name(hdl, "svmidi"); if ((midiport = snd_seq_create_simple_port(hdl, "svmidi", SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_SUBS_READ, SND_SEQ_PORT_TYPE_APPLICATION)) < 0) { return 1; } return 0; } } /* send message */ void midisend(unsigned char message[], size_t count) { snd_seq_event_t ev; snd_midi_event_encode(mbuf, message, count, &ev); snd_seq_ev_set_subs(&ev); snd_seq_ev_set_direct(&ev); snd_seq_ev_set_source(&ev, midiport); snd_seq_event_output_direct(hdl, &ev); } /* close */ void midiclose(void) { snd_midi_event_free(mbuf); snd_seq_close(hdl); }
Fix undefined reference to "midisend" when using ALSA
Fix undefined reference to "midisend" when using ALSA Signed-off-by: Henrique N. Lengler <[email protected]>
C
isc
henriqueleng/svmidi
3a020666627b551cca4bbd863bc4570914e2e952
src/util/scroll_layer.h
src/util/scroll_layer.h
#pragma once #include <pebble.h> #include "simply/simply.h" static inline ClickConfigProvider scroll_layer_click_config_provider_accessor(ClickConfigProvider provider) { static ClickConfigProvider s_provider; if (provider) { s_provider = provider; } return s_provider; } static inline void scroll_layer_click_config(void *context) { window_set_click_context(BUTTON_ID_UP, context); window_set_click_context(BUTTON_ID_DOWN, context); scroll_layer_click_config_provider_accessor(NULL)(context); } static inline void scroll_layer_set_click_config_provider_onto_window(ScrollLayer *scroll_layer, ClickConfigProvider click_config_provider, Window *window, void *context) { scroll_layer_set_click_config_onto_window(scroll_layer, window); scroll_layer_click_config_provider_accessor(window_get_click_config_provider(window)); window_set_click_config_provider_with_context(window, click_config_provider, context); }
Add scroll layer click config override helpers
Add scroll layer click config override helpers
C
mit
youtux/pebblejs,dhpark/pebblejs,daduke/LMSController,stephanpavlovic/pebble-kicker-app,Scoutski/pebblejs,robinkam/pebblejs,youtux/pebblejs,jiangege/pebblejs-project,dhpark/pebblejs,ishepard/TransmissionTorrent,pebble/pebblejs,fletchto99/pebblejs,dhpark/pebblejs,demophoon/Trimet-Tracker,nickarino/pebble_reminder_js,bkbilly/Tvheadend-EPG,nickarino/pebble_reminder_js,ento/pebblejs,fletchto99/pebblejs,carlo-colombo/dublin-bus-pebble,kylepotts/fooder,tbloncar/pebble-sitestatus,ento/pebblejs,robinkam/pebblejs,sunshineyyy/CatchOneBus,daduke/LMSController,daduke/LMSController,ento/pebblejs,lavinjj/pebblejs,gwijsman/OpenRemotePebble,LeZuse/pebble-transit-app,Scoutski/pebblejs,ento/pebblejs,pebble/pebblejs,ishepard/TransmissionTorrent,robinkam/pebblejs,demophoon/Trimet-Tracker,Scoutski/pebblejs,jsfi/pebblejs,bkbilly/Tvheadend-EPG,dennisdegreef/foober,youtux/pebblejs,lavinjj/pebblejs,nickarino/pebble_reminder_js,ishepard/TransmissionTorrent,nickarino/pebble_reminder_js,effata/pebblejs,gwijsman/OpenRemotePebble,carlo-colombo/dublin-bus-pebble,jiangege/pebblejs-project,sunshineyyy/CatchOneBus,effata/pebblejs,zanesalvatore/transit-watcher,carlo-colombo/dublin-bus-pebble,stephanpavlovic/pebble-kicker-app,dhpark/pebblejs,bkbilly/Tvheadend-EPG,zanesalvatore/transit-watcher,ishepard/TransmissionTorrent,bkbilly/Tvheadend-EPG,robinkam/pebblejs,fletchto99/pebblejs,kylepotts/fooder,effata/pebblejs,youtux/PebbleShows,tbloncar/pebble-sitestatus,demophoon/Trimet-Tracker,Scoutski/pebblejs,fletchto99/pebblejs,lavinjj/pebblejs,frizzr/CatchOneBus,jiangege/pebblejs-project,pebble/pebblejs,frizzr/CatchOneBus,robinkam/pebblejs,LeZuse/pebble-transit-app,lavinjj/pebblejs,nickarino/pebble_reminder_js,lavinjj/pebblejs,carlo-colombo/dublin-bus-pebble,kylepotts/fooder,gwijsman/OpenRemotePebble,effata/pebblejs,stephanpavlovic/pebble-kicker-app,arekom/pebble-github,effata/pebblejs,frizzr/CatchOneBus,stephanpavlovic/pebble-kicker-app,jsfi/pebblejs,kylepotts/fooder,jsfi/pebblejs,dennisdegreef/foober,carlo-colombo/dublin-bus-pebble,zanesalvatore/transit-watcher,ento/pebblejs,gwijsman/OpenRemotePebble,nickarino/pebble_reminder_js,demophoon/Trimet-Tracker,tbloncar/pebble-sitestatus,ishepard/TransmissionTorrent,pebble/pebblejs,dennisdegreef/foober,LeZuse/pebble-transit-app,LeZuse/pebble-transit-app,tbloncar/pebble-sitestatus,zanesalvatore/transit-watcher,jsfi/pebblejs,arekom/pebble-github,youtux/PebbleShows,arekom/pebble-github,jsfi/pebblejs,arekom/pebble-github,sunshineyyy/CatchOneBus,dhpark/pebblejs,youtux/pebblejs,youtux/PebbleShows,robinkam/pebblejs,daduke/LMSController,pebble/pebblejs,tbloncar/pebble-sitestatus,sunshineyyy/CatchOneBus,daduke/LMSController,gwijsman/OpenRemotePebble,dennisdegreef/foober,fletchto99/pebblejs,youtux/PebbleShows,stephanpavlovic/pebble-kicker-app,dennisdegreef/foober,frizzr/CatchOneBus,demophoon/Trimet-Tracker,zanesalvatore/transit-watcher,arekom/pebble-github,jiangege/pebblejs-project,sunshineyyy/CatchOneBus,kylepotts/fooder,jiangege/pebblejs-project,Scoutski/pebblejs,youtux/pebblejs,LeZuse/pebble-transit-app,bkbilly/Tvheadend-EPG
db3de3779b73a2919c193fa3bd85d1295a0e54ef
src/vast/query/search.h
src/vast/query/search.h
#ifndef VAST_QUERY_SEARCH_H #define VAST_QUERY_SEARCH_H #include <unordered_map> #include <cppa/cppa.hpp> #include <ze/event.h> #include <vast/query/query.h> namespace vast { namespace query { class search : public cppa::sb_actor<search> { friend class cppa::sb_actor<search>; public: search(cppa::actor_ptr archive, cppa::actor_ptr index); private: std::vector<cppa::actor_ptr> queries_; std::multimap<cppa::actor_ptr, cppa::actor_ptr> clients_; cppa::actor_ptr archive_; cppa::actor_ptr index_; cppa::behavior init_state; }; } // namespace query } // namespace vast #endif
#ifndef VAST_QUERY_SEARCH_H #define VAST_QUERY_SEARCH_H #include <unordered_map> #include <cppa/cppa.hpp> #include <ze/event.h> #include <vast/query/query.h> namespace vast { namespace query { class search : public cppa::sb_actor<search> { friend class cppa::sb_actor<search>; public: search(cppa::actor_ptr archive, cppa::actor_ptr index); private: std::vector<cppa::actor_ptr> queries_; std::unordered_multimap<cppa::actor_ptr, cppa::actor_ptr> clients_; cppa::actor_ptr archive_; cppa::actor_ptr index_; cppa::behavior init_state; }; } // namespace query } // namespace vast #endif
Use an unordered map to track clients.
Use an unordered map to track clients.
C
bsd-3-clause
pmos69/vast,mavam/vast,vast-io/vast,vast-io/vast,pmos69/vast,pmos69/vast,mavam/vast,vast-io/vast,mavam/vast,mavam/vast,vast-io/vast,pmos69/vast,vast-io/vast
7967b5fd99e3f157711648a26a2aa309c60cf842
src/util/util_time.h
src/util/util_time.h
/* * Copyright 2011-2013 Blender 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 __UTIL_TIME_H__ #define __UTIL_TIME_H__ CCL_NAMESPACE_BEGIN /* Give current time in seconds in double precision, with good accuracy. */ double time_dt(); /* Sleep for the specified number of seconds */ void time_sleep(double t); class scoped_timer { public: scoped_timer(double *value) : value_(value) { if(value_ != NULL) { time_start_ = time_dt(); } } ~scoped_timer() { if(value_ != NULL) { *value_ = time_dt() - time_start_; } } protected: double *value_; double time_start_; }; CCL_NAMESPACE_END #endif
/* * Copyright 2011-2013 Blender 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 __UTIL_TIME_H__ #define __UTIL_TIME_H__ CCL_NAMESPACE_BEGIN /* Give current time in seconds in double precision, with good accuracy. */ double time_dt(); /* Sleep for the specified number of seconds */ void time_sleep(double t); class scoped_timer { public: scoped_timer(double *value) : value_(value) { time_start_ = time_dt(); } ~scoped_timer() { if(value_ != NULL) { *value_ = time_dt() - time_start_; } } protected: double *value_; double time_start_; }; CCL_NAMESPACE_END #endif
Fix Uninitialized Value compiler warning in the scoped_timer
Fix Uninitialized Value compiler warning in the scoped_timer Although the code made it impossible to use time_start_ uninitialized, at least GCC did still produce multiple warnings about it. Since time_dt() is an extremely cheap operation and functionality does not change in any way when removing the check in the constructor, this commit removes the check and therefore the warning.
C
apache-2.0
tangent-opensource/coreBlackbird,tangent-opensource/coreBlackbird,tangent-opensource/coreBlackbird
22d68da72421c17ee15e0c7be71740b10a93ee9e
testing/platform_test.h
testing/platform_test.h
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef TESTING_PLATFORM_TEST_H_ #define TESTING_PLATFORM_TEST_H_ #include <gtest/gtest.h> #if defined(GTEST_OS_MAC) #ifdef __OBJC__ @class NSAutoreleasePool; #else class NSAutoreleasePool; #endif // The purpose of this class us to provide a hook for platform-specific // operations across unit tests. For example, on the Mac, it creates and // releases an outer NSAutoreleasePool for each test case. For now, it's only // implemented on the Mac. To enable this for another platform, just adjust // the #ifdefs and add a platform_test_<platform>.cc implementation file. class PlatformTest : public testing::Test { protected: PlatformTest(); virtual ~PlatformTest(); private: NSAutoreleasePool* pool_; }; #else typedef testing::Test PlatformTest; #endif // GTEST_OS_MAC #endif // TESTING_PLATFORM_TEST_H_
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef TESTING_PLATFORM_TEST_H_ #define TESTING_PLATFORM_TEST_H_ #include <gtest/gtest.h> #if defined(GTEST_OS_MAC) #ifdef __OBJC__ @class NSAutoreleasePool; #else class NSAutoreleasePool; #endif // The purpose of this class us to provide a hook for platform-specific // operations across unit tests. For example, on the Mac, it creates and // releases an outer NSAutoreleasePool for each test case. For now, it's only // implemented on the Mac. To enable this for another platform, just adjust // the #ifdefs and add a platform_test_<platform>.cc implementation file. class PlatformTest : public testing::Test { public: virtual ~PlatformTest(); protected: PlatformTest(); private: NSAutoreleasePool* pool_; }; #else typedef testing::Test PlatformTest; #endif // GTEST_OS_MAC #endif // TESTING_PLATFORM_TEST_H_
Change visibility of the destructor to public.
Change visibility of the destructor to public. PlatformTest's destructor was set as protected, though the parent class testing::Test declares it public. BUG=none Review URL: https://chromiumcodereview.appspot.com/11038058 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@161352 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
pozdnyakov/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,ondra-novak/chromium.src,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,axinging/chromium-crosswalk,dushu1203/chromium.src,dushu1203/chromium.src,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,hgl888/chromium-crosswalk,bright-sparks/chromium-spacewalk,PeterWangIntel/chromium-crosswalk,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,dednal/chromium.src,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,dushu1203/chromium.src,axinging/chromium-crosswalk,ondra-novak/chromium.src,anirudhSK/chromium,zcbenz/cefode-chromium,Fireblend/chromium-crosswalk,nacl-webkit/chrome_deps,hujiajie/pa-chromium,junmin-zhu/chromium-rivertrail,ChromiumWebApps/chromium,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,junmin-zhu/chromium-rivertrail,mogoweb/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,ondra-novak/chromium.src,mogoweb/chromium-crosswalk,dushu1203/chromium.src,dednal/chromium.src,hgl888/chromium-crosswalk,Chilledheart/chromium,nacl-webkit/chrome_deps,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,anirudhSK/chromium,anirudhSK/chromium,krieger-od/nwjs_chromium.src,ltilve/chromium,Just-D/chromium-1,dednal/chromium.src,markYoungH/chromium.src,Just-D/chromium-1,jaruba/chromium.src,nacl-webkit/chrome_deps,junmin-zhu/chromium-rivertrail,hujiajie/pa-chromium,crosswalk-project/chromium-crosswalk-efl,Jonekee/chromium.src,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,ltilve/chromium,markYoungH/chromium.src,junmin-zhu/chromium-rivertrail,pozdnyakov/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,pozdnyakov/chromium-crosswalk,anirudhSK/chromium,markYoungH/chromium.src,M4sse/chromium.src,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,littlstar/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,Jonekee/chromium.src,patrickm/chromium.src,littlstar/chromium.src,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,hujiajie/pa-chromium,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,patrickm/chromium.src,ChromiumWebApps/chromium,ltilve/chromium,timopulkkinen/BubbleFish,Chilledheart/chromium,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,dednal/chromium.src,dednal/chromium.src,patrickm/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,zcbenz/cefode-chromium,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,ChromiumWebApps/chromium,axinging/chromium-crosswalk,markYoungH/chromium.src,ondra-novak/chromium.src,dednal/chromium.src,littlstar/chromium.src,Jonekee/chromium.src,chuan9/chromium-crosswalk,Chilledheart/chromium,timopulkkinen/BubbleFish,ltilve/chromium,littlstar/chromium.src,M4sse/chromium.src,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,bright-sparks/chromium-spacewalk,jaruba/chromium.src,junmin-zhu/chromium-rivertrail,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,dednal/chromium.src,zcbenz/cefode-chromium,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,littlstar/chromium.src,crosswalk-project/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,ltilve/chromium,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,dushu1203/chromium.src,patrickm/chromium.src,Jonekee/chromium.src,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,hujiajie/pa-chromium,ltilve/chromium,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,zcbenz/cefode-chromium,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,anirudhSK/chromium,markYoungH/chromium.src,M4sse/chromium.src,junmin-zhu/chromium-rivertrail,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,zcbenz/cefode-chromium,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,patrickm/chromium.src,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,ondra-novak/chromium.src,chuan9/chromium-crosswalk,zcbenz/cefode-chromium,zcbenz/cefode-chromium,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,timopulkkinen/BubbleFish,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,timopulkkinen/BubbleFish,dednal/chromium.src,Fireblend/chromium-crosswalk,littlstar/chromium.src,patrickm/chromium.src,Just-D/chromium-1,junmin-zhu/chromium-rivertrail,anirudhSK/chromium,anirudhSK/chromium,markYoungH/chromium.src,fujunwei/chromium-crosswalk,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,M4sse/chromium.src,ChromiumWebApps/chromium,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,timopulkkinen/BubbleFish,axinging/chromium-crosswalk,hujiajie/pa-chromium,zcbenz/cefode-chromium,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,jaruba/chromium.src,dednal/chromium.src,M4sse/chromium.src,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,littlstar/chromium.src,bright-sparks/chromium-spacewalk,ondra-novak/chromium.src,Chilledheart/chromium,jaruba/chromium.src,nacl-webkit/chrome_deps,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,pozdnyakov/chromium-crosswalk,axinging/chromium-crosswalk,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,Chilledheart/chromium,mogoweb/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,zcbenz/cefode-chromium,axinging/chromium-crosswalk,hujiajie/pa-chromium,hujiajie/pa-chromium,jaruba/chromium.src,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,ltilve/chromium,Just-D/chromium-1,ltilve/chromium,ondra-novak/chromium.src,Pluto-tv/chromium-crosswalk,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk,bright-sparks/chromium-spacewalk,Chilledheart/chromium,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,ChromiumWebApps/chromium,anirudhSK/chromium,Fireblend/chromium-crosswalk,dushu1203/chromium.src,Jonekee/chromium.src,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,dednal/chromium.src,Just-D/chromium-1,hgl888/chromium-crosswalk,bright-sparks/chromium-spacewalk,hujiajie/pa-chromium,Chilledheart/chromium,Fireblend/chromium-crosswalk,bright-sparks/chromium-spacewalk,jaruba/chromium.src,chuan9/chromium-crosswalk,M4sse/chromium.src,littlstar/chromium.src,timopulkkinen/BubbleFish,dednal/chromium.src,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,mogoweb/chromium-crosswalk,markYoungH/chromium.src,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ondra-novak/chromium.src,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,pozdnyakov/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,nacl-webkit/chrome_deps,patrickm/chromium.src,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,hujiajie/pa-chromium,Jonekee/chromium.src,chuan9/chromium-crosswalk,mogoweb/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,junmin-zhu/chromium-rivertrail,TheTypoMaster/chromium-crosswalk
5ee6ca95fb823fa0d435af5edbead880362acd1c
tests/notest.epiphany.c
tests/notest.epiphany.c
#include <stdint.h> #define SKIP 77 struct status { uint32_t done; uint32_t _pad1; uint32_t returncode; uint32_t _pad2; } __attribute__((packed)); volatile struct status *epiphany_status = (struct status *) 0x8f200000; volatile char *epiphany_results = (char *) 0x8f300000; int main(int argc, char *argv[]) { epiphany_status->returncode = SKIP; epiphany_status->done = 1; return SKIP; }
#include <stdint.h> #define SKIP 77 struct status { uint32_t done; uint32_t _pad1; uint32_t returncode; uint32_t _pad2; } __attribute__((packed)); volatile struct status *epiphany_status = (struct status *) 0x8f200000; volatile char *epiphany_results = (char *) 0x8f300000; /* HACK: Provide symbol to work around GCC 5 link error for * math/check_p_{max,min} */ float *ai; int main(int argc, char *argv[]) { epiphany_status->returncode = SKIP; epiphany_status->done = 1; return SKIP; }
Fix Epiphany GCC 5 link error
tests: Fix Epiphany GCC 5 link error Signed-off-by: Ola Jeppsson <[email protected]>
C
apache-2.0
mateunho/pal,eliteraspberries/pal,parallella/pal,parallella/pal,mateunho/pal,parallella/pal,eliteraspberries/pal,mateunho/pal,mateunho/pal,eliteraspberries/pal,parallella/pal,aolofsson/pal,aolofsson/pal,aolofsson/pal,parallella/pal,mateunho/pal,eliteraspberries/pal,eliteraspberries/pal,aolofsson/pal
0dfdfb57d2a2520bfaa7f79343d36478c0929e42
test/Analysis/html-diags.c
test/Analysis/html-diags.c
// RUN: rm -fR %T/dir // RUN: mkdir %T/dir // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %T/dir %s // Currently this test mainly checks that the HTML diagnostics doesn't crash // when handling macros will calls with macros. We should actually validate // the output, but that requires being able to match against a specifically // generate HTML file. #define DEREF(p) *p = 0xDEADBEEF void has_bug(int *p) { DEREF(p); } #define CALL_HAS_BUG(q) has_bug(q) void test_call_macro() { CALL_HAS_BUG(0); }
// RUN: rm -fR %T/dir // RUN: mkdir %T/dir // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %T/dir %s // RUN: ls %T/dir | grep report // PR16547: Test relative paths // RUN: cd %T/dir // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o testrelative %s // RUN: ls %T/dir/testrelative | grep report // REQUIRES: shell // Currently this test mainly checks that the HTML diagnostics doesn't crash // when handling macros will calls with macros. We should actually validate // the output, but that requires being able to match against a specifically // generate HTML file. #define DEREF(p) *p = 0xDEADBEEF void has_bug(int *p) { DEREF(p); } #define CALL_HAS_BUG(q) has_bug(q) void test_call_macro() { CALL_HAS_BUG(0); }
Add a test case for r185707/PR16547.
Add a test case for r185707/PR16547. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@185708 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
eff847ce8d402b663bf19af3d16da2e3f5cb2bbd
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
mpapierski/pqxx,mpapierski/pqxx,mpapierski/pqxx
ab49b49f04a3dd9d3a530193798983d540c031d4
touch/inc/touch/touch.h
touch/inc/touch/touch.h
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Copyright 2013 LibreOffice contributors. * * 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/. */ #ifndef INCLUDED_TOUCH_TOUCH_H #define INCLUDED_TOUCH_TOUCH_H #include <config_features.h> #if !HAVE_FEATURE_DESKTOP // Functions to be implemented by the upper/medium layers on // non-desktop touch-based platforms, with the same API on each such // platform. Note that these are just declared here in this header in // the "touch" module, the per-platform implementations are elsewhere. #ifdef __cplusplus extern "C" { #endif void lo_show_keyboard(); void lo_hide_keyboard(); #ifdef __cplusplus } #endif #endif // HAVE_FEATURE_DESKTOP #endif // INCLUDED_TOUCH_TOUCH_H /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Copyright 2013 LibreOffice contributors. * * 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/. */ #ifndef INCLUDED_TOUCH_TOUCH_H #define INCLUDED_TOUCH_TOUCH_H #include <config_features.h> #if !HAVE_FEATURE_DESKTOP // Functions to be implemented by the app-specifc upper or less // app-specific but platform-specific medium layer on touch-based // platforms. The same API is used on each such platform. There are // called from low level LibreOffice code. Note that these are just // declared here in this header in the "touch" module, the // per-platform implementations are elsewhere. #ifdef __cplusplus extern "C" { #endif void lo_show_keyboard(); void lo_hide_keyboard(); // Functions to be implemented in the medium platform-specific layer // to be called from the app-specific UI layer. void lo_keyboard_did_hide(); #ifdef __cplusplus } #endif #endif // HAVE_FEATURE_DESKTOP #endif // INCLUDED_TOUCH_TOUCH_H /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Add lo_keyboard_did_hide() and improve comment
Add lo_keyboard_did_hide() and improve comment Change-Id: I20ae40fa03079d69f7ce9e71fa4ef6264e8d84a4
C
mpl-2.0
JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core
2838dd973520318e566e50f81843658749f1acb4
compat/cbits/unicode.c
compat/cbits/unicode.c
#if __GLASGOW_HASKELL__ < 604 || (__GLASGOW_HASKELL__==604 && __GHC_PATCHLEVEL__==0) #include "WCsubst.c" #endif
#if __GLASGOW_HASKELL__ < 605 #if __GLASGOW_HASKELL__ != 604 || __GHC_PATCHLEVEL__ == 0 #include "WCsubst.c" #endif #endif
Fix building with compilers which don't have an integer for a patch level
Fix building with compilers which don't have an integer for a patch level
C
bsd-3-clause
tjakway/ghcjvm,vTurbine/ghc,sgillespie/ghc,nkaretnikov/ghc,snoyberg/ghc,lukexi/ghc-7.8-arm64,gcampax/ghc,sgillespie/ghc,olsner/ghc,ekmett/ghc,mcschroeder/ghc,da-x/ghc,mcschroeder/ghc,lukexi/ghc,sdiehl/ghc,mcschroeder/ghc,ekmett/ghc,vTurbine/ghc,green-haskell/ghc,da-x/ghc,bitemyapp/ghc,elieux/ghc,snoyberg/ghc,christiaanb/ghc,ghc-android/ghc,urbanslug/ghc,nushio3/ghc,ekmett/ghc,holzensp/ghc,gcampax/ghc,oldmanmike/ghc,gridaphobe/ghc,bitemyapp/ghc,green-haskell/ghc,snoyberg/ghc,shlevy/ghc,wxwxwwxxx/ghc,jstolarek/ghc,ezyang/ghc,tibbe/ghc,ezyang/ghc,wxwxwwxxx/ghc,elieux/ghc,AlexanderPankiv/ghc,christiaanb/ghc,nkaretnikov/ghc,ml9951/ghc,vikraman/ghc,sdiehl/ghc,da-x/ghc,olsner/ghc,mfine/ghc,AlexanderPankiv/ghc,spacekitteh/smcghc,lukexi/ghc,siddhanathan/ghc,nomeata/ghc,ryantm/ghc,mcmaniac/ghc,urbanslug/ghc,vTurbine/ghc,bitemyapp/ghc,lukexi/ghc-7.8-arm64,nomeata/ghc,TomMD/ghc,nathyong/microghc-ghc,nathyong/microghc-ghc,anton-dessiatov/ghc,GaloisInc/halvm-ghc,spacekitteh/smcghc,TomMD/ghc,ghc-android/ghc,acowley/ghc,mcschroeder/ghc,fmthoma/ghc,bitemyapp/ghc,mcmaniac/ghc,siddhanathan/ghc,AlexanderPankiv/ghc,GaloisInc/halvm-ghc,urbanslug/ghc,ezyang/ghc,acowley/ghc,forked-upstream-packages-for-ghcjs/ghc,mcschroeder/ghc,gridaphobe/ghc,ml9951/ghc,anton-dessiatov/ghc,nkaretnikov/ghc,lukexi/ghc,olsner/ghc,siddhanathan/ghc,siddhanathan/ghc,mettekou/ghc,ghc-android/ghc,anton-dessiatov/ghc,mfine/ghc,acowley/ghc,hferreiro/replay,ezyang/ghc,ilyasergey/GHC-XAppFix,shlevy/ghc,siddhanathan/ghc,hferreiro/replay,oldmanmike/ghc,mettekou/ghc,shlevy/ghc,oldmanmike/ghc,da-x/ghc,sgillespie/ghc,AlexanderPankiv/ghc,shlevy/ghc,sdiehl/ghc,GaloisInc/halvm-ghc,AlexanderPankiv/ghc,ghc-android/ghc,tjakway/ghcjvm,fmthoma/ghc,mcmaniac/ghc,nkaretnikov/ghc,ezyang/ghc,jstolarek/ghc,ml9951/ghc,TomMD/ghc,ilyasergey/GHC-XAppFix,nomeata/ghc,ilyasergey/GHC-XAppFix,hferreiro/replay,ml9951/ghc,nushio3/ghc,vikraman/ghc,frantisekfarka/ghc-dsi,nomeata/ghc,oldmanmike/ghc,TomMD/ghc,vikraman/ghc,holzensp/ghc,forked-upstream-packages-for-ghcjs/ghc,acowley/ghc,AlexanderPankiv/ghc,nathyong/microghc-ghc,da-x/ghc,olsner/ghc,mfine/ghc,nkaretnikov/ghc,sgillespie/ghc,mcschroeder/ghc,ghc-android/ghc,mcmaniac/ghc,ilyasergey/GHC-XAppFix,tibbe/ghc,GaloisInc/halvm-ghc,lukexi/ghc-7.8-arm64,nkaretnikov/ghc,vTurbine/ghc,ryantm/ghc,nathyong/microghc-ghc,tibbe/ghc,vikraman/ghc,vikraman/ghc,mfine/ghc,shlevy/ghc,ml9951/ghc,wxwxwwxxx/ghc,nushio3/ghc,sgillespie/ghc,ryantm/ghc,ryantm/ghc,holzensp/ghc,acowley/ghc,frantisekfarka/ghc-dsi,gridaphobe/ghc,hferreiro/replay,nathyong/microghc-ghc,forked-upstream-packages-for-ghcjs/ghc,ezyang/ghc,bitemyapp/ghc,sdiehl/ghc,wxwxwwxxx/ghc,lukexi/ghc,olsner/ghc,ml9951/ghc,nkaretnikov/ghc,snoyberg/ghc,gcampax/ghc,gridaphobe/ghc,holzensp/ghc,GaloisInc/halvm-ghc,mcschroeder/ghc,snoyberg/ghc,ekmett/ghc,GaloisInc/halvm-ghc,urbanslug/ghc,christiaanb/ghc,elieux/ghc,fmthoma/ghc,gcampax/ghc,lukexi/ghc-7.8-arm64,oldmanmike/ghc,shlevy/ghc,da-x/ghc,mfine/ghc,shlevy/ghc,green-haskell/ghc,holzensp/ghc,nathyong/microghc-ghc,oldmanmike/ghc,siddhanathan/ghc,mettekou/ghc,olsner/ghc,jstolarek/ghc,hferreiro/replay,hferreiro/replay,vTurbine/ghc,christiaanb/ghc,wxwxwwxxx/ghc,christiaanb/ghc,nushio3/ghc,jstolarek/ghc,ghc-android/ghc,TomMD/ghc,nushio3/ghc,gcampax/ghc,sgillespie/ghc,tjakway/ghcjvm,anton-dessiatov/ghc,gcampax/ghc,tjakway/ghcjvm,hferreiro/replay,mfine/ghc,ekmett/ghc,acowley/ghc,mfine/ghc,snoyberg/ghc,urbanslug/ghc,green-haskell/ghc,sdiehl/ghc,anton-dessiatov/ghc,da-x/ghc,nathyong/microghc-ghc,nushio3/ghc,urbanslug/ghc,anton-dessiatov/ghc,olsner/ghc,anton-dessiatov/ghc,frantisekfarka/ghc-dsi,acowley/ghc,elieux/ghc,gcampax/ghc,tjakway/ghcjvm,tibbe/ghc,jstolarek/ghc,siddhanathan/ghc,mettekou/ghc,elieux/ghc,mettekou/ghc,elieux/ghc,vTurbine/ghc,frantisekfarka/ghc-dsi,sdiehl/ghc,wxwxwwxxx/ghc,AlexanderPankiv/ghc,fmthoma/ghc,fmthoma/ghc,vTurbine/ghc,forked-upstream-packages-for-ghcjs/ghc,christiaanb/ghc,tibbe/ghc,green-haskell/ghc,gridaphobe/ghc,sdiehl/ghc,lukexi/ghc,fmthoma/ghc,forked-upstream-packages-for-ghcjs/ghc,gridaphobe/ghc,vikraman/ghc,nomeata/ghc,oldmanmike/ghc,snoyberg/ghc,tjakway/ghcjvm,ryantm/ghc,ml9951/ghc,vikraman/ghc,spacekitteh/smcghc,elieux/ghc,urbanslug/ghc,ezyang/ghc,nushio3/ghc,spacekitteh/smcghc,TomMD/ghc,wxwxwwxxx/ghc,tjakway/ghcjvm,GaloisInc/halvm-ghc,forked-upstream-packages-for-ghcjs/ghc,forked-upstream-packages-for-ghcjs/ghc,ml9951/ghc,mettekou/ghc,TomMD/ghc,christiaanb/ghc,sgillespie/ghc,mcmaniac/ghc,mettekou/ghc,lukexi/ghc-7.8-arm64,spacekitteh/smcghc,gridaphobe/ghc,frantisekfarka/ghc-dsi,ghc-android/ghc,fmthoma/ghc
5e23b0d60f6ad6bea8531375323e3b8e0e5c4f04
webserver/src/logging.c
webserver/src/logging.c
#include <stdlib.h> #include <stdio.h> #include "logging.h" int log_fail(char* msg) { perror(msg); // TODO fix log to file return 0; } int log_success(char* msg) { printf("%s\n", msg); return 0; }
#include <stdlib.h> #include <stdio.h> #include "logging.h" int log_fail(char* msg) { perror(msg); // TODO fix log to file return 0; } int log_success(char* msg) { printf("SUCCESS: %s\n", msg); return 0; }
Change of the default msg
Change of the default msg
C
mit
foikila/webserver,foikila/webserver
fb4c0f835d2377256c599023e91dafc3d8e55b4c
src/common/pixelboost/network/networkMessage.h
src/common/pixelboost/network/networkMessage.h
#pragma once #define NETWORK_MAX_MESSAGE_LENGTH 65535 #include <sys/types.h> namespace pb { class NetworkMessage { public: NetworkMessage(); NetworkMessage(const NetworkMessage& src); ~NetworkMessage(); bool ReadChar(char& value); bool ReadByte(__uint8_t& value); bool ReadInt(__int32_t& value); bool ReadFloat(float& value); bool ReadString(const char*& value); bool WriteChar(char value); bool WriteByte(__uint8_t value); bool WriteInt(__int32_t value); bool WriteFloat(float value); bool WriteString(const char* value); bool SetData(__int32_t length, char* data); void SetProtocol(__uint32_t protocol); __uint32_t GetProtocol(); int GetDataLength(); int GetMessageLength(); int ConstructMessage(char* buffer, __int32_t maxLength); private: bool HasRemaining(__int32_t length); __uint32_t _Protocol; char* _Buffer; int _Offset; __int32_t _Length; }; }
#pragma once #define NETWORK_MAX_MESSAGE_LENGTH 262140 #include <sys/types.h> namespace pb { class NetworkMessage { public: NetworkMessage(); NetworkMessage(const NetworkMessage& src); ~NetworkMessage(); bool ReadChar(char& value); bool ReadByte(__uint8_t& value); bool ReadInt(__int32_t& value); bool ReadFloat(float& value); bool ReadString(const char*& value); bool WriteChar(char value); bool WriteByte(__uint8_t value); bool WriteInt(__int32_t value); bool WriteFloat(float value); bool WriteString(const char* value); bool SetData(__int32_t length, char* data); void SetProtocol(__uint32_t protocol); __uint32_t GetProtocol(); int GetDataLength(); int GetMessageLength(); int ConstructMessage(char* buffer, __int32_t maxLength); private: bool HasRemaining(__int32_t length); __uint32_t _Protocol; char* _Buffer; int _Offset; __int32_t _Length; }; }
Increase max length of a network message to support larger records
Increase max length of a network message to support larger records
C
mit
pixelballoon/pixelboost,pixelballoon/pixelboost,pixelballoon/pixelboost,pixelballoon/pixelboost,pixelballoon/pixelboost
51c7e9a45e870e07de66880248be05d5b73dd249
lineart.h
lineart.h
// // lineart.h // LineArt // // Created by Allek Mott on 10/1/15. // Copyright © 2015 Loop404. All rights reserved. // #ifndef lineart_h #define lineart_h #include <stdio.h> #define MAX_LINE_LENGTH 200 // data structure for line // (x1, y1) = inital point // (x2, y2) = final point struct line { int x1; int y1; int x2; int y2; }; // data structure for point (x, y) struct point { int x; int y; }; // Generate displacement value for new line int genDifference(); // Easy line resetting/initialization void easyLine(struct line *l, int x1, int y1, int x2, int y2); // Calculates midpoint of line l, // stores in point p void getMidpoint(struct line *l, struct point *p); // Generate next line in sequence void genNextLine(struct line *previous, struct line *current, int lineNo); #endif /* lineart_h */
// // lineart.h // LineArt // // Created by Allek Mott on 10/1/15. // Copyright © 2015 Loop404. All rights reserved. // #ifndef lineart_h #define lineart_h #include <stdio.h> #define MAX_LINE_LENGTH 200 // data structure for line // (x1, y1) = inital point // (x2, y2) = final point struct line { int x1; int y1; int x2; int y2; }; // data structure for point (x, y) struct point { int x; int y; }; // data structure for node // in linked list of lines struct node { struct line *line; struct node *next; }; // Generate displacement value for new line int genDifference(); // Easy line resetting/initialization void easyLine(struct line *l, int x1, int y1, int x2, int y2); // Calculates midpoint of line l, // stores in point p void getMidpoint(struct line *l, struct point *p); // Generate next line in sequence void genNextLine(struct line *previous, struct line *current, int lineNo); void freeLineNode(struct node *node); void freeLineList(struct node *root); #endif /* lineart_h */
Add list function declarations, node structure
Add list function declarations, node structure
C
apache-2.0
tchieze/LineArt
1d189e339e73ad78eb02819112a70a5595c9b6b0
lib/libskey/skey_getpass.c
lib/libskey/skey_getpass.c
#include <unistd.h> #include <stdio.h> #include <skey.h> /* skey_getpass - read regular or s/key password */ char *skey_getpass(prompt, pwd, pwok) char *prompt; struct passwd *pwd; int pwok; { static char buf[128]; struct skey skey; char *pass = ""; char *username = pwd ? pwd->pw_name : "nope"; int sflag; /* Attempt an s/key challenge. */ sflag = skeyinfo(&skey, username, buf); if (!sflag) printf("%s\n", buf); if (!pwok) { printf("(s/key required)\n"); if (sflag) return (pass); } pass = getpass(prompt); /* Give S/Key users a chance to do it with echo on. */ if (!sflag && !feof(stdin) && *pass == '\0') { fputs(" (turning echo on)\n", stdout); fputs(prompt, stdout); fflush(stdout); fgets(buf, sizeof(buf), stdin); rip(buf); return (buf); } else return (pass); }
#include <unistd.h> #include <stdio.h> #include <skey.h> /* skey_getpass - read regular or s/key password */ char *skey_getpass(prompt, pwd, pwok) char *prompt; struct passwd *pwd; int pwok; { static char buf[128]; struct skey skey; char *pass = ""; char *username = pwd ? pwd->pw_name : ":"; int sflag; /* Attempt an s/key challenge. */ sflag = skeyinfo(&skey, username, buf); if (!sflag) printf("%s\n", buf); if (!pwok) { printf("(s/key required)\n"); if (sflag) return (pass); } pass = getpass(prompt); /* Give S/Key users a chance to do it with echo on. */ if (!sflag && !feof(stdin) && *pass == '\0') { fputs(" (turning echo on)\n", stdout); fputs(prompt, stdout); fflush(stdout); fgets(buf, sizeof(buf), stdin); rip(buf); return (buf); } else return (pass); }
Change "nope" to ":" Previous variant not work well, if you have a user with name nope
Change "nope" to ":" Previous variant not work well, if you have a user with name nope
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
8f609567b666a160d19537f5b0e793b6092eb499
ir/ana/constbits.h
ir/ana/constbits.h
#ifndef CONSTBITS_H #define CONSTBITS_H #include "adt/obst.h" #include "tv.h" typedef struct bitinfo { ir_tarval* z; /* safe zeroes, 0 = bit is zero, 1 = bit maybe is 1 */ ir_tarval* o; /* safe ones, 0 = bit maybe is zero, 1 = bit is 1 */ } bitinfo; /* Get analysis information for node irn */ bitinfo* get_bitinfo(ir_node const* const irn); /* Set analysis information for node irn */ int set_bitinfo(ir_node* const irn, ir_tarval* const z, ir_tarval* const o); /* Compute value range fixpoint aka which bits of value are constant zero/one. * The result is available via links to bitinfo*, allocated on client_obst. */ void constbits_analyze(ir_graph* const irg, struct obstack *client_obst); /* Clears the bit information for the given graph. * * This does not affect the obstack passed to constbits_analyze. */ void constbits_clear(ir_graph* const irg); #endif
#ifndef CONSTBITS_H #define CONSTBITS_H #include "adt/obst.h" #include "tv.h" typedef struct bitinfo { ir_tarval* z; /* safe zeroes, 0 = bit is zero, 1 = bit maybe is 1 */ ir_tarval* o; /* safe ones, 0 = bit maybe is zero, 1 = bit is 1 */ } bitinfo; /* Get analysis information for node irn */ bitinfo* get_bitinfo(ir_node const* irn); /* Set analysis information for node irn */ int set_bitinfo(ir_node* irn, ir_tarval* z, ir_tarval* o); /* Compute value range fixpoint aka which bits of value are constant zero/one. * The result is available via links to bitinfo*, allocated on client_obst. */ void constbits_analyze(ir_graph* irg, struct obstack *client_obst); /* Clears the bit information for the given graph. * * This does not affect the obstack passed to constbits_analyze. */ void constbits_clear(ir_graph* irg); #endif
Remove pointless const from function declarations.
Remove pointless const from function declarations.
C
lgpl-2.1
jonashaag/libfirm,8l/libfirm,libfirm/libfirm,killbug2004/libfirm,davidgiven/libfirm,MatzeB/libfirm,jonashaag/libfirm,libfirm/libfirm,killbug2004/libfirm,MatzeB/libfirm,8l/libfirm,jonashaag/libfirm,killbug2004/libfirm,MatzeB/libfirm,jonashaag/libfirm,davidgiven/libfirm,libfirm/libfirm,davidgiven/libfirm,killbug2004/libfirm,libfirm/libfirm,killbug2004/libfirm,8l/libfirm,davidgiven/libfirm,jonashaag/libfirm,MatzeB/libfirm,8l/libfirm,killbug2004/libfirm,MatzeB/libfirm,jonashaag/libfirm,MatzeB/libfirm,libfirm/libfirm,davidgiven/libfirm,jonashaag/libfirm,8l/libfirm,8l/libfirm,killbug2004/libfirm,8l/libfirm,davidgiven/libfirm,MatzeB/libfirm,davidgiven/libfirm
087d26add507d41839b5ae9c80f25e7208c82754
third_party/widevine/cdm/android/widevine_cdm_version.h
third_party/widevine/cdm/android/widevine_cdm_version.h
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WIDEVINE_CDM_VERSION_H_ #define WIDEVINE_CDM_VERSION_H_ #include "third_party/widevine/cdm/widevine_cdm_common.h" // Indicates that the Widevine CDM is available. #define WIDEVINE_CDM_AVAILABLE // TODO(ddorwin): Remove when we have CDM availability detection // (http://crbug.com/224793). #define DISABLE_WIDEVINE_CDM_CANPLAYTYPE // Indicates that ISO BMFF CENC support is available in the Widevine CDM. // Must be enabled if any of the codecs below are enabled. #define WIDEVINE_CDM_CENC_SUPPORT_AVAILABLE // Indicates that AVC1 decoding is available for ISO BMFF CENC. #define WIDEVINE_CDM_AVC1_SUPPORT_AVAILABLE // Indicates that AAC decoding is available for ISO BMFF CENC. #define WIDEVINE_CDM_AAC_SUPPORT_AVAILABLE #endif // WIDEVINE_CDM_VERSION_H_
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WIDEVINE_CDM_VERSION_H_ #define WIDEVINE_CDM_VERSION_H_ #include "third_party/widevine/cdm/widevine_cdm_common.h" // Indicates that the Widevine CDM is available. #define WIDEVINE_CDM_AVAILABLE // Indicates that AVC1 decoding is available for ISO BMFF CENC. #define WIDEVINE_CDM_AVC1_SUPPORT_AVAILABLE // Indicates that AAC decoding is available for ISO BMFF CENC. #define WIDEVINE_CDM_AAC_SUPPORT_AVAILABLE #endif // WIDEVINE_CDM_VERSION_H_
Remove DISABLE_WIDEVINE_CDM_CANPLAYTYPE as we should start using canPlayType now
Remove DISABLE_WIDEVINE_CDM_CANPLAYTYPE as we should start using canPlayType now Passed the canplaytype check when tested with http://dash-mse-test.appspot.com/append-all.html?sd=1&keysystem=widevine BUG=224793 Review URL: https://chromiumcodereview.appspot.com/24072009 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@224312 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
anirudhSK/chromium,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,anirudhSK/chromium,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,ltilve/chromium,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,Fireblend/chromium-crosswalk,dednal/chromium.src,M4sse/chromium.src,dednal/chromium.src,axinging/chromium-crosswalk,ltilve/chromium,dushu1203/chromium.src,markYoungH/chromium.src,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,ondra-novak/chromium.src,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,bright-sparks/chromium-spacewalk,PeterWangIntel/chromium-crosswalk,ltilve/chromium,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,mogoweb/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,ChromiumWebApps/chromium,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,ChromiumWebApps/chromium,Chilledheart/chromium,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,littlstar/chromium.src,bright-sparks/chromium-spacewalk,M4sse/chromium.src,littlstar/chromium.src,patrickm/chromium.src,ltilve/chromium,anirudhSK/chromium,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,jaruba/chromium.src,ltilve/chromium,jaruba/chromium.src,markYoungH/chromium.src,anirudhSK/chromium,dednal/chromium.src,markYoungH/chromium.src,Fireblend/chromium-crosswalk,M4sse/chromium.src,dednal/chromium.src,anirudhSK/chromium,fujunwei/chromium-crosswalk,mogoweb/chromium-crosswalk,anirudhSK/chromium,jaruba/chromium.src,Jonekee/chromium.src,ondra-novak/chromium.src,mogoweb/chromium-crosswalk,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,markYoungH/chromium.src,axinging/chromium-crosswalk,dednal/chromium.src,mogoweb/chromium-crosswalk,dednal/chromium.src,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,Jonekee/chromium.src,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,Pluto-tv/chromium-crosswalk,chuan9/chromium-crosswalk,littlstar/chromium.src,dednal/chromium.src,chuan9/chromium-crosswalk,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,patrickm/chromium.src,M4sse/chromium.src,dushu1203/chromium.src,ChromiumWebApps/chromium,M4sse/chromium.src,Just-D/chromium-1,Just-D/chromium-1,fujunwei/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,anirudhSK/chromium,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,ondra-novak/chromium.src,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,patrickm/chromium.src,bright-sparks/chromium-spacewalk,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,dushu1203/chromium.src,dushu1203/chromium.src,ltilve/chromium,jaruba/chromium.src,ChromiumWebApps/chromium,Just-D/chromium-1,patrickm/chromium.src,Just-D/chromium-1,patrickm/chromium.src,patrickm/chromium.src,chuan9/chromium-crosswalk,ondra-novak/chromium.src,dednal/chromium.src,ltilve/chromium,ondra-novak/chromium.src,ltilve/chromium,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,mogoweb/chromium-crosswalk,littlstar/chromium.src,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,littlstar/chromium.src,bright-sparks/chromium-spacewalk,littlstar/chromium.src,Jonekee/chromium.src,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,littlstar/chromium.src,dushu1203/chromium.src,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,bright-sparks/chromium-spacewalk,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,Chilledheart/chromium,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,mogoweb/chromium-crosswalk,M4sse/chromium.src,markYoungH/chromium.src,Chilledheart/chromium,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,fujunwei/chromium-crosswalk,jaruba/chromium.src,Chilledheart/chromium,ondra-novak/chromium.src,ChromiumWebApps/chromium,axinging/chromium-crosswalk,markYoungH/chromium.src,markYoungH/chromium.src,ChromiumWebApps/chromium,M4sse/chromium.src,axinging/chromium-crosswalk,jaruba/chromium.src,krieger-od/nwjs_chromium.src,Just-D/chromium-1,Fireblend/chromium-crosswalk,jaruba/chromium.src,M4sse/chromium.src,Chilledheart/chromium,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,M4sse/chromium.src,crosswalk-project/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,dushu1203/chromium.src,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,anirudhSK/chromium,PeterWangIntel/chromium-crosswalk,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,Just-D/chromium-1,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,markYoungH/chromium.src,littlstar/chromium.src,dushu1203/chromium.src,anirudhSK/chromium,anirudhSK/chromium,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,dednal/chromium.src,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk
8112c82609b3307c193ffefae01690ecd6e99968
BlocksKit/NSCache+BlocksKit.h
BlocksKit/NSCache+BlocksKit.h
// // NSCache+BlocksKit.h // %PROJECT // #import "BKGlobals.h" /** NSCache with block adding of objects This category allows you to conditionally add objects to an instance of NSCache using blocks. Both the normal delegation pattern and a block callback for NSCache's one delegate method are allowed. These methods emulate Rails caching behavior. Created by Igor Evsukov and contributed to BlocksKit. */ @interface NSCache (BlocksKit) /** Returns the value associated with a given key. If there is no object for that key, it uses the result of the block, saves that to the cache, and returns it. This mimics the cache behavior of Ruby on Rails. The following code: @products = Rails.cache.fetch('products') do Product.all end becomes: NSMutableArray *products = [cache objectForKey:@"products" withGetter:^id{ return [Product all]; }]; @return The value associated with *key*, or the object returned by the block if no value is associated with *key*. @param key An object identifying the value. @param getterBlock A block used to get an object if there is no value in the cache. */ - (id)objectForKey:(id)key withGetter:(BKReturnBlock)getterBlock; /** Called when an object is about to be evicted from the cache. This block callback is an analog for the cache:willEviceObject: method of NSCacheDelegate. */ @property (copy) BKSenderBlock willEvictBlock; @end
// // NSCache+BlocksKit.h // %PROJECT // #import "BKGlobals.h" /** NSCache with block adding of objects This category allows you to conditionally add objects to an instance of NSCache using blocks. Both the normal delegation pattern and a block callback for NSCache's one delegate method are allowed. These methods emulate Rails caching behavior. Created by Igor Evsukov and contributed to BlocksKit. */ @interface NSCache (BlocksKit) /** Returns the value associated with a given key. If there is no object for that key, it uses the result of the block, saves that to the cache, and returns it. This mimics the cache behavior of Ruby on Rails. The following code: @products = Rails.cache.fetch('products') do Product.all end becomes: NSMutableArray *products = [cache objectForKey:@"products" withGetter:^id{ return [Product all]; }]; @return The value associated with *key*, or the object returned by the block if no value is associated with *key*. @param key An object identifying the value. @param getterBlock A block used to get an object if there is no value in the cache. */ - (id)objectForKey:(id)key withGetter:(BKReturnBlock)getterBlock; /** Called when an object is about to be evicted from the cache. This block callback is an analog for the cache:willEviceObject: method of NSCacheDelegate. */ @property (copy) void(^willEvictBlock)(NSCache *, id); @end
Fix block property type in NSCache.
Fix block property type in NSCache.
C
mit
AlexanderMazaletskiy/BlocksKit,zxq3220122/BlocksKit-1,HarrisLee/BlocksKit,zwaldowski/BlocksKit,yimouleng/BlocksKit,z8927623/BlocksKit,Herbert77/BlocksKit,tattocau/BlocksKit,pilot34/BlocksKit,hq804116393/BlocksKit,stevenxiaoyang/BlocksKit,Gitub/BlocksKit,dachaoisme/BlocksKit,demonnico/BlocksKit,pomu0325/BlocksKit,anton-matosov/BlocksKit,ManagerOrganization/BlocksKit,yaoxiaoyong/BlocksKit,shenhzou654321/BlocksKit,owers19856/BlocksKit,hartbit/BlocksKit,Voxer/BlocksKit,xinlehou/BlocksKit,aipeople/BlocksKit,zhaoguohui/BlocksKit,TomBin647/BlocksKit,coneman/BlocksKit
18fdd4612a7cb7449048e234af3ce24644ca9f46
include/queuemanager.h
include/queuemanager.h
#ifndef NEWSBOAT_QUEUEMANAGER_H_ #define NEWSBOAT_QUEUEMANAGER_H_ #include <memory> #include <string> namespace newsboat { class ConfigContainer; class ConfigPaths; class RssFeed; class QueueManager { ConfigContainer* cfg = nullptr; ConfigPaths* paths = nullptr; public: QueueManager(ConfigContainer* cfg, ConfigPaths* paths); void enqueue_url(const std::string& url, const std::string& title, const time_t pubDate, std::shared_ptr<RssFeed> feed); void autoenqueue(std::shared_ptr<RssFeed> feed); private: std::string generate_enqueue_filename(const std::string& url, const std::string& title, const time_t pubDate, std::shared_ptr<RssFeed> feed); }; } #endif /* NEWSBOAT_QUEUEMANAGER_H_ */
#ifndef NEWSBOAT_QUEUEMANAGER_H_ #define NEWSBOAT_QUEUEMANAGER_H_ #include <ctime> #include <memory> #include <string> namespace newsboat { class ConfigContainer; class ConfigPaths; class RssFeed; class QueueManager { ConfigContainer* cfg = nullptr; ConfigPaths* paths = nullptr; public: QueueManager(ConfigContainer* cfg, ConfigPaths* paths); void enqueue_url(const std::string& url, const std::string& title, const time_t pubDate, std::shared_ptr<RssFeed> feed); void autoenqueue(std::shared_ptr<RssFeed> feed); private: std::string generate_enqueue_filename(const std::string& url, const std::string& title, const time_t pubDate, std::shared_ptr<RssFeed> feed); }; } #endif /* NEWSBOAT_QUEUEMANAGER_H_ */
Add missing header and fix build on FreeBSD
Add missing header and fix build on FreeBSD In file included from src/queuemanager.cpp:1: include/queuemanager.h:22:9: error: unknown type name 'time_t' const time_t pubDate, ^ Signed-off-by: Tobias Kortkamp <[email protected]>
C
mit
der-lyse/newsboat,der-lyse/newsboat,newsboat/newsboat,newsboat/newsboat,newsboat/newsboat,newsboat/newsboat,newsboat/newsboat,newsboat/newsboat,newsboat/newsboat,newsboat/newsboat,der-lyse/newsboat,der-lyse/newsboat,der-lyse/newsboat,der-lyse/newsboat,der-lyse/newsboat,der-lyse/newsboat
89272baf68bdd670cf21dc8bf052a53c3062d78b
readpin.c
readpin.c
#include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "input.h" int main(int argc, char **argv) { unsigned long high, low, err; struct gpio_req req; int fd; int old; int res; struct hardware hw; res = read_hardware_parameters("hardware.txt", &hw); if (res) return res; fd = init_hardware(hw.pin); if (fd < 0) return fd; /* errno */ high = low = err = 0; old = 0; for (;;) { req.gp_pin = hw.pin; if (ioctl(fd, GPIOGET, &req) < 0) { perror("ioctl(GPIOGET)"); /* whoops */ exit(1); } if ((req.gp_value != old && old == 0) || (high + low > hw.freq)) { printf("%lu %lu %lu\n", err, high, low); high = low = 0; } if (req.gp_value == GPIO_PIN_HIGH) high++; else if (req.gp_value == GPIO_PIN_LOW) low++; else err++; /* Houston? */ old = req.gp_value; (void)usleep(1000000.0 / hw.freq); /* us */ } if (close(fd)) perror("close"); return 0; }
Add a simple test program to read the GPIO signal.
Add a simple test program to read the GPIO signal. The program reads the sampling frequency and GPIO pin number from hardware.txt. It displays a new line and resets the LOW and HIGH counters when a LOW->HIGH (new second) slope occurs. Returns either all LOW or garbage on my hardware...
C
bsd-2-clause
rene0/dcf77pi,rene0/dcf77pi
4f897d18736c57e3a404252bd61258d6290d184a
include/core/SkMilestone.h
include/core/SkMilestone.h
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 72 #endif
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 73 #endif
Update Skia milestone to 73
Update Skia milestone to 73 Bug: skia: Change-Id: I4b8744f1f9d752a54429054d7539c46e24fcba82 Reviewed-on: https://skia-review.googlesource.com/c/173428 Reviewed-by: Heather Miller <[email protected]> Commit-Queue: Heather Miller <[email protected]>
C
bsd-3-clause
google/skia,aosp-mirror/platform_external_skia,rubenvb/skia,rubenvb/skia,aosp-mirror/platform_external_skia,rubenvb/skia,google/skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,HalCanary/skia-hc,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,HalCanary/skia-hc,rubenvb/skia,aosp-mirror/platform_external_skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,google/skia,HalCanary/skia-hc,google/skia,google/skia,google/skia,HalCanary/skia-hc,HalCanary/skia-hc,rubenvb/skia,google/skia,Hikari-no-Tenshi/android_external_skia,google/skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc
de4201ea6e5d1f02ca09a11892ac24b32607d9a6
sw/tests/rv_timer/rv_timer_test.c
sw/tests/rv_timer/rv_timer_test.c
// Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 #include <stdlib.h> #include <string.h> #include "common.h" #include "irq.h" #include "rv_timer.h" #include "uart.h" static uint32_t intr_handling_success = 0; static const uint32_t hart = 0; int main(int argc, char **argv) { uint64_t cmp = 0x00000000000000FF; uart_init(UART_BAUD_RATE); irq_global_ctrl(true); irq_timer_ctrl(true); rv_timer_set_us_tick(hart); rv_timer_set_cmp(hart, cmp); rv_timer_ctrl(hart, true); rv_timer_intr_enable(hart, true); while (1) { if (intr_handling_success) { break; } } uart_send_str("PASS!\r\n"); __asm__ volatile("wfi;"); } // Override weak default function void handler_irq_timer(void) { rv_timer_ctrl(hart, false); rv_timer_clr_all_intrs(); intr_handling_success = 1; }
// Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 #include <stdlib.h> #include <string.h> #include "common.h" #include "irq.h" #include "rv_timer.h" #include "uart.h" static uint32_t intr_handling_success = 0; static const uint32_t hart = 0; int main(int argc, char **argv) { const uint64_t cmp = 0x000000000000000F; uart_init(UART_BAUD_RATE); irq_global_ctrl(true); irq_timer_ctrl(true); rv_timer_set_us_tick(hart); rv_timer_set_cmp(hart, cmp); rv_timer_ctrl(hart, true); rv_timer_intr_enable(hart, true); while (1) { if (intr_handling_success) { break; } } uart_send_str("PASS!\r\n"); __asm__ volatile("wfi;"); } // Override weak default function void handler_irq_timer(void) { uart_send_str("In Interrupt handler!\r\n"); rv_timer_ctrl(hart, false); rv_timer_clr_all_intrs(); intr_handling_success = 1; }
Decrease compare value for faster testing
[test] Decrease compare value for faster testing
C
apache-2.0
lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan
f7df91a61b63f1b306f73a5166bec47b04add65b
src/lib_atlas/macros.h
src/lib_atlas/macros.h
/** * \file macros.h * \author Thibaut Mattio <[email protected]> * \date 28/06/2015 * \copyright Copyright (c) 2015 Thibaut Mattio. All rights reserved. * Use of this source code is governed by the MIT license that can be * found in the LICENSE file. */ #ifndef ATLAS_MACROS_H_ #define ATLAS_MACROS_H_ #if (__cplusplus >= 201103L) #define ATLAS_NOEXCEPT noexcept #define ATLAS_NOEXCEPT_(x) noexcept(x) #define ATLAS_NOEXCEPT_OR_FALSE(x) noexcept(x) #else #define ATLAS_NOEXCEPT throw() #define ATLAS_NOEXCEPT_(x) #define ATLAS_NOEXCEPT_OR_FALSE(x) false #endif #ifndef ATLAS_ALWAYS_INLINE #define ATLAS_ALWAYS_INLINE \ __attribute__((__visibility__("default"), __always_inline__)) inline #endif #endif // ATLAS_MACROS_H_
/** * \file macros.h * \author Thibaut Mattio <[email protected]> * \date 28/06/2015 * \copyright Copyright (c) 2015 Thibaut Mattio. All rights reserved. * Use of this source code is governed by the MIT license that can be * found in the LICENSE file. */ #ifndef ATLAS_MACROS_H_ #define ATLAS_MACROS_H_ // Defining exception macros #if (__cplusplus >= 201103L) #define ATLAS_NOEXCEPT noexcept #define ATLAS_NOEXCEPT_(x) noexcept(x) #define ATLAS_NOEXCEPT_OR_FALSE(x) noexcept(x) #else #define ATLAS_NOEXCEPT throw() #define ATLAS_NOEXCEPT_(x) #define ATLAS_NOEXCEPT_OR_FALSE(x) false #endif // Defining inline macros #ifndef ATLAS_ALWAYS_INLINE #define ATLAS_ALWAYS_INLINE \ __attribute__((__visibility__("default"), __always_inline__)) inline #endif // Defining OS variables #if defined(_WIN32) # define OS_WINDOWS 1 #elif defined(__APPLE__) # define OS_DARWIN 1 #elif defined(__linux__) # define OS_LINUX 1 #endif #endif // ATLAS_MACROS_H_
Make ins provider compile on darwin os.
Make ins provider compile on darwin os.
C
mit
sonia-auv/atlas,sonia-auv/atlas
c77b5fa13212089262ca9c25d65551264a32cd1e
capnp/helpers/checkCompiler.h
capnp/helpers/checkCompiler.h
#ifdef __GNUC__ #if __clang__ #if __cplusplus >= 201103L && !__has_include(<initializer_list>) #warning "Your compiler supports C++11 but your C++ standard library does not. If your system has libc++ installed (as should be the case on e.g. Mac OSX), try adding -stdlib=libc++ to your CFLAGS (ignore the other warning that says to use CXXFLAGS)." #endif #endif #endif #include "capnp/dynamic.h" static_assert(CAPNP_VERSION >= 5000, "Version of Cap'n Proto C++ Library is too old. Please upgrade to a version >= 0.4 and then re-install this python library");
#ifdef __GNUC__ #if __clang__ #if __cplusplus >= 201103L && !__has_include(<initializer_list>) #warning "Your compiler supports C++11 but your C++ standard library does not. If your system has libc++ installed (as should be the case on e.g. Mac OSX), try adding -stdlib=libc++ to your CFLAGS (ignore the other warning that says to use CXXFLAGS)." #endif #endif #endif #include "capnp/dynamic.h" static_assert(CAPNP_VERSION >= 5000, "Version of Cap'n Proto C++ Library is too old. Please upgrade to a version >= 0.5 and then re-install this python library");
Fix error message in version check
Fix error message in version check
C
bsd-2-clause
rcrowder/pycapnp,tempbottle/pycapnp,tempbottle/pycapnp,SymbiFlow/pycapnp,jparyani/pycapnp,rcrowder/pycapnp,tempbottle/pycapnp,jparyani/pycapnp,SymbiFlow/pycapnp,rcrowder/pycapnp,rcrowder/pycapnp,SymbiFlow/pycapnp,SymbiFlow/pycapnp,jparyani/pycapnp,tempbottle/pycapnp,jparyani/pycapnp
cade60aa064e9f6ca308806b6071ffae8dbab954
bin/lsip.c
bin/lsip.c
#include <stdio.h> #include <stdlib.h> #include <curl/curl.h> int main (int argc, char ** argv) { CURL * handle; CURLcode res; curl_global_init(CURL_GLOBAL_ALL); handle = curl_easy_init(); if ( handle ) { curl_easy_setopt(handle, CURLOPT_URL, "http://icanhazip.com"); curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1); res = curl_easy_perform(handle); if ( ! res == CURLE_OK ) { curl_easy_cleanup(handle); curl_global_cleanup(); fputs("Could not check IP address\n", stderr); exit(1); } } curl_easy_cleanup(handle); curl_global_cleanup(); return 0; } // vim: set tabstop=4 shiftwidth=4 expandtab
#include <stdio.h> #include <stdlib.h> #include <curl/curl.h> int main () { CURL * handle; CURLcode res; curl_global_init(CURL_GLOBAL_ALL); handle = curl_easy_init(); if ( handle ) { curl_easy_setopt(handle, CURLOPT_URL, "http://icanhazip.com"); curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1); res = curl_easy_perform(handle); if ( ! res == CURLE_OK ) { curl_easy_cleanup(handle); curl_global_cleanup(); fputs("Could not check IP address\n", stderr); exit(1); } } curl_easy_cleanup(handle); curl_global_cleanup(); return 0; } // vim: set tabstop=4 shiftwidth=4 expandtab
Remove arg{c,v} params for main() since they are unneeded
Remove arg{c,v} params for main() since they are unneeded
C
unlicense
HalosGhost/.dotfiles,HalosGhost/.dotfiles
669b5c11d8c82252f9697e35d183a0c840386261
libmultipath/alias.h
libmultipath/alias.h
#define BINDINGS_FILE_TIMEOUT 3 #define BINDINGS_FILE_HEADER \ "# Multipath bindings, Version : 1.0\n" \ "# NOTE: this file is automatically maintained by the multipath program.\n" \ "# You should not need to edit this file in normal circumstances.\n" \ "#\n" \ "# Format:\n" \ "# alias wwid\n" \ "#\n" char *get_user_friendly_alias(char *wwid, char *file); char *get_user_friendly_wwid(char *alias, char *file);
#define BINDINGS_FILE_TIMEOUT 30 #define BINDINGS_FILE_HEADER \ "# Multipath bindings, Version : 1.0\n" \ "# NOTE: this file is automatically maintained by the multipath program.\n" \ "# You should not need to edit this file in normal circumstances.\n" \ "#\n" \ "# Format:\n" \ "# alias wwid\n" \ "#\n" char *get_user_friendly_alias(char *wwid, char *file); char *get_user_friendly_wwid(char *alias, char *file);
Increase bindings file lock timeout to avoid failure of user_friendly_names
[lib] Increase bindings file lock timeout to avoid failure of user_friendly_names On setups with a large number of paths / multipath maps, contention for the advisory lock on the bindings file may take longer than 3 seconds, and some multipath processes may create maps based on WWID despite having user_friendly_names set. Increasing the timeout is a simple fix that gets us a bit further.
C
lgpl-2.1
unakatsuo/multipath-tools,vijaychauhan/multipath-tools,grzn/multipath-tools-explained,unakatsuo/multipath-tools,grzn/multipath-tools-explained,gebi/multipath-tools,unakatsuo/multipath-tools,vijaychauhan/multipath-tools
2e890d726c631346512b74928411575dcaa517d9
include/core/SkMilestone.h
include/core/SkMilestone.h
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 99 #endif
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 100 #endif
Update Skia milestone to 100
Update Skia milestone to 100 Change-Id: I9d435a7a68ef870ef027ee3c6acb79792773868b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497609 Reviewed-by: Heather Miller <[email protected]> Auto-Submit: Heather Miller <[email protected]> Reviewed-by: Eric Boren <[email protected]> Commit-Queue: Eric Boren <[email protected]>
C
bsd-3-clause
aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia
1636cf91cd66ab4cae55854b25f45b1b77151c88
src/idx.h
src/idx.h
#ifndef __IDX_H_ENTRY_H__ #define __IDX_H_ENTRY_H__ typedef struct { unsigned char header[4]; int length; unsigned char *data; } IDX1_DATA ; typedef struct { unsigned char header[4]; int nimages; int nrows; int ncols; unsigned char *data; } IDX3_DATA ; int fread_idx1_file( char *slabelfname, IDX1_DATA *idxdata); #endif /* __IDX_H_ENTRY_H__ */
#ifndef __IDX_H_ENTRY_H__ #define __IDX_H_ENTRY_H__ typedef struct { unsigned char header[4]; int length; unsigned char *data; } IDX1_DATA ; typedef struct { unsigned char header[4]; int nimages; int nrows; int ncols; int length; unsigned char *data; } IDX3_DATA ; int fread_idx1_file( char *slabelfname, IDX1_DATA *idxdata); #endif /* __IDX_H_ENTRY_H__ */
Add a length field to the IDX3_DATA structure.
Add a length field to the IDX3_DATA structure.
C
mit
spytheman/MNIST-idx1-and-idx3-file-readers
f12a377ceee0f8ee2d5fc5dd83be6015197b5387
nvidia_library/NvidiaApi.h
nvidia_library/NvidiaApi.h
#pragma once #include "helpers.h" #include "nvidia_interface_datatypes.h" #include <vector> #include <memory> class NvidiaGPU; class NVLIB_EXPORTED NvidiaApi { public: NvidiaApi(); ~NvidiaApi(); int getGPUCount(); std::shared_ptr<NvidiaGPU> getGPU(int index); private: bool GPUloaded = false; std::vector<std::shared_ptr<NvidiaGPU>> gpus; bool ensureGPUsLoaded(); }; class NVLIB_EXPORTED NvidiaGPU { public: friend class NvidiaApi; float getCoreClock(); float getMemoryClock(); float getGPUUsage(); float getFBUsage(); float getVidUsage(); float getBusUsage(); private: NV_PHYSICAL_GPU_HANDLE handle; NvidiaGPU(NV_PHYSICAL_GPU_HANDLE handle); struct NVIDIA_CLOCK_FREQUENCIES frequencies; bool reloadFrequencies(); float getClockForSystem(NVIDIA_CLOCK_SYSTEM system); float getUsageForSystem(NVIDIA_DYNAMIC_PSTATES_SYSTEM system); };
#pragma once #include "helpers.h" #include "nvidia_interface_datatypes.h" #include <vector> #include <memory> class NvidiaGPU; class NVLIB_EXPORTED NvidiaApi { public: NvidiaApi(); ~NvidiaApi(); int getGPUCount(); std::shared_ptr<NvidiaGPU> getGPU(int index); private: std::vector<std::shared_ptr<NvidiaGPU>> gpus; bool ensureGPUsLoaded(); bool GPUloaded = false; }; class NVLIB_EXPORTED NvidiaGPU { public: friend class NvidiaApi; float getCoreClock(); float getMemoryClock(); float getGPUUsage(); float getFBUsage(); float getVidUsage(); float getBusUsage(); private: NV_PHYSICAL_GPU_HANDLE handle; NvidiaGPU(NV_PHYSICAL_GPU_HANDLE handle); struct NVIDIA_CLOCK_FREQUENCIES frequencies; bool reloadFrequencies(); float getClockForSystem(NVIDIA_CLOCK_SYSTEM system); float getUsageForSystem(NVIDIA_DYNAMIC_PSTATES_SYSTEM system); };
Tweak a minor alignment issue.
Tweak a minor alignment issue.
C
mit
ircubic/lib_gpu,ircubic/lib_gpu,ircubic/lib_gpu
b16eec4314bc8716ac56b8db04d1d49eaf9f8148
include/flatcc/portable/pversion.h
include/flatcc/portable/pversion.h
#define PORTABLE_VERSION_TEXT "0.2.5" #define PORTABLE_VERSION_MAJOR 0 #define PORTABLE_VERSION_MINOR 2 #define PORTABLE_VERSION_PATCH 5 /* 1 or 0 */ #define PORTABLE_VERSION_RELEASED 1
#define PORTABLE_VERSION_TEXT "0.2.6-pre" #define PORTABLE_VERSION_MAJOR 0 #define PORTABLE_VERSION_MINOR 2 #define PORTABLE_VERSION_PATCH 6 /* 1 or 0 */ #define PORTABLE_VERSION_RELEASED 0
Bump portable version to 0.2.6-pre
Bump portable version to 0.2.6-pre
C
apache-2.0
dvidelabs/flatcc,dvidelabs/flatcc,dvidelabs/flatcc
262de226f343c443c29c2e83328a8be07afbc3cc
include/flatcc/portable/pversion.h
include/flatcc/portable/pversion.h
#define PORTABLE_VERSION_TEXT "0.2.4" #define PORTABLE_VERSION_MAJOR 0 #define PORTABLE_VERSION_MINOR 2 #define PORTABLE_VERSION_PATCH 4 /* 1 or 0 */ #define PORTABLE_VERSION_RELEASED 1
#define PORTABLE_VERSION_TEXT "0.2.5-pre" #define PORTABLE_VERSION_MAJOR 0 #define PORTABLE_VERSION_MINOR 2 #define PORTABLE_VERSION_PATCH 5 /* 1 or 0 */ #define PORTABLE_VERSION_RELEASED 0
Update portable version to unreleased
Update portable version to unreleased
C
apache-2.0
dvidelabs/flatcc,dvidelabs/flatcc,dvidelabs/flatcc
472036f0d4e28d8829b47ae4f8405849e8aed687
lab4.c
lab4.c
/* lab4.c: Read integers and print out the sum of all even and odd * numbers separately */ #include <stdio.h> int main() { int num = 0; int even_sum = 0; int odd_sum = 0; do { printf("Enter an integer: "); fflush(stdout); scanf("%d",&num); switch (num % 2) { case 0: even_sum += num; break; default: odd_sum += num; } } while (num != 0); printf("Sum of evens: %d\n", even_sum); printf("Sum of odds: %d\n", odd_sum); return 0; }
Rewrite of odd/even number program for arbitrary number of inputs using switch statement
Rewrite of odd/even number program for arbitrary number of inputs using switch statement
C
mit
sookoor/Learn-C-the-Hard-Way,sookoor/Learn-C-the-Hard-Way,sookoor/Learn-C-the-Hard-Way
459c21926c5bbefe8689a4b4fd6088d0e6ed05f1
main.c
main.c
#include <stdio.h> #include <stdlib.h> #include <termbox.h> #include "editor.h" #include "util.h" int main(int argc, char *argv[]) { debug_init(); editor_t editor; cursor_t cursor; editor_init(&editor, &cursor, argc > 1 ? argv[1] : NULL); int err = tb_init(); if (err) { fprintf(stderr, "tb_init() failed with error code %d\n", err); return 1; } atexit(tb_shutdown); editor_draw(&editor); struct tb_event ev; while (tb_poll_event(&ev)) { switch (ev.type) { case TB_EVENT_KEY: editor_handle_key_press(&editor, &ev); break; case TB_EVENT_RESIZE: editor_draw(&editor); break; default: break; } } return 0; }
#include <stdio.h> #include <stdlib.h> #include <signal.h> #include <termbox.h> #include "editor.h" #include "util.h" // termbox catches ctrl-z as a regular key event. To suspend the process as // normal, manually raise SIGTSTP. // // Not 100% sure why we need to shutdown termbox, but the terminal gets all // weird if we don't. Mainly copied this approach from here: // https://github.com/nsf/godit/blob/master/suspend_linux.go static void suspend(editor_t *editor) { tb_shutdown(); raise(SIGTSTP); int err = tb_init(); if (err) { fprintf(stderr, "tb_init() failed with error code %d\n", err); exit(1); } editor_draw(editor); } int main(int argc, char *argv[]) { debug_init(); editor_t editor; cursor_t cursor; editor_init(&editor, &cursor, argc > 1 ? argv[1] : NULL); int err = tb_init(); if (err) { fprintf(stderr, "tb_init() failed with error code %d\n", err); return 1; } atexit(tb_shutdown); editor_draw(&editor); struct tb_event ev; while (tb_poll_event(&ev)) { switch (ev.type) { case TB_EVENT_KEY: if (ev.key == TB_KEY_CTRL_Z) { suspend(&editor); } else { editor_handle_key_press(&editor, &ev); } break; case TB_EVENT_RESIZE: editor_draw(&editor); break; default: break; } } return 0; }
Handle Ctrl-Z to suspend the process.
Handle Ctrl-Z to suspend the process.
C
mit
isbadawi/badavi
beed7117adc92edf3e5aefb1d341e29eab90b17d
libraries/mbed/common/exit.c
libraries/mbed/common/exit.c
/* mbed Microcontroller Library * Copyright (c) 2006-2013 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "semihost_api.h" #include "mbed_interface.h" #ifdef TOOLCHAIN_GCC_CW // TODO: Ideally, we would like to define directly "_ExitProcess" void mbed_exit(int return_code) { #else void exit(int return_code) { #endif #if DEVICE_SEMIHOST if (mbed_interface_connected()) { semihost_exit(); } #endif if (return_code) { mbed_die(); } while (1); }
/* mbed Microcontroller Library * Copyright (c) 2006-2013 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "semihost_api.h" #include "mbed_interface.h" #include "toolchain.h" #ifdef TOOLCHAIN_GCC_CW // TODO: Ideally, we would like to define directly "_ExitProcess" void mbed_exit(int return_code) { #else void exit(int return_code) { #endif #if DEVICE_SEMIHOST if (mbed_interface_connected()) { semihost_exit(); } #endif if (return_code) { mbed_die(); } while (1); } WEAK void __cxa_pure_virtual(void); WEAK void __cxa_pure_virtual(void) { exit(1); }
Add __cxa_pure_virtual to avoid pulling in functions from the C++ library
Add __cxa_pure_virtual to avoid pulling in functions from the C++ library Fixes PRMBED-859
C
apache-2.0
nabilbendafi/mbed,pradeep-gr/mbed-os5-onsemi,sam-geek/mbed,DanKupiniak/mbed,jrjang/mbed,alertby/mbed,svogl/mbed-os,nvlsianpu/mbed,mbedmicro/mbed,logost/mbed,hwfwgrp/mbed,mbedmicro/mbed,svastm/mbed,Sweet-Peas/mbed,radhika-raghavendran/mbed-os5.1-onsemi,pi19404/mbed,alertby/mbed,alertby/mbed,autopulated/mbed,devanlai/mbed,ARM-software/mbed-beetle,GustavWi/mbed,pedromes/mbed,jferreir/mbed,wodji/mbed,fanghuaqi/mbed,tung7970/mbed-os,RonEld/mbed,svogl/mbed-os,devanlai/mbed,YarivCol/mbed-os,kl-cruz/mbed-os,ban4jp/mbed,NitinBhaskar/mbed,screamerbg/mbed,fpiot/mbed-ats,RonEld/mbed,K4zuki/mbed,larks/mbed,jferreir/mbed,FranklyDev/mbed,andreaslarssonublox/mbed,HeadsUpDisplayInc/mbed,mmorenobarm/mbed-os,wodji/mbed,NitinBhaskar/mbed,fahhem/mbed-os,Willem23/mbed,0xc0170/mbed-drivers,svastm/mbed,geky/mbed,bikeNomad/mbed,andreaslarssonublox/mbed,CalSol/mbed,jeremybrodt/mbed,sam-geek/mbed,CalSol/mbed,xcrespo/mbed,Timmmm/mbed,mmorenobarm/mbed-os,JasonHow44/mbed,mikaleppanen/mbed-os,theotherjimmy/mbed,tung7970/mbed-os-1,Sweet-Peas/mbed,svogl/mbed-os,bentwire/mbed,fvincenzo/mbed-os,hwfwgrp/mbed,kl-cruz/mbed-os,JasonHow44/mbed,mikaleppanen/mbed-os,maximmbed/mbed,nabilbendafi/mbed,HeadsUpDisplayInc/mbed,masaohamanaka/mbed,Willem23/mbed,devanlai/mbed,jeremybrodt/mbed,karsev/mbed-os,screamerbg/mbed,sam-geek/mbed,fanghuaqi/mbed,brstew/MBED-BUILD,cvtsi2sd/mbed-os,pi19404/mbed,Tiryoh/mbed,NXPmicro/mbed,kjbracey-arm/mbed,NitinBhaskar/mbed,infinnovation/mbed-os,sg-/mbed-drivers,cvtsi2sd/mbed-os,pedromes/mbed,NXPmicro/mbed,Archcady/mbed-os,xcrespo/mbed,mmorenobarm/mbed-os,bremoran/mbed-drivers,NXPmicro/mbed,JasonHow44/mbed,Marcomissyou/mbed,GustavWi/mbed,adamgreen/mbed,catiedev/mbed-os,screamerbg/mbed,hwfwgrp/mbed,struempelix/mbed,adustm/mbed,netzimme/mbed-os,autopulated/mbed,Shengliang/mbed,wodji/mbed,brstew/MBED-BUILD,FranklyDev/mbed,cvtsi2sd/mbed-os,cvtsi2sd/mbed-os,kpurusho/mbed,bikeNomad/mbed,fanghuaqi/mbed,tung7970/mbed-os-1,nabilbendafi/mbed,adustm/mbed,hwfwgrp/mbed,hwfwgrp/mbed,pi19404/mbed,nRFMesh/mbed-os,CalSol/mbed,radhika-raghavendran/mbed-os5.1-onsemi,struempelix/mbed,svastm/mbed,ryankurte/mbed-os,andcor02/mbed-os,RonEld/mbed,getopenmono/mbed,GustavWi/mbed,HeadsUpDisplayInc/mbed,adamgreen/mbed,andcor02/mbed-os,betzw/mbed-os,Shengliang/mbed,wodji/mbed,getopenmono/mbed,jferreir/mbed,rgrover/mbed,pradeep-gr/mbed-os5-onsemi,pedromes/mbed,mnlipp/mbed,tung7970/mbed-os,ryankurte/mbed-os,jamesadevine/mbed,al177/mbed,jferreir/mbed,wodji/mbed,HeadsUpDisplayInc/mbed,j-greffe/mbed-os,RonEld/mbed,bikeNomad/mbed,DanKupiniak/mbed,bulislaw/mbed-os,dbestm/mbed,andcor02/mbed-os,Timmmm/mbed,mnlipp/mbed,netzimme/mbed-os,EmuxEvans/mbed,getopenmono/mbed,Marcomissyou/mbed,YarivCol/mbed-os,ban4jp/mbed,bulislaw/mbed-os,adustm/mbed,Shengliang/mbed,Tiryoh/mbed,naves-thiago/mbed-midi,naves-thiago/mbed-midi,larks/mbed,tung7970/mbed-os,j-greffe/mbed-os,adustm/mbed,theotherjimmy/mbed,nvlsianpu/mbed,CalSol/mbed,JasonHow44/mbed,brstew/MBED-BUILD,mbedmicro/mbed,alertby/mbed,infinnovation/mbed-os,masaohamanaka/mbed,devanlai/mbed,rosterloh/mbed,jrjang/mbed,Shengliang/mbed,bentwire/mbed,geky/mbed,naves-thiago/mbed-midi,catiedev/mbed-os,maximmbed/mbed,brstew/MBED-BUILD,bentwire/mbed,infinnovation/mbed-os,infinnovation/mbed-os,fanghuaqi/mbed,tung7970/mbed-os-1,pedromes/mbed,betzw/mbed-os,YarivCol/mbed-os,Marcomissyou/mbed,mazimkhan/mbed-os,Archcady/mbed-os,fanghuaqi/mbed,Willem23/mbed,tung7970/mbed-os-1,karsev/mbed-os,ARM-software/mbed-beetle,iriark01/mbed-drivers,FranklyDev/mbed,bremoran/mbed-drivers,NordicSemiconductor/mbed,bentwire/mbed,jamesadevine/mbed,jamesadevine/mbed,mazimkhan/mbed-os,bcostm/mbed-os,GustavWi/mbed,masaohamanaka/mbed,autopulated/mbed,geky/mbed,kjbracey-arm/mbed,K4zuki/mbed,NitinBhaskar/mbed,nRFMesh/mbed-os,nabilbendafi/mbed,fpiot/mbed-ats,jferreir/mbed,rgrover/mbed,rosterloh/mbed,getopenmono/mbed,Marcomissyou/mbed,jpbrucker/mbed,Tiryoh/mbed,andcor02/mbed-os,mikaleppanen/mbed-os,rosterloh/mbed,pedromes/mbed,K4zuki/mbed,jrjang/mbed,nvlsianpu/mbed,mazimkhan/mbed-os,larks/mbed,ryankurte/mbed-os,kpurusho/mbed,mnlipp/mbed,xcrespo/mbed,dbestm/mbed,struempelix/mbed,FranklyDev/mbed,bentwire/mbed,dbestm/mbed,fahhem/mbed-os,fvincenzo/mbed-os,pradeep-gr/mbed-os5-onsemi,andreaslarssonublox/mbed,mazimkhan/mbed-os,masaohamanaka/mbed,dbestm/mbed,autopulated/mbed,j-greffe/mbed-os,NordicSemiconductor/mbed,NXPmicro/mbed,DanKupiniak/mbed,jeremybrodt/mbed,andcor02/mbed-os,FranklyDev/mbed,Willem23/mbed,kpurusho/mbed,mmorenobarm/mbed-os,Sweet-Peas/mbed,alertby/mbed,fahhem/mbed-os,logost/mbed,c1728p9/mbed-os,nRFMesh/mbed-os,kl-cruz/mbed-os,mnlipp/mbed,nvlsianpu/mbed,mbedmicro/mbed,struempelix/mbed,HeadsUpDisplayInc/mbed,monkiineko/mbed-os,Marcomissyou/mbed,YarivCol/mbed-os,mazimkhan/mbed-os,nRFMesh/mbed-os,nvlsianpu/mbed,Timmmm/mbed,brstew/MBED-BUILD,sam-geek/mbed,getopenmono/mbed,theotherjimmy/mbed,adamgreen/mbed,karsev/mbed-os,sg-/mbed-drivers,bikeNomad/mbed,logost/mbed,devanlai/mbed,monkiineko/mbed-os,adustm/mbed,c1728p9/mbed-os,xcrespo/mbed,pi19404/mbed,j-greffe/mbed-os,EmuxEvans/mbed,logost/mbed,radhika-raghavendran/mbed-os5.1-onsemi,Timmmm/mbed,autopulated/mbed,sam-geek/mbed,rosterloh/mbed,maximmbed/mbed,naves-thiago/mbed-midi,jpbrucker/mbed,jeremybrodt/mbed,kpurusho/mbed,Willem23/mbed,iriark01/mbed-drivers,pbrook/mbed,fahhem/mbed-os,ban4jp/mbed,K4zuki/mbed,jpbrucker/mbed,fpiot/mbed-ats,jpbrucker/mbed,pbrook/mbed,mikaleppanen/mbed-os,monkiineko/mbed-os,maximmbed/mbed,mikaleppanen/mbed-os,andreaslarssonublox/mbed,fpiot/mbed-ats,K4zuki/mbed,mazimkhan/mbed-os,Archcady/mbed-os,Sweet-Peas/mbed,hwfwgrp/mbed,mbedmicro/mbed,Shengliang/mbed,monkiineko/mbed-os,JasonHow44/mbed,tung7970/mbed-os-1,getopenmono/mbed,adamgreen/mbed,bcostm/mbed-os,NordicSemiconductor/mbed,bcostm/mbed-os,catiedev/mbed-os,struempelix/mbed,ban4jp/mbed,screamerbg/mbed,rgrover/mbed,karsev/mbed-os,NitinBhaskar/mbed,al177/mbed,Archcady/mbed-os,netzimme/mbed-os,devanlai/mbed,masaohamanaka/mbed,ARM-software/mbed-beetle,monkiineko/mbed-os,bulislaw/mbed-os,ARM-software/mbed-beetle,bcostm/mbed-os,dbestm/mbed,rgrover/mbed,autopulated/mbed,0xc0170/mbed-drivers,j-greffe/mbed-os,netzimme/mbed-os,tung7970/mbed-os,RonEld/mbed,HeadsUpDisplayInc/mbed,CalSol/mbed,kl-cruz/mbed-os,j-greffe/mbed-os,fahhem/mbed-os,betzw/mbed-os,ryankurte/mbed-os,svastm/mbed,svogl/mbed-os,jamesadevine/mbed,EmuxEvans/mbed,Archcady/mbed-os,nRFMesh/mbed-os,al177/mbed,Timmmm/mbed,Tiryoh/mbed,nvlsianpu/mbed,bentwire/mbed,screamerbg/mbed,Archcady/mbed-os,bcostm/mbed-os,naves-thiago/mbed-midi,nabilbendafi/mbed,pi19404/mbed,ban4jp/mbed,al177/mbed,pi19404/mbed,catiedev/mbed-os,Sweet-Peas/mbed,fahhem/mbed-os,infinnovation/mbed-os,pbrook/mbed,K4zuki/mbed,arostm/mbed-os,Tiryoh/mbed,mikaleppanen/mbed-os,theotherjimmy/mbed,bulislaw/mbed-os,netzimme/mbed-os,kjbracey-arm/mbed,karsev/mbed-os,c1728p9/mbed-os,ryankurte/mbed-os,EmuxEvans/mbed,svastm/mbed,Shengliang/mbed,netzimme/mbed-os,maximmbed/mbed,kl-cruz/mbed-os,pradeep-gr/mbed-os5-onsemi,arostm/mbed-os,rosterloh/mbed,EmuxEvans/mbed,NXPmicro/mbed,al177/mbed,pradeep-gr/mbed-os5-onsemi,radhika-raghavendran/mbed-os5.1-onsemi,arostm/mbed-os,arostm/mbed-os,arostm/mbed-os,jpbrucker/mbed,bulislaw/mbed-os,kpurusho/mbed,larks/mbed,geky/mbed,kjbracey-arm/mbed,dbestm/mbed,mmorenobarm/mbed-os,GustavWi/mbed,adamgreen/mbed,wodji/mbed,ban4jp/mbed,radhika-raghavendran/mbed-os5.1-onsemi,CalSol/mbed,theotherjimmy/mbed,rosterloh/mbed,bulislaw/mbed-os,Tiryoh/mbed,al177/mbed,YarivCol/mbed-os,infinnovation/mbed-os,kl-cruz/mbed-os,larks/mbed,mnlipp/mbed,cvtsi2sd/mbed-os,jrjang/mbed,fvincenzo/mbed-os,fpiot/mbed-ats,geky/mbed,theotherjimmy/mbed,nabilbendafi/mbed,tung7970/mbed-os,masaohamanaka/mbed,andreaslarssonublox/mbed,EmuxEvans/mbed,jamesadevine/mbed,alertby/mbed,mnlipp/mbed,xcrespo/mbed,cvtsi2sd/mbed-os,adustm/mbed,DanKupiniak/mbed,nRFMesh/mbed-os,larks/mbed,jrjang/mbed,betzw/mbed-os,c1728p9/mbed-os,screamerbg/mbed,pbrook/mbed,logost/mbed,betzw/mbed-os,monkiineko/mbed-os,JasonHow44/mbed,bikeNomad/mbed,karsev/mbed-os,adamgreen/mbed,andcor02/mbed-os,c1728p9/mbed-os,bcostm/mbed-os,mmorenobarm/mbed-os,Timmmm/mbed,pradeep-gr/mbed-os5-onsemi,radhika-raghavendran/mbed-os5.1-onsemi,fvincenzo/mbed-os,jrjang/mbed,ryankurte/mbed-os,brstew/MBED-BUILD,svogl/mbed-os,Sweet-Peas/mbed,RonEld/mbed,pbrook/mbed,maximmbed/mbed,rgrover/mbed,pbrook/mbed,jeremybrodt/mbed,xcrespo/mbed,NXPmicro/mbed,logost/mbed,struempelix/mbed,YarivCol/mbed-os,catiedev/mbed-os,fvincenzo/mbed-os,jferreir/mbed,NordicSemiconductor/mbed,kpurusho/mbed,Marcomissyou/mbed,naves-thiago/mbed-midi,arostm/mbed-os,c1728p9/mbed-os,pedromes/mbed,fpiot/mbed-ats,svogl/mbed-os,jpbrucker/mbed,betzw/mbed-os,catiedev/mbed-os,jamesadevine/mbed
e4c6b241a94c6828710faa00e1ac9188c26667eb
shared-module/_protomatter/allocator.h
shared-module/_protomatter/allocator.h
#ifndef MICROPY_INCLUDED_SHARED_MODULE_PROTOMATTER_ALLOCATOR_H #define MICROPY_INCLUDED_SHARED_MODULE_PROTOMATTER_ALLOCATOR_H #include <stdbool.h> #include "py/gc.h" #include "py/misc.h" #include "supervisor/memory.h" #define _PM_ALLOCATOR _PM_allocator_impl #define _PM_FREE(x) (_PM_free_impl((x)), (x)=NULL, (void)0) static inline void *_PM_allocator_impl(size_t sz) { if (gc_alloc_possible()) { return m_malloc(sz + sizeof(void*), true); } else { supervisor_allocation *allocation = allocate_memory(align32_size(sz), true); return allocation ? allocation->ptr : NULL; } } static inline void _PM_free_impl(void *ptr_in) { supervisor_allocation *allocation = allocation_from_ptr(ptr_in); if (allocation) { free_memory(allocation); } } #endif
#ifndef MICROPY_INCLUDED_SHARED_MODULE_PROTOMATTER_ALLOCATOR_H #define MICROPY_INCLUDED_SHARED_MODULE_PROTOMATTER_ALLOCATOR_H #include <stdbool.h> #include "py/gc.h" #include "py/misc.h" #include "supervisor/memory.h" #define _PM_ALLOCATOR _PM_allocator_impl #define _PM_FREE(x) (_PM_free_impl((x)), (x)=NULL, (void)0) static inline void *_PM_allocator_impl(size_t sz) { if (gc_alloc_possible()) { return m_malloc(sz + sizeof(void*), true); } else { supervisor_allocation *allocation = allocate_memory(align32_size(sz), false); return allocation ? allocation->ptr : NULL; } } static inline void _PM_free_impl(void *ptr_in) { supervisor_allocation *allocation = allocation_from_ptr(ptr_in); if (allocation) { free_memory(allocation); } } #endif
Use low end of supervisor heap
protomatter: Use low end of supervisor heap Per @tannewt, this area "sees more churn", so it's probably the right choice here
C
mit
adafruit/circuitpython,adafruit/micropython,adafruit/circuitpython,adafruit/micropython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/micropython,adafruit/micropython,adafruit/circuitpython,adafruit/micropython
f7c992a59e005e2f555a75cc23c83948c856435a
src/writer/verilog/task.h
src/writer/verilog/task.h
// -*- C++ -*- #ifndef _writer_verilog_task_h_ #define _writer_verilog_task_h_ #include "writer/verilog/resource.h" namespace iroha { namespace writer { namespace verilog { class Task : public Resource { public: Task(const IResource &res, const Table &table); virtual void BuildResource(); virtual void BuildInsn(IInsn *insn, State *st); static bool IsTask(const Table &table); static string TaskEnablePin(const ITable &tab, const ITable *caller); static const int kTaskEntryStateId; private: void BuildTaskResource(); void BuildTaskCallResource(); void BuildCallWire(IResource *caller); void BuildTaskCallInsn(IInsn *insn, State *st); void AddPort(const IModule *mod, IResource *caller); void AddWire(const IModule *mod, IResource *caller); static string TaskPinPrefix(const ITable &tab, const ITable *caller); static string TaskAckPin(const ITable &tab, const ITable *caller); }; } // namespace verilog } // namespace writer } // namespace iroha #endif // _writer_verilog_task_h_
// -*- C++ -*- #ifndef _writer_verilog_task_h_ #define _writer_verilog_task_h_ #include "writer/verilog/resource.h" namespace iroha { namespace writer { namespace verilog { class Task : public Resource { public: Task(const IResource &res, const Table &table); virtual void BuildResource(); virtual void BuildInsn(IInsn *insn, State *st); static bool IsTask(const Table &table); static string TaskEnablePin(const ITable &tab, const ITable *caller); static const int kTaskEntryStateId; private: void BuildTaskResource(); void BuildTaskCallResource(); void BuildCallWire(IResource *caller); void BuildTaskCallInsn(IInsn *insn, State *st); void AddPort(const IModule *mod, IResource *caller, bool upward); void AddWire(const IModule *mod, IResource *caller); static string TaskPinPrefix(const ITable &tab, const ITable *caller); static string TaskAckPin(const ITable &tab, const ITable *caller); }; } // namespace verilog } // namespace writer } // namespace iroha #endif // _writer_verilog_task_h_
Fix a missed file in previous change.
Fix a missed file in previous change.
C
bsd-3-clause
nlsynth/iroha,nlsynth/iroha