after
stringlengths
72
2.11k
before
stringlengths
21
1.55k
diff
stringlengths
85
2.31k
instruction
stringlengths
20
1.71k
license
stringclasses
13 values
repos
stringlengths
7
82.6k
commit
stringlengths
40
40
// // Copyright 2018 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // util_export.h : Defines ANGLE_UTIL_EXPORT, a macro for exporting symbols. #ifndef UTIL_EXPORT_H_ #define UTIL_EXPORT_H_ #if !defined(ANGLE_UTIL_EXPORT) # if defined(_WIN32) # if defined(LIBANGLE_UTIL_IMPLEMENTATION) # define ANGLE_UTIL_EXPORT __declspec(dllexport) # else # define ANGLE_UTIL_EXPORT __declspec(dllimport) # endif # elif defined(__GNUC__) # if defined(LIBANGLE_UTIL_IMPLEMENTATION) # define ANGLE_UTIL_EXPORT __attribute__((visibility("default"))) # else # define ANGLE_UTIL_EXPORT # endif # else # define ANGLE_UTIL_EXPORT # endif #endif // !defined(ANGLE_UTIL_EXPORT) #endif // UTIL_EXPORT_H_
// // Copyright 2018 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // util_export.h : Defines ANGLE_UTIL_EXPORT, a macro for exporting symbols. #ifndef UTIL_EXPORT_H_ #define UTIL_EXPORT_H_ #if !defined(ANGLE_UTIL_EXPORT) # if defined(_WIN32) # if defined(LIBANGLE_UTIL_IMPLEMENTATION) # define ANGLE_UTIL_EXPORT __declspec(dllexport) # else # define ANGLE_UTIL_EXPORT __declspec(dllimport) # endif # elif defined(__GNUC__) # define ANGLE_UTIL_EXPORT __attribute__((visibility("default"))) # else # define ANGLE_UTIL_EXPORT # endif #endif // !defined(ANGLE_UTIL_EXPORT) #endif // UTIL_EXPORT_H_
--- +++ @@ -16,7 +16,11 @@ # define ANGLE_UTIL_EXPORT __declspec(dllimport) # endif # elif defined(__GNUC__) -# define ANGLE_UTIL_EXPORT __attribute__((visibility("default"))) +# if defined(LIBANGLE_UTIL_IMPLEMENTATION) +# define ANGLE_UTIL_EXPORT __attribute__((visibility("default"))) +# else +# define ANGLE_UTIL_EXPORT +# endif # else # define ANGLE_UTIL_EXPORT # endif
Revert "util: Always specify default visibility on exports." This reverts commit 2bf23ea84e4f071c18f01b94748f3be7dccc4019. Reason for revert: Probably not the right fix. Will export all angle_utils symbols in places where they shouldn't be. Original change's description: > util: Always specify default visibility on exports. > > This fixes undefined behaviour with CFI. > > Bug: chromium:1015810 > Bug: angleproject:3162 > Change-Id: I58cfb78adabbff05e5b4560dfd70b190411fa26d > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869303 > Reviewed-by: Jamie Madill <7e492b4f1c8458024932de3ba475cbf015424c30@chromium.org> > Commit-Queue: Jamie Madill <7e492b4f1c8458024932de3ba475cbf015424c30@chromium.org> TBR=ynovikov@chromium.org,7e492b4f1c8458024932de3ba475cbf015424c30@chromium.org Change-Id: Ie847a9e6506178eb2b14e63a1ee5e9a1775b4548 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:1015810, angleproject:3162 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869546 Reviewed-by: Jamie Madill <7e492b4f1c8458024932de3ba475cbf015424c30@chromium.org> Commit-Queue: Jamie Madill <7e492b4f1c8458024932de3ba475cbf015424c30@chromium.org>
bsd-3-clause
ppy/angle,ppy/angle,ppy/angle,ppy/angle
0163470450726394efaf11570daade9f34eb2f6e
#ifndef PICTUS_ACTIONMAP_H #define PICTUS_ACTIONMAP_H #include <functional> #include <map> namespace App { template <typename _key, typename _param> class ActionMapParam { public: typedef typename std::function<void(_param)> Function_Type; void AddAction(_key id, Function_Type f) { m_map[id] = f; } bool Execute(_key id, _param e) { auto i = m_map.find(id); if(i == m_map.end()) return false; (i->second)(e); return true; } private: typedef std::map<_key, Function_Type> FunctionMap; FunctionMap m_map; }; template <typename _key> class ActionMapNoParam { public: typedef std::function<void()> Function_Type; void AddAction(_key id, Function_Type f) { m_map[id] = f; } bool Execute(_key id) { auto i = m_map.find(id); if(i == m_map.end()) return false; (i->second)(); return true; } private: typedef std::map<_key, Function_Type> FunctionMap; FunctionMap m_map; }; } #endif
#ifndef PICTUS_ACTIONMAP_H #define PICTUS_ACTIONMAP_H #include <boost/function.hpp> #include <map> namespace App { template <typename _key, typename _param> class ActionMapParam { public: typedef boost::function<void(_param)> Function_Type; void AddAction(_key id, Function_Type f) { m_map[id] = f; } bool Execute(_key id, _param e) { auto i = m_map.find(id); if(i == m_map.end()) return false; (i->second)(e); return true; } private: typedef std::map<_key, Function_Type> FunctionMap; FunctionMap m_map; }; template <typename _key> class ActionMapNoParam { public: typedef boost::function<void()> Function_Type; void AddAction(_key id, Function_Type f) { m_map[id] = f; } bool Execute(_key id) { auto i = m_map.find(id); if(i == m_map.end()) return false; (i->second)(); return true; } private: typedef std::map<_key, Function_Type> FunctionMap; FunctionMap m_map; }; } #endif
--- +++ @@ -1,14 +1,14 @@ #ifndef PICTUS_ACTIONMAP_H #define PICTUS_ACTIONMAP_H -#include <boost/function.hpp> +#include <functional> #include <map> namespace App { template <typename _key, typename _param> class ActionMapParam { public: - typedef boost::function<void(_param)> Function_Type; + typedef typename std::function<void(_param)> Function_Type; void AddAction(_key id, Function_Type f) { m_map[id] = f; } @@ -31,7 +31,7 @@ template <typename _key> class ActionMapNoParam { public: - typedef boost::function<void()> Function_Type; + typedef std::function<void()> Function_Type; void AddAction(_key id, Function_Type f) { m_map[id] = f; }
Use std::function instead of boost::function
mit
poppeman/Pictus,poppeman/Pictus,poppeman/Pictus
e285db1f6f9f42e98ac7f3f36de4cc21d743e9ad
/* * consumer_sdl_osx.m -- An OS X compatibility shim for SDL * Copyright (C) 2010 Ushodaya Enterprises Limited * Author: Dan Dennedy * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _CONSUMER_SDL_OSX_H_ #define _CONSUMER_SDL_OSX_H_ #ifdef __DARWIN__ void* mlt_cocoa_autorelease_init(); void mlt_cocoa_autorelease_close( void* ); #else static inline void *mlt_cocoa_autorelease_init() { return NULL; } static inline void mlt_cocoa_autorelease_close(void* p) { } #endif #endif
/* * consumer_sdl_osx.m -- An OS X compatibility shim for SDL * Copyright (C) 2010 Ushodaya Enterprises Limited * Author: Dan Dennedy * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _CONSUMER_SDL_OSX_H_ #define _CONSUMER_SDL_OSX_H_ #ifdef __DARWIN__ void* mlt_cocoa_autorelease_init(); void mlt_cocoa_autorelease_close( void* ); #else static inline void *mlt_cocoa_autorelease_init() { return NULL; } static inline void mlt_cocoa_autorelease_close(void*) { } #endif #endif
--- +++ @@ -31,7 +31,7 @@ return NULL; } -static inline void mlt_cocoa_autorelease_close(void*) +static inline void mlt_cocoa_autorelease_close(void* p) { } #endif
Fix build on non-OSX due to missing parameter name.
lgpl-2.1
ttill/MLT,ttill/MLT-roto,siddharudh/mlt,xzhavilla/mlt,anba8005/mlt,zzhhui/mlt,ttill/MLT-roto-tracking,mltframework/mlt,siddharudh/mlt,j-b-m/mlt,mltframework/mlt,wideioltd/mlt,zzhhui/mlt,xzhavilla/mlt,j-b-m/mlt,zzhhui/mlt,siddharudh/mlt,anba8005/mlt,j-b-m/mlt,ttill/MLT-roto,ttill/MLT-roto-tracking,mltframework/mlt,gmarco/mlt-orig,wideioltd/mlt,xzhavilla/mlt,ttill/MLT,j-b-m/mlt,j-b-m/mlt,j-b-m/mlt,mltframework/mlt,xzhavilla/mlt,siddharudh/mlt,ttill/MLT-roto-tracking,xzhavilla/mlt,wideioltd/mlt,zzhhui/mlt,ttill/MLT,zzhhui/mlt,j-b-m/mlt,ttill/MLT-roto,ttill/MLT-roto,gmarco/mlt-orig,ttill/MLT-roto-tracking,siddharudh/mlt,wideioltd/mlt,ttill/MLT-roto,anba8005/mlt,gmarco/mlt-orig,ttill/MLT,anba8005/mlt,zzhhui/mlt,ttill/MLT-roto,anba8005/mlt,j-b-m/mlt,mltframework/mlt,gmarco/mlt-orig,wideioltd/mlt,ttill/MLT-roto-tracking,anba8005/mlt,gmarco/mlt-orig,wideioltd/mlt,xzhavilla/mlt,ttill/MLT-roto,gmarco/mlt-orig,ttill/MLT,mltframework/mlt,zzhhui/mlt,mltframework/mlt,ttill/MLT,gmarco/mlt-orig,j-b-m/mlt,gmarco/mlt-orig,gmarco/mlt-orig,mltframework/mlt,mltframework/mlt,wideioltd/mlt,xzhavilla/mlt,ttill/MLT,ttill/MLT-roto-tracking,j-b-m/mlt,siddharudh/mlt,siddharudh/mlt,ttill/MLT-roto-tracking,wideioltd/mlt,zzhhui/mlt,ttill/MLT-roto-tracking,ttill/MLT-roto-tracking,ttill/MLT-roto,anba8005/mlt,anba8005/mlt,anba8005/mlt,zzhhui/mlt,ttill/MLT-roto,xzhavilla/mlt,mltframework/mlt,wideioltd/mlt,siddharudh/mlt,ttill/MLT,siddharudh/mlt,xzhavilla/mlt,ttill/MLT
2b1c7246a6be5f0b57ee0cfea70b6a2613163b7e
// RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s // RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fno-show-source-location -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s // RUN: clang -fshort-enums -x c /dev/null 2>&1 | FileCheck -check-prefix=CHECK-SHORT-ENUMS %s // CHECK-OPTIONS1: -fblocks // CHECK-OPTIONS1: -fpascal-strings // CHECK-OPTIONS2: -fno-builtin // CHECK-OPTIONS2: -fno-common // CHECK-OPTIONS2: -fno-math-errno // CHECK-OPTIONS2: -fno-show-source-location // CHECL-OPTIONS2: -fshort-wchar // CHECK-SHORT-ENUMS: compiler does not support '-fshort-enums'
// RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings %s 2> %t // RUN: grep -F '"-fblocks"' %t // RUN: grep -F '"-fpascal-strings"' %t // RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fno-show-source-location -fshort-wchar %s 2> %t // RUN: grep -F '"-fno-builtin"' %t // RUN: grep -F '"-fno-common"' %t // RUN: grep -F '"-fno-math-errno"' %t // RUN: grep -F '"-fno-show-source-location"' %t // RUN: grep -F '"-fshort-wchar"' %t // RUN: clang -fshort-enums -x c /dev/null 2>&1 | FileCheck -check-prefix=CHECK-SHORT-ENUMS %s // CHECK-SHORT-ENUMS: compiler does not support '-fshort-enums'
--- +++ @@ -1,12 +1,14 @@ -// RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings %s 2> %t -// RUN: grep -F '"-fblocks"' %t -// RUN: grep -F '"-fpascal-strings"' %t -// RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fno-show-source-location -fshort-wchar %s 2> %t -// RUN: grep -F '"-fno-builtin"' %t -// RUN: grep -F '"-fno-common"' %t -// RUN: grep -F '"-fno-math-errno"' %t -// RUN: grep -F '"-fno-show-source-location"' %t -// RUN: grep -F '"-fshort-wchar"' %t +// RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s +// RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fno-show-source-location -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s // RUN: clang -fshort-enums -x c /dev/null 2>&1 | FileCheck -check-prefix=CHECK-SHORT-ENUMS %s +// CHECK-OPTIONS1: -fblocks +// CHECK-OPTIONS1: -fpascal-strings + +// CHECK-OPTIONS2: -fno-builtin +// CHECK-OPTIONS2: -fno-common +// CHECK-OPTIONS2: -fno-math-errno +// CHECK-OPTIONS2: -fno-show-source-location +// CHECL-OPTIONS2: -fshort-wchar + // CHECK-SHORT-ENUMS: compiler does not support '-fshort-enums'
Convert the remainder of this test case over to using FileCheck. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@91194 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,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
5099b80088141137d81c62d3e03208835faced06
/** * @file tasks.h * @brief Macros for configuring the run time tasks * * DAPLink Interface Firmware * Copyright (c) 2009-2020, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef TASK_H #define TASK_H // trouble here is that reset for different targets is implemented differently so all targets // have to use the largest stack or these have to be defined in multiple places... Not ideal // may want to move away from threads for some of these behaviours to optimize mempory usage (RAM) #define MAIN_TASK_STACK (864) #define MAIN_TASK_PRIORITY (osPriorityNormal) #endif
/** * @file tasks.h * @brief Macros for configuring the run time tasks * * DAPLink Interface Firmware * Copyright (c) 2009-2020, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef TASK_H #define TASK_H // trouble here is that reset for different targets is implemented differently so all targets // have to use the largest stack or these have to be defined in multiple places... Not ideal // may want to move away from threads for some of these behaviours to optimize mempory usage (RAM) #define MAIN_TASK_STACK (800) #define MAIN_TASK_PRIORITY (osPriorityNormal) #endif
--- +++ @@ -25,7 +25,7 @@ // trouble here is that reset for different targets is implemented differently so all targets // have to use the largest stack or these have to be defined in multiple places... Not ideal // may want to move away from threads for some of these behaviours to optimize mempory usage (RAM) -#define MAIN_TASK_STACK (800) +#define MAIN_TASK_STACK (864) #define MAIN_TASK_PRIORITY (osPriorityNormal) #endif
Fix k64f stack overflow during WebUSB flashing When flashing via the WebUSB interface (CMSIS v2) the K64F hangs and USB eventually times out. This is because the main stack overflows during this operation casuing RTX to trap and loop forever in osRtxErrorNotify. This patch prevents a stack overflow by by increasing the main stack size from 800 bytes to 864 bytes. Note - maximum stack usage recorded during WebUSB flashing is 816 bytes.
apache-2.0
google/DAPLink-port,google/DAPLink-port,google/DAPLink-port,google/DAPLink-port
2fefbbf03dbacb0ac6f5da487dad19bbe0958074
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2012 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kotaka/log.h> #include <kotaka/paths.h> inherit LIB_INITD; inherit UTILITY_COMPILE; static void create() { KERNELD->set_global_access("Test", 1); LOGD->post_message("test", LOG_DEBUG, "Test subsystem loading..."); load_dir("obj", 1); load_dir("sys", 1); LOGD->post_message("test", LOG_DEBUG, "Test subsystem loaded"); }
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2012 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kotaka/log.h> #include <kotaka/paths.h> inherit LIB_INITD; inherit UTILITY_COMPILE; static void create() { LOGD->post_message("test", LOG_DEBUG, "Test subsystem loading..."); load_dir("obj", 1); load_dir("sys", 1); LOGD->post_message("test", LOG_DEBUG, "Test subsystem loaded"); }
--- +++ @@ -25,6 +25,8 @@ static void create() { + KERNELD->set_global_access("Test", 1); + LOGD->post_message("test", LOG_DEBUG, "Test subsystem loading..."); load_dir("obj", 1);
Add global access to test subsystem
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
aacc405f32026f676293f5ba64d50e9a70ef50a9
// Copyright 2019 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef MATIO_WRAP_H_ #define MATIO_WRAP_H_ #include <cstddef> #include <cstdint> #include <cstdlib> #include "matio.h" int MatioRead(const char* file_name) { mat_t* matfd = Mat_Open(file_name, MAT_ACC_RDONLY); if (matfd == nullptr) { return 0; } size_t n = 0; Mat_GetDir(matfd, &n); Mat_Rewind(matfd); matvar_t* matvar = nullptr; while ((matvar = Mat_VarReadNextInfo(matfd)) != nullptr) { Mat_VarReadDataAll(matfd, matvar); Mat_VarGetSize(matvar); Mat_VarFree(matvar); } Mat_Close(matfd); return 0; } #endif
// Copyright 2019 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Adapter utility from fuzzer input to a temporary file, for fuzzing APIs that // require a file instead of an input buffer. #include <cstddef> #include <cstdint> #include <cstdlib> #include "matio.h" int MatioRead(const char* file_name) { mat_t* matfd = Mat_Open(file_name, MAT_ACC_RDONLY); if (matfd == nullptr) { return 0; } size_t n = 0; Mat_GetDir(matfd, &n); Mat_Rewind(matfd); matvar_t* matvar = nullptr; while ((matvar = Mat_VarReadNextInfo(matfd)) != nullptr) { Mat_VarReadDataAll(matfd, matvar); Mat_VarGetSize(matvar); Mat_VarFree(matvar); } Mat_Close(matfd); return 0; }
--- +++ @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Adapter utility from fuzzer input to a temporary file, for fuzzing APIs that -// require a file instead of an input buffer. +#ifndef MATIO_WRAP_H_ +#define MATIO_WRAP_H_ #include <cstddef> #include <cstdint> @@ -42,3 +42,5 @@ return 0; } + +#endif
Remove comment and add include guard
bsd-2-clause
tbeu/matio,MaartenBent/matio,tbeu/matio,tbeu/matio,MaartenBent/matio,tbeu/matio,MaartenBent/matio,MaartenBent/matio
0205d0b2e73e5bda5c045ae31edd05d5b9b688ec
#ifndef AT_NETWORK_H #define AT_NETWORK_H // Under Windows, define stuff that we need #ifdef _MSC_VER #include <winsock.h> #define MAXHOSTNAMELEN 64 #define EWOULDBLOCK WSAEWOULDBLOCK #define EINPROGRESS WSAEINPROGRESS #define MSG_WAITALL 0 typedef SOCKET Socket; typedef int socklen_t; typedef char SocketOptionFlag; typedef int SocketOptionValue; #else #include <unistd.h> #include <string.h> #include <netdb.h> #include <fcntl.h> #include <errno.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/param.h> #include <sys/select.h> #include <netinet/in.h> #include <netinet/tcp.h> typedef int Socket; typedef int SocketOptionFlag; typedef int SocketOptionValue; #endif void initNetwork(); void cleanupNetwork(); Socket openSocket(int domain, int type, int protocol); void closeSocket(Socket socket); void setBlockingFlag(Socket socket, bool block); bool getBlockingFlag(Socket socket); #endif
#ifndef AT_NETWORK_H #define AT_NETWORK_H // Under Windows, define stuff that we need #ifdef _MSC_VER #include <winsock.h> #define MAXHOSTNAMELEN 64 #define EWOULDBLOCK WSAEWOULDBLOCK #define EINPROGRESS WSAEINPROGRESS #define MSG_WAITALL 0 typedef SOCKET Socket; typedef int socklen_t; typedef char SocketOptionFlag; #else #include <unistd.h> #include <string.h> #include <netdb.h> #include <fcntl.h> #include <errno.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/param.h> #include <sys/select.h> #include <netinet/in.h> #include <netinet/tcp.h> typedef int Socket; typedef int SocketOptionFlag; #endif void initNetwork(); void cleanupNetwork(); Socket openSocket(int domain, int type, int protocol); void closeSocket(Socket socket); void setBlockingFlag(Socket socket, bool block); bool getBlockingFlag(Socket socket); #endif
--- +++ @@ -16,6 +16,7 @@ typedef SOCKET Socket; typedef int socklen_t; typedef char SocketOptionFlag; + typedef int SocketOptionValue; #else #include <unistd.h> #include <string.h> @@ -31,6 +32,7 @@ typedef int Socket; typedef int SocketOptionFlag; + typedef int SocketOptionValue; #endif
Add new typedef for values sent to setsockopt().
apache-2.0
ucfistirl/atlas,ucfistirl/atlas
ba84947c6085e4851198dc21b4e7abb477b7f20f
/* * Copyright 2017 Brandon Yannoni * * 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 INDEXED_ARRAY_QUEUE_H #define INDEXED_ARRAY_QUEUE_H #include <pthread.h> #include "../function_queue_element.h" #include "../function_queue.h" #include "../qterror.h" /* * This structure is used to store the function queue elements and any * persistant data necessary for the manipulation procedures. */ struct fqindexedarray { /* a pointer to an element array */ struct function_queue_element* elements; unsigned int front; /* the index of the "first" element */ unsigned int back; /* the index of the "last" element */ }; extern const struct fqdispatchtable fqdispatchtableia; #endif
/* * Copyright 2017 Brandon Yannoni * * 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 INDEXED_ARRAY_QUEUE_H #define INDEXED_ARRAY_QUEUE_H #include <pthread.h> #include "../function_queue_element.h" #include "../function_queue.h" #include "../qterror.h" /* * This structure is used to store the function queue elements and any * persistant data necessary for the manipulation procedures. */ struct fqindexedarray { /* a pointer to an element array */ struct function_queue_element* elements; pthread_mutex_t lock; /* unused */ pthread_cond_t wait; /* unused */ unsigned int front; /* the index of the "first" element */ unsigned int back; /* the index of the "last" element */ }; extern const struct fqdispatchtable fqdispatchtableia; #endif
--- +++ @@ -31,8 +31,6 @@ struct fqindexedarray { /* a pointer to an element array */ struct function_queue_element* elements; - pthread_mutex_t lock; /* unused */ - pthread_cond_t wait; /* unused */ unsigned int front; /* the index of the "first" element */ unsigned int back; /* the index of the "last" element */ };
Remove unused members in fqindexedarray structure
apache-2.0
byannoni/qthreads
d5c5dedbd8284dc6e20d1c86f370a025ad5c3d25
// We have to define the _GNU_SOURCE to get access to clone(2) and the CLONE_* // flags from sched.h #define _GNU_SOURCE #include <sched.h> #include <sys/syscall.h> #include <sys/wait.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> static int child_func(void* arg) { char* buf = (char*)arg; printf("Child sees buf = \"%s\"\n", buf); strcpy(buf, "hello from child"); return 0; } int main(int argc, char** argv) { // Allocate stack for child task. const int STACK_SIZE = 65536; char* stack = malloc(STACK_SIZE); if (!stack) { perror("malloc"); exit(1); } // When called with the command-line argument "vm", set the CLONE_VM flag on. unsigned long flags = 0; if (argc > 1 && !strcmp(argv[1], "vm")) { flags |= CLONE_VM; } char buf[100]; strcpy(buf, "hello from parent"); if (clone(child_func, stack + STACK_SIZE, flags | SIGCHLD, buf) == -1) { perror("clone"); exit(1); } int status; if (wait(&status) == -1) { perror("wait"); exit(1); } printf("Child exited with status %d. buf = \"%s\"\n", status, buf); return 0; }
// We have to define the _GNU_SOURCE to get access to clone(2) and the CLONE_* // flags from sched.h #define _GNU_SOURCE #include <sched.h> #include <sys/syscall.h> #include <sys/wait.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> static int child_func(void* arg) { char* buf = (char*)arg; strcpy(buf, "hello"); return 0; } int main(int argc, char** argv) { // Allocate stack for child task. const int STACK_SIZE = 65536; char* stack = malloc(STACK_SIZE); if (!stack) { perror("malloc"); exit(1); } // When called with the command-line argument "vm", set the CLONE_VM flag on. unsigned long flags = 0; if (argc > 1 && !strcmp(argv[1], "vm")) { flags |= CLONE_VM; } char buf[100] = {0}; if (clone(child_func, stack + STACK_SIZE, flags | SIGCHLD, buf) == -1) { perror("clone"); exit(1); } int status; if (wait(&status) == -1) { perror("wait"); exit(1); } printf("Child exited with status %d. buf = \"%s\"\n", status, buf); return 0; }
--- +++ @@ -11,7 +11,8 @@ static int child_func(void* arg) { char* buf = (char*)arg; - strcpy(buf, "hello"); + printf("Child sees buf = \"%s\"\n", buf); + strcpy(buf, "hello from child"); return 0; } @@ -30,7 +31,8 @@ flags |= CLONE_VM; } - char buf[100] = {0}; + char buf[100]; + strcpy(buf, "hello from parent"); if (clone(child_func, stack + STACK_SIZE, flags | SIGCHLD, buf) == -1) { perror("clone"); exit(1);
Change the sample to pass message from parent as well
unlicense
eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog
a835e62e608714541135f90a26f46e919e3e52aa
#include <pony/pony.h> #include "encore.h" encore_actor_t *encore_create(encore_actor_t *type) { return pony_create(type); } /// Allocate s bytes of memory, zeroed out void *encore_alloc(size_t *s) { void *mem = pony_alloc(s); memset(mem, 0, s); return mem; } /// The starting point of all Encore programs int encore_start(int argc, char** argv, encore_actor_t *type) { argc = pony_init(argc, argv); pony_actor_t* actor = encore_create(type); pony_sendargs(actor, _ENC__MSG_MAIN, argc, argv); return pony_start(PONY_DONT_WAIT); }
#include <pony/pony.h> #include "encore.h" encore_actor_t *encore_create(encore_create_t *type) { return pony_create(type); } /// Allocate s bytes of memory, zeroed out void *encore_alloc(size_t *s) { void *mem = pony_alloc(s); memset(mem, 0, s); return mem; } /// The starting point of all Encore programs int encore_start(int argc, char** argv, encore_actor_t *type) { argc = pony_init(argc, argv); pony_actor_t* actor = encore_create(type); pony_sendargs(actor, _ENC__MSG_MAIN, argc, argv); return pony_start(PONY_DONT_WAIT); }
--- +++ @@ -1,7 +1,7 @@ #include <pony/pony.h> #include "encore.h" -encore_actor_t *encore_create(encore_create_t *type) +encore_actor_t *encore_create(encore_actor_t *type) { return pony_create(type); }
Fix also applied to corresponding C file
bsd-3-clause
parapluu/encore,parapluu/encore,parapluu/encore
dcdb76edb97d03a550f014c653c0cc1155fe9154
// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -S -o - | FileCheck %s --check-prefix=CHECK-ABSENT // CHECK-ABSENT-NOT: section .stack_sizes // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fstack-size-section %s -S -o - | FileCheck %s --check-prefix=CHECK-PRESENT // CHECK-PRESENT: section .stack_sizes int foo() { return 42; }
// RUN: %clang_cc1 -triple x86_64-unknown %s -S -o - | FileCheck %s --check-prefix=CHECK-ABSENT // CHECK-ABSENT-NOT: section .stack_sizes // RUN: %clang_cc1 -triple x86_64-unknown -fstack-size-section %s -S -o - | FileCheck %s --check-prefix=CHECK-PRESENT // CHECK-PRESENT: section .stack_sizes int foo() { return 42; }
--- +++ @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple x86_64-unknown %s -S -o - | FileCheck %s --check-prefix=CHECK-ABSENT +// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -S -o - | FileCheck %s --check-prefix=CHECK-ABSENT // CHECK-ABSENT-NOT: section .stack_sizes -// RUN: %clang_cc1 -triple x86_64-unknown -fstack-size-section %s -S -o - | FileCheck %s --check-prefix=CHECK-PRESENT +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fstack-size-section %s -S -o - | FileCheck %s --check-prefix=CHECK-PRESENT // CHECK-PRESENT: section .stack_sizes int foo() { return 42; }
Fix test added in r321992 failing on some buildbots. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@321995 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
2cb8f29ecd8d8864a2110ef72fed242c107ef1a5
/** * @copyright Copyright 2017 The J-PET Framework Authors. All rights reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may find a copy of the License in the LICENCE file. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @file EventCategorizerTools.h */ #ifndef _EVENTCATEGORIZERTOOLS_H_ #define _EVENTCATEGORIZERTOOLS_H_ #include <JPetHit/JPetHit.h> struct Point3D { double x=0; double y=0; double z=0; }; class EventCategorizerTools { public: static double calculateTOF(const JPetHit& firstHit, const JPetHit& latterHit); static Point3D calculateAnnihilationPoint(const JPetHit& firstHit, const JPetHit& latterHit); }; #endif /* !EVENTCATEGORIZERTOOLS_H */
/** * @copyright Copyright 2017 The J-PET Framework Authors. All rights reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may find a copy of the License in the LICENCE file. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @file EventCategorizerTools.h */ #ifndef _EVENTCATEGORIZERTOOLS_H_ #define _EVENTCATEGORIZERTOOLS_H_ #include <DataObjects/JPetHit/JPetHit.h> struct Point3D { double x=0; double y=0; double z=0; }; class EventCategorizerTools { public: static double calculateTOF(const JPetHit& firstHit, const JPetHit& latterHit); static Point3D calculateAnnihilationPoint(const JPetHit& firstHit, const JPetHit& latterHit); }; #endif /* !EVENTCATEGORIZERTOOLS_H */
--- +++ @@ -16,7 +16,7 @@ #ifndef _EVENTCATEGORIZERTOOLS_H_ #define _EVENTCATEGORIZERTOOLS_H_ -#include <DataObjects/JPetHit/JPetHit.h> +#include <JPetHit/JPetHit.h> struct Point3D {
Change include to proper one
apache-2.0
JPETTomography/j-pet-framework-examples,JPETTomography/j-pet-framework-examples,JPETTomography/j-pet-framework-examples,JPETTomography/j-pet-framework-examples
aa075fd45fabc26875fb3ac5c34cce70fe3a7030
/** * Copyright (c) 2012 David Chisnall. * This work was funded by TBricks. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * */ void __cxa_finalize(void *d ); extern void __dso_handle; __attribute((destructor)) static void cleanup(void) { __cxa_finalize(&__dso_handle); }
void __cxa_finalize(void *d ); extern void __dso_handle; __attribute((destructor)) static void cleanup(void) { __cxa_finalize(&__dso_handle); }
--- +++ @@ -1,3 +1,26 @@ +/** + * Copyright (c) 2012 David Chisnall. + * This work was funded by TBricks. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + */ void __cxa_finalize(void *d ); extern void __dso_handle;
Add missing copyright in the other file.
bsd-2-clause
sudosurootdev/external_libcxxrt,xin3liang/platform_external_libcxxrt,vegard/libcxxrt,vegard/libcxxrt,cemeyer/libcxxrt,cemeyer/libcxxrt,sudosurootdev/external_libcxxrt,vegard/libcxxrt,sudosurootdev/external_libcxxrt,cemeyer/libcxxrt,xin3liang/platform_external_libcxxrt,xin3liang/platform_external_libcxxrt
7e7ec2f533ee4ff14372f76f23701e726651f27d
// // synchronizer.h // P2PSP // // This code is distributed under the GNU General Public License (see // THE_GENERAL_GNU_PUBLIC_LICENSE.txt for extending this information). // Copyright (C) 2016, the P2PSP team. // http://www.p2psp.org // #include <boost/format.hpp> #include <boost/program_options/parsers.hpp> #include <boost/program_options/variables_map.hpp> #include "../lib/p2psp/src/util/trace.h" #include <arpa/inet.h> #include <boost/array.hpp> #include <boost/asio.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/thread/thread.hpp> #include <ctime> #include <fstream> #include <string> #include <tuple> #include <vector> namespace p2psp { class Synchronizer { public: Synchronizer(); ~Synchronizer(); const std::vector<std::string>* peer_list; boost::thread_group thread_group_; void Run(int argc, const char* argv[]) throw(boost::system::system_error); //Run the argument parser void PlayChunk(); //Play the chunk to the player void Synchronize(); //To get the offset from the first peer and synchronize the lists void ConnectToPeers(std::string); //Connect the synchronizer with various peers }; }
// // synchronizer.h // P2PSP // // This code is distributed under the GNU General Public License (see // THE_GENERAL_GNU_PUBLIC_LICENSE.txt for extending this information). // Copyright (C) 2016, the P2PSP team. // http://www.p2psp.org // #include <boost/format.hpp> #include <boost/program_options/parsers.hpp> #include <boost/program_options/variables_map.hpp> #include "../lib/p2psp/src/util/trace.h" #include <arpa/inet.h> #include <boost/array.hpp> #include <boost/asio.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/thread/thread.hpp> #include <ctime> #include <fstream> #include <string> #include <tuple> #include <vector> namespace p2psp { class Synchronizer { public: Synchronizer(); ~Synchronizer(); const std::vector<std::string>* peer_list; void Run(int argc, const char* argv[]) throw(boost::system::system_error); //Run the argument parser void PlayChunk(); //Play the chunk to the player void Synchronize(); //To get the offset from the first peer and synchronize the lists void ConnectToPeers(); //Connect the synchronizer with various peers }; }
--- +++ @@ -32,11 +32,11 @@ ~Synchronizer(); const std::vector<std::string>* peer_list; - + boost::thread_group thread_group_; void Run(int argc, const char* argv[]) throw(boost::system::system_error); //Run the argument parser void PlayChunk(); //Play the chunk to the player void Synchronize(); //To get the offset from the first peer and synchronize the lists - void ConnectToPeers(); //Connect the synchronizer with various peers + void ConnectToPeers(std::string); //Connect the synchronizer with various peers }; }
Add thread group to manage threads
mit
hehaichi/p2psp-experiments,hehaichi/p2psp-experiments,hehaichi/p2psp-experiments
b2c0eb6364d545a0083ec3d1cb55ea04fa6c6e2a
/*++ Copyright (c) 2006, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: EdkPeCoffLoaderLib.h Abstract: Wrap the Base PE/COFF loader with the PE COFF Protocol --*/ #ifndef __PE_COFF_LOADER_LIB_H_ #define __PE_COFF_LOADER_LIB_H_ #include <Guid/PeiPeCoffLoader.h> EFI_PEI_PE_COFF_LOADER_PROTOCOL* EFIAPI GetPeCoffLoaderProtocol ( VOID ); #endif
/*++ Copyright (c) 2006, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: EdkPeCoffLoaderLib.h Abstract: Wrap the Base PE/COFF loader with the PE COFF Protocol --*/ #ifndef __PE_COFF_LOADER_LIB_H_ #define __PE_COFF_LOADER_LIB_H_ #include <Protocol/PeiPeCoffLoader.h> EFI_PEI_PE_COFF_LOADER_PROTOCOL* EFIAPI GetPeCoffLoaderProtocol ( VOID ); #endif
--- +++ @@ -23,7 +23,7 @@ #ifndef __PE_COFF_LOADER_LIB_H_ #define __PE_COFF_LOADER_LIB_H_ -#include <Protocol/PeiPeCoffLoader.h> +#include <Guid/PeiPeCoffLoader.h> EFI_PEI_PE_COFF_LOADER_PROTOCOL* EFIAPI
Move PeiPeCoffLoader from /Protocol to /Guid. git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@3047 6f19259b-4bc3-4df7-8a09-765794883524
bsd-2-clause
MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2
1bd430675c66ab64791a1aaf8260fd270486651d
// // VKVotable.h // VoatKit // // Created by Amar Ramachandran on 6/26/15. // Copyright © 2015 AmarJayR. All rights reserved. // #import "VKCreated.h" typedef NS_ENUM(NSUInteger, VKVoteStatus) { VKVoteStatusNone, VKVoteStatusUpvoted, VKVoteStatusDownvoted }; @interface VKVotable : VKCreated /** The total number of upvotes. */ @property (nonatomic, assign, readonly) NSNumber* upvotes; /** The total number of downvotes. */ @property (nonatomic, assign, readonly) NSNumber* downvotes; /** The object's score. */ @property (nonatomic, assign, readonly) NSNumber* score; /** The current user's vote status for this object. */ @property (nonatomic, assign, readonly) VKVoteStatus voteStatus; /** Whether the current user has upvoted this object. */ - (BOOL)upvoted; /** Whether the current user has downvoted this object. */ - (BOOL)downvoted; /** Whether the current user has voted on this object. */ - (BOOL)voted; @end
// // VKVotable.h // VoatKit // // Created by Amar Ramachandran on 6/26/15. // Copyright © 2015 AmarJayR. All rights reserved. // #import "VKCreated.h" typedef NS_ENUM(NSUInteger, VKVoteStatus) { VKVoteStatusUpvoted, VKVoteStatusDownvoted, VKVoteStatusNone }; @interface VKVotable : VKCreated /** The total number of upvotes. */ @property (nonatomic, assign, readonly) NSNumber* upvotes; /** The total number of downvotes. */ @property (nonatomic, assign, readonly) NSNumber* downvotes; /** The object's score. */ @property (nonatomic, assign, readonly) NSNumber* score; /** The current user's vote status for this object. */ @property (nonatomic, assign, readonly) VKVoteStatus voteStatus; /** Whether the current user has upvoted this object. */ - (BOOL)upvoted; /** Whether the current user has downvoted this object. */ - (BOOL)downvoted; /** Whether the current user has voted on this object. */ - (BOOL)voted; @end
--- +++ @@ -9,9 +9,9 @@ #import "VKCreated.h" typedef NS_ENUM(NSUInteger, VKVoteStatus) { + VKVoteStatusNone, VKVoteStatusUpvoted, - VKVoteStatusDownvoted, - VKVoteStatusNone + VKVoteStatusDownvoted }; @interface VKVotable : VKCreated
Change the default VKVoteStatus value to VKVoteStatusNone This is necessary because unvoted items don't send a "voteValue" field so the voteStatusJSONTransformer is never called
mit
nuudles/VoatKit,AmarJayR/VoatKit
077a4fb5a3055d6d681bdd885bc58a3b3c0830aa
/* USB commands use the first byte as the 'type' variable. * Subsequent bytes are generally the 'arguments'. * So host->device usb packets usually look like: * [command, arg1, arg2, 0, 0, ... , 0, 0] * to which the device will respond with * [CMD_ACK, command, 0, 0, 0 ..., 0, 0] * * The exception to this, are the commands which 'GET' * For them host->device generally looks like: * [command, 0, ..., 0, 0] * to which the device responds * [CMD_RESP, command, arg1, arg2, 0, ..., 0, 0] * */ #ifndef USB_COMMANDS_H #define USB_COMMANDS_H #define CMD_ACK 0xAF #define CMD_RESP 0xBF #define CMD_BL_ON 0x10 #define CMD_BL_OFF 0x11 #define CMD_BL_LEVEL 0x12 #define CMD_BL_UP 0x13 #define CMD_BL_DOWN 0x14 #define CMD_BL_GET_STATE 0x1F #define CMD_RGB_SET 0x20 #define CMD_RGB_GET 0x2F #endif
#ifndef USB_COMMANDS_H #define USB_COMMANDS_H #define CMD_ACK 0xAF #define CMD_RESP 0xBF #define CMD_BL_ON 0x10 #define CMD_BL_OFF 0x11 #define CMD_BL_LEVEL 0x12 #define CMD_BL_UP 0x13 #define CMD_BL_DOWN 0x14 #define CMD_BL_GET_STATE 0x1F #define CMD_RGB_SET 0x20 #define CMD_RGB_GET 0x2F #endif
--- +++ @@ -1,3 +1,17 @@ +/* USB commands use the first byte as the 'type' variable. + * Subsequent bytes are generally the 'arguments'. + * So host->device usb packets usually look like: + * [command, arg1, arg2, 0, 0, ... , 0, 0] + * to which the device will respond with + * [CMD_ACK, command, 0, 0, 0 ..., 0, 0] + * + * The exception to this, are the commands which 'GET' + * For them host->device generally looks like: + * [command, 0, ..., 0, 0] + * to which the device responds + * [CMD_RESP, command, arg1, arg2, 0, ..., 0, 0] + * */ + #ifndef USB_COMMANDS_H #define USB_COMMANDS_H
Document the usb protocol (ish)
bsd-3-clause
OSCARAdapter/OSCAR,OSCARAdapter/OSCAR
2b8300582a7e62df81ab5a32efee5c0053d61161
#ifndef __TYPES_H__ #define __TYPES_H__ typedef long off_t; typedef unsigned long size_t; typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */ typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; typedef int mode_t; typedef unsigned long clockid_t; typedef int pid_t; typedef int gid_t; typedef int uid_t; typedef int dev_t; typedef int ino_t; typedef int mode_t; typedef int caddr_t; typedef unsigned int wint_t; typedef unsigned long useconds_t; typedef unsigned long clock_t; /* clock() */ #ifndef NULL #define NULL (0) #endif #define __u_char_defined #endif
#ifndef __TYPES_H__ #define __TYPES_H__ typedef long off_t; typedef unsigned long size_t; typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */ typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; typedef int mode_t; typedef unsigned long clockid_t; typedef int pid_t; typedef unsigned long clock_t; /* clock() */ #ifndef NULL #define NULL (0) #endif #define __u_char_defined #endif
--- +++ @@ -15,6 +15,16 @@ typedef unsigned long clockid_t; typedef int pid_t; +typedef int gid_t; +typedef int uid_t; +typedef int dev_t; +typedef int ino_t; +typedef int mode_t; +typedef int caddr_t; + +typedef unsigned int wint_t; +typedef unsigned long useconds_t; + typedef unsigned long clock_t; /* clock() */ #ifndef NULL
[libc] Add more typedef in minilibc.
apache-2.0
geniusgogo/rt-thread,weety/rt-thread,nongxiaoming/rt-thread,weiyuliang/rt-thread,ArdaFu/rt-thread,nongxiaoming/rt-thread,AubrCool/rt-thread,FlyLu/rt-thread,armink/rt-thread,weiyuliang/rt-thread,FlyLu/rt-thread,hezlog/rt-thread,RT-Thread/rt-thread,hezlog/rt-thread,armink/rt-thread,armink/rt-thread,yongli3/rt-thread,hezlog/rt-thread,yongli3/rt-thread,weety/rt-thread,hezlog/rt-thread,zhaojuntao/rt-thread,weety/rt-thread,igou/rt-thread,igou/rt-thread,hezlog/rt-thread,hezlog/rt-thread,weiyuliang/rt-thread,gbcwbz/rt-thread,weety/rt-thread,FlyLu/rt-thread,AubrCool/rt-thread,ArdaFu/rt-thread,FlyLu/rt-thread,nongxiaoming/rt-thread,ArdaFu/rt-thread,weiyuliang/rt-thread,igou/rt-thread,FlyLu/rt-thread,igou/rt-thread,gbcwbz/rt-thread,geniusgogo/rt-thread,weiyuliang/rt-thread,AubrCool/rt-thread,zhaojuntao/rt-thread,zhaojuntao/rt-thread,wolfgangz2013/rt-thread,geniusgogo/rt-thread,igou/rt-thread,wolfgangz2013/rt-thread,AubrCool/rt-thread,gbcwbz/rt-thread,ArdaFu/rt-thread,weety/rt-thread,weety/rt-thread,gbcwbz/rt-thread,armink/rt-thread,RT-Thread/rt-thread,nongxiaoming/rt-thread,zhaojuntao/rt-thread,gbcwbz/rt-thread,gbcwbz/rt-thread,RT-Thread/rt-thread,wolfgangz2013/rt-thread,AubrCool/rt-thread,geniusgogo/rt-thread,geniusgogo/rt-thread,nongxiaoming/rt-thread,nongxiaoming/rt-thread,weiyuliang/rt-thread,AubrCool/rt-thread,RT-Thread/rt-thread,igou/rt-thread,RT-Thread/rt-thread,ArdaFu/rt-thread,yongli3/rt-thread,geniusgogo/rt-thread,armink/rt-thread,yongli3/rt-thread,AubrCool/rt-thread,RT-Thread/rt-thread,zhaojuntao/rt-thread,wolfgangz2013/rt-thread,yongli3/rt-thread,armink/rt-thread,ArdaFu/rt-thread,zhaojuntao/rt-thread,weety/rt-thread,yongli3/rt-thread,yongli3/rt-thread,zhaojuntao/rt-thread,weiyuliang/rt-thread,igou/rt-thread,gbcwbz/rt-thread,wolfgangz2013/rt-thread,nongxiaoming/rt-thread,FlyLu/rt-thread,wolfgangz2013/rt-thread,hezlog/rt-thread,geniusgogo/rt-thread,armink/rt-thread,RT-Thread/rt-thread,ArdaFu/rt-thread,FlyLu/rt-thread,wolfgangz2013/rt-thread
41f2f1829f3227b2d405feb75751ac5debfcc1e8
#include "scanner.h" void scanner_init() { scanner_token_init(); current_symbol = T_EOF; scanner_get_symbol(); } void scanner_token_init() { T_EOF = -1; } void scanner_get_symbol() { }
#include "scanner.h"
--- +++ @@ -1 +1,16 @@ #include "scanner.h" + +void scanner_init() { + scanner_token_init(); + + current_symbol = T_EOF; + scanner_get_symbol(); +} + +void scanner_token_init() { + T_EOF = -1; +} + +void scanner_get_symbol() { + +}
Add first (dummy) implementation of functions to make it compile
mit
danielkocher/ocelot2
6f245f8f098efa6c9c9e2dcafec83670921c8ea6
// // NSDate+RFC1123.h // MKNetworkKit // // Created by Marcus Rohrmoser // http://blog.mro.name/2009/08/nsdateformatter-http-header/ // http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 // No obvious license attached #import <Foundation/Foundation.h> /** Convert RFC1123 format dates */ @interface NSDate (RFC1123) /** * @name Convert a string to NSDate */ /** * Convert a RFC1123 'Full-Date' string * (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1) * into NSDate. * * @param value_ NSString* the string to convert * @return NSDate* */ +(NSDate*)dateFromRFC1123:(NSString*)value_; /** * @name Retrieve NSString value of the current date */ /** * Convert NSDate into a RFC1123 'Full-Date' string * (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1). * * @return NSString* */ @property (nonatomic, readonly, copy) NSString *rfc1123String; @end
// // NSDate+RFC1123.h // MKNetworkKit // // Created by Marcus Rohrmoser // http://blog.mro.name/2009/08/nsdateformatter-http-header/ // http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 // No obvious license attached /** Convert RFC1123 format dates */ @interface NSDate (RFC1123) /** * @name Convert a string to NSDate */ /** * Convert a RFC1123 'Full-Date' string * (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1) * into NSDate. * * @param value_ NSString* the string to convert * @return NSDate* */ +(NSDate*)dateFromRFC1123:(NSString*)value_; /** * @name Retrieve NSString value of the current date */ /** * Convert NSDate into a RFC1123 'Full-Date' string * (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1). * * @return NSString* */ @property (nonatomic, readonly, copy) NSString *rfc1123String; @end
--- +++ @@ -8,9 +8,10 @@ // No obvious license attached +#import <Foundation/Foundation.h> + /** Convert RFC1123 format dates - */ @interface NSDate (RFC1123)
Add explicit Foundation import to NSDate extension (for spm compatibility)
mit
thecatalinstan/Criollo,thecatalinstan/Criollo,thecatalinstan/Criollo
9dc95fbb934b842c8c055541d727477eb5de8d44
// RUN: %clang_scs %s -o %t // RUN: %run %t // Basic smoke test for the runtime #include "libc_support.h" #include "minimal_runtime.h" int scs_main(void) { scs_fputs_stdout("In main.\n"); return 0; }
// RUN: %clang_scs -D INCLUDE_RUNTIME %s -o %t // RUN: %run %t // RUN: %clang_scs %s -o %t // RUN: not --crash %run %t // Basic smoke test for the runtime #include "libc_support.h" #ifdef INCLUDE_RUNTIME #include "minimal_runtime.h" #else #define scs_main main #endif int scs_main(void) { scs_fputs_stdout("In main.\n"); return 0; }
--- +++ @@ -1,18 +1,10 @@ -// RUN: %clang_scs -D INCLUDE_RUNTIME %s -o %t +// RUN: %clang_scs %s -o %t // RUN: %run %t - -// RUN: %clang_scs %s -o %t -// RUN: not --crash %run %t // Basic smoke test for the runtime #include "libc_support.h" - -#ifdef INCLUDE_RUNTIME #include "minimal_runtime.h" -#else -#define scs_main main -#endif int scs_main(void) { scs_fputs_stdout("In main.\n");
[scs] Disable negative test in shadowcallstack. The test checks that scs does NOT work correctly w/o runtime support. That's a strange thing to test, and it is also flaky, because things may just work if x18 happens to point to a writable page. git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@335982 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt
06a3c0baea19e5ff295b34943fcec9609a686952
#include <stdlib.h> #include <check.h> #include "../src/roman_calculator.h" void verify_addition(const char *left, const char *right, const char *expected_result) { char *actual_result = roman_calculator_add(left, right); ck_assert_msg( strcmp(expected_result, actual_result) == 0, "%s + %s: expected %s, but was %s", left, right, expected_result, actual_result); free(actual_result); } START_TEST(can_add_by_simple_repetition) { verify_addition("I", "I", "II"); verify_addition("I", "II", "III"); verify_addition("XX", "X", "XXX"); verify_addition("C", "C", "CC"); verify_addition("M", "MM", "MMM"); } END_TEST START_TEST(can_add_by_concatenation) { verify_addition("X", "I", "XI"); verify_addition("MCX", "XV", "MCXXV"); verify_addition("DCI", "II", "DCIII"); verify_addition("LX", "XVI", "LXXVI"); } END_TEST TCase *addition_tests() { TCase *test_case = tcase_create("addition tests"); tcase_add_test(test_case, can_add_by_simple_repetition); tcase_add_test(test_case, can_add_by_concatenation); return test_case; }
#include <stdlib.h> #include <check.h> #include "../src/roman_calculator.h" void verify_addition(const char *left, const char *right, const char *expected_result) { char *actual_result = roman_calculator_add(left, right); ck_assert_msg( strcmp(expected_result, actual_result) == 0, "%s + %s: expected %s, but was %s", left, right, expected_result, actual_result); free(actual_result); } START_TEST(can_add_by_simple_repetition) { verify_addition("I", "I", "II"); verify_addition("I", "II", "III"); verify_addition("XX", "X", "XXX"); verify_addition("C", "C", "CC"); verify_addition("M", "MM", "MMM"); } END_TEST TCase *addition_tests() { TCase *test_case = tcase_create("addition tests"); tcase_add_test(test_case, can_add_by_simple_repetition); return test_case; }
--- +++ @@ -22,9 +22,19 @@ } END_TEST +START_TEST(can_add_by_concatenation) +{ + verify_addition("X", "I", "XI"); + verify_addition("MCX", "XV", "MCXXV"); + verify_addition("DCI", "II", "DCIII"); + verify_addition("LX", "XVI", "LXXVI"); +} +END_TEST + TCase *addition_tests() { TCase *test_case = tcase_create("addition tests"); tcase_add_test(test_case, can_add_by_simple_repetition); + tcase_add_test(test_case, can_add_by_concatenation); return test_case; }
Add clarifying test about addition by concatenation It doesn't just apply to repeating the same numeral.
mit
greghaskins/roman-calculator.c
1bf18c373e240b9a3f00e48084796a131171d19f
/* * This file is part of libFirm. * Copyright (C) 2012 University of Karlsruhe. */ /** * @file * @brief Implements several optimizations for IA32. * @author Christian Wuerdig */ #ifndef FIRM_BE_IA32_IA32_OPTIMIZE_H #define FIRM_BE_IA32_IA32_OPTIMIZE_H #include "firm_types.h" /** * Performs conv and address mode optimizations. * @param cg The ia32 codegenerator object */ void ia32_optimize_graph(ir_graph *irg); /** * Performs Peephole Optimizations an a graph. * * @param irg the graph * @param cg the code generator object */ void ia32_peephole_optimization(ir_graph *irg); /** Initialize the ia32 address mode optimizer. */ void ia32_init_optimize(void); #endif
/* * This file is part of libFirm. * Copyright (C) 2012 University of Karlsruhe. */ /** * @file * @brief Implements several optimizations for IA32. * @author Christian Wuerdig */ #ifndef FIRM_BE_IA32_IA32_OPTIMIZE_H #define FIRM_BE_IA32_IA32_OPTIMIZE_H #include "firm_types.h" /** * Prepares irg for codegeneration. */ void ia32_pre_transform_phase(ir_graph *irg); /** * Performs conv and address mode optimizations. * @param cg The ia32 codegenerator object */ void ia32_optimize_graph(ir_graph *irg); /** * Performs Peephole Optimizations an a graph. * * @param irg the graph * @param cg the code generator object */ void ia32_peephole_optimization(ir_graph *irg); /** Initialize the ia32 address mode optimizer. */ void ia32_init_optimize(void); #endif
--- +++ @@ -12,11 +12,6 @@ #define FIRM_BE_IA32_IA32_OPTIMIZE_H #include "firm_types.h" - -/** - * Prepares irg for codegeneration. - */ -void ia32_pre_transform_phase(ir_graph *irg); /** * Performs conv and address mode optimizations.
ia32: Remove stale declaration of 'ia32_pre_transform_phase()'. This function was deleted in 2007!
lgpl-2.1
jonashaag/libfirm,libfirm/libfirm,MatzeB/libfirm,libfirm/libfirm,jonashaag/libfirm,jonashaag/libfirm,jonashaag/libfirm,MatzeB/libfirm,jonashaag/libfirm,MatzeB/libfirm,libfirm/libfirm,jonashaag/libfirm,MatzeB/libfirm,libfirm/libfirm,MatzeB/libfirm,libfirm/libfirm,jonashaag/libfirm,MatzeB/libfirm,MatzeB/libfirm
ef8f03fe761ede729d5e1ee93f70ae6c40994bad
#include <stdio.h> #include <time.h> #include <stdlib.h> int check_date(struct tm *date, time_t time, char *name) { if( date == NULL ) { printf("%s(%lld) returned null\n", name, (long long)time); return 1; } else { printf("%s(%lld): %s\n", name, (long long)time, asctime(date)); return 0; } } int main(int argc, char *argv[]) { long long number; time_t time; struct tm *localdate; struct tm *gmdate; if( argc <= 1 ) { printf("usage: %s <time>\n", argv[0]); return 1; } printf("sizeof time_t: %ld, tm.tm_year: %ld\n", sizeof(time_t), sizeof(gmdate->tm_year)); number = strtoll(argv[1], NULL, 0); time = (time_t)number; printf("input: %lld, time: %lld\n", number, (long long)time); if( time != number ) { printf("time_t overflowed\n"); return 0; } localdate = localtime(&time); gmdate = gmtime(&time); check_date(localdate, time, "localtime"); check_date(gmdate, time, "gmtime"); return 0; }
#include <stdio.h> #include <time.h> #include <stdlib.h> int check_date(struct tm *date, time_t time, char *name) { if( date == NULL ) { printf("%s(%lld) returned null\n", name, (long long)time); return 1; } else { printf("%s(%lld): %s\n", name, (long long)time, asctime(date)); return 0; } } int main(int argc, char *argv[]) { long long number; time_t time; struct tm *localdate; struct tm *gmdate; if( argc <= 1 ) { printf("usage: %s <time>\n", argv[0]); return 1; } number = strtoll(argv[1], NULL, 0); time = (time_t)number; printf("input: %lld, time: %lld\n", number, (long long)time); if( time != number ) { printf("time_t overflowed\n"); return 0; } localdate = localtime(&time); gmdate = gmtime(&time); check_date(localdate, time, "localtime"); check_date(gmdate, time, "gmtime"); return 0; }
--- +++ @@ -25,6 +25,8 @@ return 1; } + printf("sizeof time_t: %ld, tm.tm_year: %ld\n", sizeof(time_t), sizeof(gmdate->tm_year)); + number = strtoll(argv[1], NULL, 0); time = (time_t)number;
Print out the size of time_t and tm.tm_year for debugging porpuses.
mit
chromatic/y2038,chromatic/y2038,evalEmpire/y2038,bulk88/y2038,schwern/y2038,chromatic/y2038,foxtacles/y2038,foxtacles/y2038,bulk88/y2038,bulk88/y2038,evalEmpire/y2038,schwern/y2038
c68037fdc18d4dade36611a4a93dcc3fbbcfa045
/* CMSIS-DAP Interface Firmware * Copyright (c) 2009-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. */ #ifndef VERSION_H #define VERSION_H #include "stdint.h" // built for bootloader 1xxx //#define FW_BUILD "1203" // build for bootloader 0xxx #define FW_BUILD "0227" void update_html_file(uint8_t *buf, uint32_t bufsize); uint8_t * get_uid_string (void); uint8_t get_len_string_interface(void); uint8_t * get_uid_string_interface(void); void init_auth_config (void); void build_mac_string(uint32_t *uuid_data); #endif
/* CMSIS-DAP Interface Firmware * Copyright (c) 2009-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. */ #ifndef VERSION_H #define VERSION_H #include "stdint.h" // built for bootloader 1xxx //#define FW_BUILD "1203" // build for bootloader 0xxx #define FW_BUILD "0226" void update_html_file(uint8_t *buf, uint32_t bufsize); uint8_t * get_uid_string (void); uint8_t get_len_string_interface(void); uint8_t * get_uid_string_interface(void); void init_auth_config (void); void build_mac_string(uint32_t *uuid_data); #endif
--- +++ @@ -21,7 +21,7 @@ // built for bootloader 1xxx //#define FW_BUILD "1203" // build for bootloader 0xxx -#define FW_BUILD "0226" +#define FW_BUILD "0227" void update_html_file(uint8_t *buf, uint32_t bufsize); uint8_t * get_uid_string (void);
Increment FW_BUILD. Initial release for kl26z_nrf51822_if with CDC support
apache-2.0
sg-/DAPLink,google/DAPLink-port,google/DAPLink-port,sg-/DAPLink,google/DAPLink-port,sg-/DAPLink,google/DAPLink-port
e98d0be00b0694bb4480cbc1e2aac77cd1b57cd5
// Copyright 2017, Jeffrey E. Bedard #include "text_widget.h" #include "XSTextWidget.h" #include "config.h" #include "font.h" #include "xdata.h" short xstatus_draw_text_widget(struct XSTextWidget * widget) { xcb_connection_t * xc = widget->connection; struct JBDim font_size = xstatus_get_font_size(); xcb_image_text_8(xc, widget->buffer_size, xstatus_get_window(xc), xstatus_get_gc(xc), widget->offset, font_size.height, widget->buffer); return widget->offset + font_size.width * widget->buffer_size + XSTATUS_CONST_PAD; }
// Copyright 2017, Jeffrey E. Bedard #include "text_widget.h" #include "XSTextWidget.h" #include "font.h" #include "xdata.h" short xstatus_draw_text_widget(struct XSTextWidget * widget) { xcb_connection_t * xc = widget->connection; struct JBDim font_size = xstatus_get_font_size(); xcb_image_text_8(xc, widget->buffer_size, xstatus_get_window(xc), xstatus_get_gc(xc), widget->offset, font_size.height, widget->buffer); return widget->offset + font_size.width * widget->buffer_size; }
--- +++ @@ -1,6 +1,7 @@ // Copyright 2017, Jeffrey E. Bedard #include "text_widget.h" #include "XSTextWidget.h" +#include "config.h" #include "font.h" #include "xdata.h" short xstatus_draw_text_widget(struct XSTextWidget * widget) @@ -10,5 +11,6 @@ xcb_image_text_8(xc, widget->buffer_size, xstatus_get_window(xc), xstatus_get_gc(xc), widget->offset, font_size.height, widget->buffer); - return widget->offset + font_size.width * widget->buffer_size; + return widget->offset + font_size.width * widget->buffer_size + + XSTATUS_CONST_PAD; }
Include configured padding in offset calculation.
mit
jefbed/xstatus,jefbed/xstatus,jefbed/xstatus,jefbed/xstatus
2044a19198c1a178b0994ece8db9286099586ed4
// Copyright 2015 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 BROWSER_BRIGHTRAY_PATHS_H_ #define BROWSER_BRIGHTRAY_PATHS_H_ #include "base/compiler_specific.h" #if defined(OS_WIN) #include "base/base_paths_win.h" #elif defined(OS_MACOSX) #include "base/base_paths_mac.h" #endif #if defined(OS_POSIX) #include "base/base_paths_posix.h" #endif namespace brightray { enum { PATH_START = 11000, DIR_USER_DATA = PATH_START, // Directory where user data can be written. DIR_USER_CACHE, // Directory where user cache can be written. #if defined(OS_LINUX) DIR_APP_DATA, // Application Data directory under the user profile. #else DIR_APP_DATA = base::DIR_APP_DATA, #endif #if defined(OS_POSIX) DIR_CACHE = base::DIR_CACHE, // Directory where to put cache data. #else DIR_CACHE = base::DIR_APP_DATA, #endif PATH_END }; } // namespace brightray #endif // BROWSER_BRIGHTRAY_PATHS_H_
// Copyright 2015 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 BROWSER_BRIGHTRAY_PATHS_H_ #define BROWSER_BRIGHTRAY_PATHS_H_ #include "base/compiler_specific.h" #if defined(OS_WIN) #include "base/base_paths_win.h" #elif defined(OS_MACOSX) #include "base/base_paths_mac.h" #endif #if defined(OS_POSIX) #include "base/base_paths_posix.h" #endif namespace brightray { enum { PATH_START = 1000, DIR_USER_DATA = PATH_START, // Directory where user data can be written. DIR_USER_CACHE, // Directory where user cache can be written. #if defined(OS_LINUX) DIR_APP_DATA, // Application Data directory under the user profile. #else DIR_APP_DATA = base::DIR_APP_DATA, #endif #if defined(OS_POSIX) DIR_CACHE = base::DIR_CACHE, // Directory where to put cache data. #else DIR_CACHE = base::DIR_APP_DATA, #endif PATH_END }; } // namespace brightray #endif // BROWSER_BRIGHTRAY_PATHS_H_
--- +++ @@ -20,7 +20,7 @@ namespace brightray { enum { - PATH_START = 1000, + PATH_START = 11000, DIR_USER_DATA = PATH_START, // Directory where user data can be written. DIR_USER_CACHE, // Directory where user cache can be written.
Change our PATH_START to 11000
mit
atom/brightray,bbondy/brightray,brave/brightray,atom/brightray,brave/brightray,bbondy/brightray
8b6c24dce25e743ceecd06d1c175c1cf8b91627b
// // log_thread.h // #ifndef log_thread_h #define log_thread_h #include "queue_atomic.h" struct log_thread; typedef std::shared_ptr<log_thread> log_thread_ptr; #define LOG_BUFFER_SIZE 1024 struct log_thread : std::thread { static const bool debug; static const int flush_interval_msecs; FILE* file; const size_t num_buffers; queue_atomic<char*> log_buffers_free; queue_atomic<char*> log_buffers_inuse; time_t last_time; std::atomic<bool> running; std::atomic<bool> writer_waiting; std::mutex log_mutex; std::condition_variable log_cond; std::condition_variable writer_cond; std::thread thread; log_thread(int fd, size_t num_buffers); virtual ~log_thread(); void shutdown(); void create_buffers(); void delete_buffers(); void log(time_t current_time, const char* message); void write_logs(); void mainloop(); }; #endif
// // log_thread.h // #ifndef log_thread_h #define log_thread_h #include "queue_atomic.h" struct log_thread; typedef std::shared_ptr<log_thread> log_thread_ptr; #define LOG_BUFFER_SIZE 1024 struct log_thread : std::thread { static const bool debug; static const int flush_interval_msecs; FILE* file; const size_t num_buffers; queue_atomic<char*> log_buffers_free; queue_atomic<char*> log_buffers_inuse; time_t last_time; std::atomic<bool> running; std::atomic<bool> writer_waiting; std::thread thread; std::mutex log_mutex; std::condition_variable log_cond; std::condition_variable writer_cond; log_thread(int fd, size_t num_buffers); virtual ~log_thread(); void shutdown(); void create_buffers(); void delete_buffers(); void log(time_t current_time, const char* message); void write_logs(); void mainloop(); }; #endif
--- +++ @@ -24,10 +24,10 @@ time_t last_time; std::atomic<bool> running; std::atomic<bool> writer_waiting; - std::thread thread; std::mutex log_mutex; std::condition_variable log_cond; std::condition_variable writer_cond; + std::thread thread; log_thread(int fd, size_t num_buffers); virtual ~log_thread();
Fix thread initialisation race (thread sanitizer)
isc
metaparadigm/latypus,metaparadigm/latypus,metaparadigm/latypus,metaparadigm/latypus
59e44a3ff36e0a67cd39c8e3149d2fdaa089b7d4
#if (PAGE_SIZE == 4096) CACHE(32) #endif CACHE(64) #if L1_CACHE_BYTES < 64 CACHE(96) #endif CACHE(128) #if L1_CACHE_BYTES < 128 CACHE(192) #endif CACHE(256) CACHE(512) CACHE(1024) CACHE(2048) CACHE(4096) CACHE(8192) CACHE(16384) CACHE(32768) CACHE(65536) CACHE(131072) #if (NR_CPUS > 512) || (MAX_NUMNODES > 256) || !defined(CONFIG_MMU) CACHE(262144) #endif #ifndef CONFIG_MMU CACHE(524288) CACHE(1048576) #ifdef CONFIG_LARGE_ALLOCS CACHE(2097152) CACHE(4194304) CACHE(8388608) CACHE(16777216) CACHE(33554432) #endif /* CONFIG_LARGE_ALLOCS */ #endif /* CONFIG_MMU */
#if (PAGE_SIZE == 4096) CACHE(32) #endif CACHE(64) #if L1_CACHE_BYTES < 64 CACHE(96) #endif CACHE(128) #if L1_CACHE_BYTES < 128 CACHE(192) #endif CACHE(256) CACHE(512) CACHE(1024) CACHE(2048) CACHE(4096) CACHE(8192) CACHE(16384) CACHE(32768) CACHE(65536) CACHE(131072) #ifndef CONFIG_MMU CACHE(262144) CACHE(524288) CACHE(1048576) #ifdef CONFIG_LARGE_ALLOCS CACHE(2097152) CACHE(4194304) CACHE(8388608) CACHE(16777216) CACHE(33554432) #endif /* CONFIG_LARGE_ALLOCS */ #endif /* CONFIG_MMU */
--- +++ @@ -19,8 +19,10 @@ CACHE(32768) CACHE(65536) CACHE(131072) +#if (NR_CPUS > 512) || (MAX_NUMNODES > 256) || !defined(CONFIG_MMU) + CACHE(262144) +#endif #ifndef CONFIG_MMU - CACHE(262144) CACHE(524288) CACHE(1048576) #ifdef CONFIG_LARGE_ALLOCS
[PATCH] Increase max kmalloc size for very large systems Systems with extemely large numbers of nodes or cpus need to kmalloc structures larger than is currently supported. This patch increases the maximum supported size for very large systems. This patch should have no effect on current systems. (akpm: why not just use alloc_pages() for sysfs_cpus?) Signed-off-by: Jack Steiner <9fc09c92f9d4898dd6e5af3e81679b627e939258@sgi.com> Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org> Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs
a615fa83959896f8eac76c235953fb164cd1a9b9
// // Copyleft RIME Developers // License: GPLv3 // // 2011-03-14 GONG Chen <chen.sst@gmail.com> // #ifndef RIME_COMMON_H_ #define RIME_COMMON_H_ #include <memory> #include <utility> #define BOOST_BIND_NO_PLACEHOLDERS #include <boost/signals2/connection.hpp> #include <boost/signals2/signal.hpp> #ifdef RIME_ENABLE_LOGGING #include <glog/logging.h> #else #include "no_logging.h" #endif // RIME_ENABLE_LOGGING namespace rime { using boost::signals2::connection; using boost::signals2::signal; using std::unique_ptr; using std::shared_ptr; using std::weak_ptr; template <class A, class B> shared_ptr<A> As(const B& ptr) { return std::dynamic_pointer_cast<A>(ptr); } template <class A, class B> bool Is(const B& ptr) { return bool(As<A, B>(ptr)); } template <class T, class... Args> inline shared_ptr<T> New(Args&&... args) { return std::make_shared<T>(std::forward<Args>(args)...); } } // namespace rime #endif // RIME_COMMON_H_
// // Copyleft RIME Developers // License: GPLv3 // // 2011-03-14 GONG Chen <chen.sst@gmail.com> // #ifndef RIME_COMMON_H_ #define RIME_COMMON_H_ #include <memory> #include <utility> #define BOOST_BIND_NO_PLACEHOLDERS #include <boost/signals2/connection.hpp> #include <boost/signals2/signal.hpp> #ifdef RIME_ENABLE_LOGGING #include <glog/logging.h> #else #include "no_logging.h" #endif // RIME_ENABLE_LOGGGING namespace rime { using boost::signals2::connection; using boost::signals2::signal; using std::unique_ptr; using std::shared_ptr; using std::weak_ptr; template <class A, class B> shared_ptr<A> As(const B& ptr) { return std::dynamic_pointer_cast<A>(ptr); } template <class A, class B> bool Is(const B& ptr) { return bool(As<A, B>(ptr)); } template <class T, class... Args> inline shared_ptr<T> New(Args&&... args) { return std::make_shared<T>(std::forward<Args>(args)...); } } // namespace rime #endif // RIME_COMMON_H_
--- +++ @@ -17,7 +17,7 @@ #include <glog/logging.h> #else #include "no_logging.h" -#endif // RIME_ENABLE_LOGGGING +#endif // RIME_ENABLE_LOGGING namespace rime {
Fix a typo in the comment.
bsd-3-clause
kionz/librime,j717273419/librime,kionz/librime,bygloam/librime,rime/librime,rime/librime,jakwings/librime,bygloam/librime,bygloam/librime,j717273419/librime,rwduzhao/librime,Prcuvu/librime,Prcuvu/librime,j717273419/librime,rwduzhao/librime,rwduzhao/librime,kionz/librime,jakwings/librime,Prcuvu/librime,jakwings/librime,Prcuvu/librime,rime/librime,rime/librime,Prcuvu/librime,kionz/librime
f16b686efbe6bfe50c1fbb3c5b318c279fc16ec0
#define _XOPEN_SOURCE 500 #include <unistd.h> #include <stdlib.h> char *os_find_self(void) { // PATH_MAX (used by readlink(2)) is not necessarily available size_t size = 2048, used = 0; char *path = NULL; do { size *= 2; path = realloc(path, size); used = readlink("/proc/self/exe", path, size); path[used - 1] = '\0'; } while (used >= size && path != NULL); return path; }
#define _XOPEN_SOURCE 500 #include <unistd.h> #include <stdlib.h> char *os_find_self(void) { // PATH_MAX (used by readlink(2)) is not necessarily available size_t size = 2048, used = 0; char *path = NULL; do { size *= 2; path = realloc(path, size); used = readlink("/proc/self/exe", path, size); } while (used > size && path != NULL); return path; }
--- +++ @@ -11,7 +11,8 @@ size *= 2; path = realloc(path, size); used = readlink("/proc/self/exe", path, size); - } while (used > size && path != NULL); + path[used - 1] = '\0'; + } while (used >= size && path != NULL); return path; }
Mend loop condition from 344aae0
mit
kulp/tenyr,kulp/tenyr,kulp/tenyr
387ec6864a25317ff45f9001809c4752047e2637
#include <jemalloc.h> int main(int argc, char** argv) { void *volatile dummyPtr = malloc(42); (void)argv; return argc; }
#include <jemalloc.h> int main(int argc, char** argv) { (void)argv; return argc + (int)(malloc(42)); }
--- +++ @@ -1,6 +1,7 @@ #include <jemalloc.h> int main(int argc, char** argv) { + void *volatile dummyPtr = malloc(42); (void)argv; - return argc + (int)(malloc(42)); + return argc; }
[CMAKE] Fix a -Wpointer-to-int-cast when searching Jemalloc Summary: This would trigger failures when `-Werror` is enabled, such as: https://build.bitcoinabc.org/viewLog.html?tab=buildLog&logTab=tree&filter=debug&expand=all&buildId=66573&guest=1#footer Test Plan: cmake -GNinja .. \ -DUSE_JEMALLOC_EXPERIMENTAL=ON \ -DCMAKE_C_FLAGS=-Werror This will fail before this patch and succeed after. Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D6343
mit
cculianu/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,cculianu/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,cculianu/bitcoin-abc,cculianu/bitcoin-abc,cculianu/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,cculianu/bitcoin-abc,cculianu/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,cculianu/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc
c9df2beb473f7461797074c51789761e0dbc1567
/* * the continuation data assigned to each request along side with the functions * to manipulate them * * Vmon: June 2013 */ #ifndef BANJAX_CONTINUATION_H #define BANJAX_CONTINUATION_H #include "banjax.h" #include "banjax_filter.h" #include "transaction_muncher.h" class Banjax; class TransactionData{ public: /** Constructor to set the default values */ TransactionData(std::shared_ptr<Banjax> banjax, TSHttpTxn cur_txn) : banjax(std::move(banjax)) , txnp(cur_txn) , transaction_muncher(cur_txn) { } static int handle_transaction_change(TSCont contp, TSEvent event, void *edata); ~TransactionData(); private: std::shared_ptr<Banjax> banjax; TSHttpTxn txnp; TransactionMuncher transaction_muncher; FilterResponse response_info; private: void handle_request(); void handle_response(); void handle_http_close(Banjax::TaskQueue& current_queue); }; #endif /*banjax_continuation.h*/
/* * the continuation data assigned to each request along side with the functions * to manipulate them * * Vmon: June 2013 */ #ifndef BANJAX_CONTINUATION_H #define BANJAX_CONTINUATION_H #include "banjax.h" #include "banjax_filter.h" #include "transaction_muncher.h" class Banjax; class TransactionData{ public: std::shared_ptr<Banjax> banjax; TSHttpTxn txnp; TransactionMuncher transaction_muncher; FilterResponse response_info; ~TransactionData(); /** Constructor to set the default values */ TransactionData(std::shared_ptr<Banjax> banjax, TSHttpTxn cur_txn) : banjax(std::move(banjax)) , txnp(cur_txn) , transaction_muncher(cur_txn) { } static int handle_transaction_change(TSCont contp, TSEvent event, void *edata); private: void handle_request(); void handle_response(); void handle_http_close(Banjax::TaskQueue& current_queue); }; #endif /*banjax_continuation.h*/
--- +++ @@ -15,14 +15,6 @@ class TransactionData{ public: - std::shared_ptr<Banjax> banjax; - TSHttpTxn txnp; - - TransactionMuncher transaction_muncher; - FilterResponse response_info; - - ~TransactionData(); - /** Constructor to set the default values */ @@ -35,11 +27,19 @@ static int handle_transaction_change(TSCont contp, TSEvent event, void *edata); + ~TransactionData(); + +private: + std::shared_ptr<Banjax> banjax; + TSHttpTxn txnp; + + TransactionMuncher transaction_muncher; + FilterResponse response_info; + private: void handle_request(); void handle_response(); void handle_http_close(Banjax::TaskQueue& current_queue); - }; #endif /*banjax_continuation.h*/
Make TransactionData member vars private
agpl-3.0
equalitie/banjax,equalitie/banjax,equalitie/banjax,equalitie/banjax,equalitie/banjax
d49604b9ed52928f8a3b31cc560692f130928014
// 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
// 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
--- +++ @@ -6,7 +6,7 @@ #ifdef BITCODE -// CHECK-BC: 'f': symbol multiply defined +// CHECK-BC: fatal error: cannot link module {{.*}}'f': symbol multiply defined int f(void) { return 42; }
Make this test a bit stricter by checking clang's output too. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@220604 91177308-0d34-0410-b5e6-96231b3b80d8
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
b3dff4d84df5f1b4b0ad59ac760c32f531321d32
/* * This file is part of libbdplus * Copyright (C) 2015 VideoLAN * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see * <http://www.gnu.org/licenses/>. */ #ifndef FILE_DEFAULT_H_ #define FILE_DEFAULT_H_ #include "util/attributes.h" struct bdplus_file; BD_PRIVATE struct bdplus_file *file_open_default(void *root_path, const char *file_name); #endif /* FILE_DEFAULT_H_ */
/* * This file is part of libbdplus * Copyright (C) 2015 VideoLAN * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see * <http://www.gnu.org/licenses/>. */ #ifndef FILE_DEFAULT_H_ #define FILE_DEFAULT_H_ #include "filesystem.h" #include "util/attributes.h" BD_PRIVATE BDPLUS_FILE_H *file_open_default(void *root_path, const char *file_name); #endif /* FILE_DEFAULT_H_ */
--- +++ @@ -20,10 +20,9 @@ #ifndef FILE_DEFAULT_H_ #define FILE_DEFAULT_H_ -#include "filesystem.h" - #include "util/attributes.h" -BD_PRIVATE BDPLUS_FILE_H *file_open_default(void *root_path, const char *file_name); +struct bdplus_file; +BD_PRIVATE struct bdplus_file *file_open_default(void *root_path, const char *file_name); #endif /* FILE_DEFAULT_H_ */
Replace include with forward declaration
lgpl-2.1
ShiftMediaProject/libbdplus,ShiftMediaProject/libbdplus,ShiftMediaProject/libbdplus
b9be70ddceebc4b6a9eff29a72bd680e10e091c7
#include <gst/gst.h> #include "kms-core.h" static GstElement *pipe = NULL; static G_LOCK_DEFINE(mutex); static gboolean init = FALSE; static gpointer gstreamer_thread(gpointer data) { GMainLoop *loop; loop = g_main_loop_new(NULL, TRUE); g_main_loop_run(loop); return NULL; } void kms_init(gint *argc, gchar **argv[]) { G_LOCK(mutex); if (!init) { GstBus *bus; g_type_init(); gst_init(argc, argv); pipe = gst_pipeline_new(NULL); gst_element_set_state(pipe, GST_STATE_PLAYING); bus = gst_element_get_bus(pipe); gst_bus_add_watch(bus, gst_bus_async_signal_func, NULL); g_thread_create(gstreamer_thread, NULL, TRUE, NULL); init = TRUE; } G_UNLOCK(mutex); } GstElement* kms_get_pipeline() { return pipe; }
#include <gst/gst.h> #include "kms-core.h" static GstElement *pipe = NULL; static G_LOCK_DEFINE(mutex); static gboolean init = FALSE; static gboolean bus_watch(GstBus *bus, GstMessage *message, gpointer data) { KMS_LOG_DEBUG("TODO: implement bus watcher\n"); return TRUE; } void kms_init(gint *argc, gchar **argv[]) { G_LOCK(mutex); if (!init) { GstBus *bus; g_type_init(); gst_init(argc, argv); pipe = gst_pipeline_new(NULL); gst_element_set_state(pipe, GST_STATE_PLAYING); bus = gst_element_get_bus(pipe); gst_bus_add_watch(bus, bus_watch, NULL); init = TRUE; } G_UNLOCK(mutex); } GstElement* kms_get_pipeline() { return pipe; }
--- +++ @@ -5,10 +5,12 @@ static G_LOCK_DEFINE(mutex); static gboolean init = FALSE; -static gboolean -bus_watch(GstBus *bus, GstMessage *message, gpointer data) { - KMS_LOG_DEBUG("TODO: implement bus watcher\n"); - return TRUE; +static gpointer +gstreamer_thread(gpointer data) { + GMainLoop *loop; + loop = g_main_loop_new(NULL, TRUE); + g_main_loop_run(loop); + return NULL; } void @@ -23,7 +25,10 @@ gst_element_set_state(pipe, GST_STATE_PLAYING); bus = gst_element_get_bus(pipe); - gst_bus_add_watch(bus, bus_watch, NULL); + gst_bus_add_watch(bus, gst_bus_async_signal_func, NULL); + + g_thread_create(gstreamer_thread, NULL, TRUE, NULL); + init = TRUE; } G_UNLOCK(mutex);
Make all bus events to be signals
lgpl-2.1
shelsonjava/kurento-media-server,mparis/kurento-media-server,todotobe1/kurento-media-server,todotobe1/kurento-media-server,lulufei/kurento-media-server,TribeMedia/kurento-media-server,shelsonjava/kurento-media-server,Kurento/kurento-media-server,lulufei/kurento-media-server,mparis/kurento-media-server,Kurento/kurento-media-server,TribeMedia/kurento-media-server
aad15687e0b91cba541cb939df092a15dbf43ae5
/* -------------------------------------------------------------------------- * Name: errors.h * Purpose: Error type and constants * ----------------------------------------------------------------------- */ #ifndef ERRORS_H #define ERRORS_H typedef unsigned long int error; /* Generic errors */ #define error_OK 0ul /* No error */ #define error_OOM 1ul /* Out of memory */ #define error_NOT_IMPLEMENTED 2ul /* Function not implemented */ #define error_NOT_FOUND 3ul /* Item not found */ #define error_EXISTS 4ul /* Item already exists */ #define error_STOP_WALK 5ul /* Callback was cancelled */ /* Data structure errors */ #define error_CLASHES 100ul /* Key would clash with existing one */ #define error_QUEUE_FULL 110ul #define error_QUEUE_EMPTY 111ul #define error_HASH_END 120ul #define error_HASH_BAD_CONT 121ul /* Container errors */ #define error_KEYLEN_REQUIRED 200ul #define error_KEYCOMPARE_REQUIRED 201ul #define error_KEYHASH_REQIURED 202ul /* Test errors */ #define error_TEST_FAILED 300ul #endif /* ERRORS_H */
/* -------------------------------------------------------------------------- * Name: errors.h * Purpose: Error type and constants * ----------------------------------------------------------------------- */ #ifndef ERRORS_H #define ERRORS_H typedef unsigned long int error; #define error_OK 0 #define error_EXISTS 1 #define error_NOT_FOUND 2 #define error_OOM 3 #define error_STOP_WALK 4 #define error_CLASHES 5 /* key would clash with existing one */ #define error_NOT_IMPLEMENTED 6 #define error_KEYLEN_REQUIRED 200 #define error_KEYCOMPARE_REQUIRED 201 #define error_KEYHASH_REQIURED 202 #define error_QUEUE_FULL 300 #define error_QUEUE_EMPTY 301 #define error_TEST_FAILED 400 #define error_HASH_END 500 #define error_HASH_BAD_CONT 501 #endif /* ERRORS_H */
--- +++ @@ -8,25 +8,34 @@ typedef unsigned long int error; -#define error_OK 0 -#define error_EXISTS 1 -#define error_NOT_FOUND 2 -#define error_OOM 3 -#define error_STOP_WALK 4 -#define error_CLASHES 5 /* key would clash with existing one */ -#define error_NOT_IMPLEMENTED 6 +/* Generic errors */ -#define error_KEYLEN_REQUIRED 200 -#define error_KEYCOMPARE_REQUIRED 201 -#define error_KEYHASH_REQIURED 202 +#define error_OK 0ul /* No error */ +#define error_OOM 1ul /* Out of memory */ +#define error_NOT_IMPLEMENTED 2ul /* Function not implemented */ +#define error_NOT_FOUND 3ul /* Item not found */ +#define error_EXISTS 4ul /* Item already exists */ +#define error_STOP_WALK 5ul /* Callback was cancelled */ -#define error_QUEUE_FULL 300 -#define error_QUEUE_EMPTY 301 +/* Data structure errors */ -#define error_TEST_FAILED 400 +#define error_CLASHES 100ul /* Key would clash with existing one */ -#define error_HASH_END 500 -#define error_HASH_BAD_CONT 501 +#define error_QUEUE_FULL 110ul +#define error_QUEUE_EMPTY 111ul + +#define error_HASH_END 120ul +#define error_HASH_BAD_CONT 121ul + +/* Container errors */ + +#define error_KEYLEN_REQUIRED 200ul +#define error_KEYCOMPARE_REQUIRED 201ul +#define error_KEYHASH_REQIURED 202ul + +/* Test errors */ + +#define error_TEST_FAILED 300ul #endif /* ERRORS_H */
Make error constants unsigned longs.
bsd-2-clause
dpt/Containers,dpt/Containers
44f9fbcddec64b7c43f7882ab58c8f23007a44d0
// @(#)root/sqlite: // Author: o.freyermuth <o.f@cern.ch>, 01/06/2013 /************************************************************************* * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TSQLiteRow #define ROOT_TSQLiteRow #ifndef ROOT_TSQLRow #include "TSQLRow.h" #endif #if !defined(__CINT__) #include <sqlite3.h> #else struct sqlite3_stmt; #endif class TSQLiteRow : public TSQLRow { private: sqlite3_stmt *fResult; // current result set Bool_t IsValid(Int_t field); public: TSQLiteRow(void *result, ULong_t rowHandle); ~TSQLiteRow(); void Close(Option_t *opt=""); ULong_t GetFieldLength(Int_t field); const char *GetField(Int_t field); ClassDef(TSQLiteRow,0) // One row of SQLite query result }; #endif
// @(#)root/sqlite:$Id$ // Author: o.freyermuth <o.f@cern.ch>, 01/06/2013 /************************************************************************* * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TPgSQLRow #define ROOT_TPgSQLRow #ifndef ROOT_TSQLRow #include "TSQLRow.h" #endif #if !defined(__CINT__) #include <sqlite3.h> #else struct sqlite3_stmt; #endif class TSQLiteRow : public TSQLRow { private: sqlite3_stmt *fResult; // current result set Bool_t IsValid(Int_t field); public: TSQLiteRow(void *result, ULong_t rowHandle); ~TSQLiteRow(); void Close(Option_t *opt=""); ULong_t GetFieldLength(Int_t field); const char *GetField(Int_t field); ClassDef(TSQLiteRow,0) // One row of SQLite query result }; #endif
--- +++ @@ -1,4 +1,4 @@ -// @(#)root/sqlite:$Id$ +// @(#)root/sqlite: // Author: o.freyermuth <o.f@cern.ch>, 01/06/2013 /************************************************************************* @@ -9,8 +9,8 @@ * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ -#ifndef ROOT_TPgSQLRow -#define ROOT_TPgSQLRow +#ifndef ROOT_TSQLiteRow +#define ROOT_TSQLiteRow #ifndef ROOT_TSQLRow #include "TSQLRow.h"
Fix fatal typo in code guard
lgpl-2.1
tc3t/qoot,kirbyherm/root-r-tools,tc3t/qoot,tc3t/qoot,Dr15Jones/root,tc3t/qoot,Dr15Jones/root,tc3t/qoot,Dr15Jones/root,Dr15Jones/root,tc3t/qoot,kirbyherm/root-r-tools,Dr15Jones/root,kirbyherm/root-r-tools,kirbyherm/root-r-tools,tc3t/qoot,tc3t/qoot,kirbyherm/root-r-tools,Dr15Jones/root,Dr15Jones/root,kirbyherm/root-r-tools,kirbyherm/root-r-tools,tc3t/qoot,tc3t/qoot
9e868196a26d39cd38f1f2b07876ffcea5037076
// [zooey, 2005]: made MTextAddon really an abstract class //================================================================== // MTextAddOn.h // Copyright 1996 Metrowerks Corporation, All Rights Reserved. //================================================================== // This is a proxy class used by Editor add_ons. It does not inherit from BView // but provides an abstract interface to a text engine. #ifndef MTEXTADDON_H #define MTEXTADDON_H //#include "HLibHekkel.h" class BWindow; struct entry_ref; class /*IMPEXP_LIBHEKKEL*/ MTextAddOn { public: virtual ~MTextAddOn(); virtual const char* Text() = 0; virtual int32 TextLength() const = 0; virtual void GetSelection(int32 *start, int32 *end) const = 0; virtual void Select(int32 newStart, int32 newEnd) = 0; virtual void Delete() = 0; virtual void Insert(const char* inText) = 0; virtual void Insert(const char* text, int32 length) = 0; virtual BWindow* Window() = 0; virtual status_t GetRef(entry_ref& outRef) = 0; }; #if !__INTEL__ #pragma export on #endif extern "C" { long perform_edit(MTextAddOn *addon); } #if !__INTEL__ #pragma export reset #endif typedef long (*perform_edit_func)(MTextAddOn *addon); #endif
//================================================================== // MTextAddOn.h // Copyright 1996 Metrowerks Corporation, All Rights Reserved. //================================================================== // This is a proxy class used by Editor add_ons. It does not inherit from BView // but provides an abstract interface to a text engine. #ifndef _MTEXTADDON_H #define _MTEXTADDON_H #include <SupportKit.h> class MIDETextView; class BWindow; struct entry_ref; class MTextAddOn { public: MTextAddOn( MIDETextView& inTextView); virtual ~MTextAddOn(); virtual const char* Text(); virtual int32 TextLength() const; virtual void GetSelection( int32 *start, int32 *end) const; virtual void Select( int32 newStart, int32 newEnd); virtual void Delete(); virtual void Insert( const char* inText); virtual void Insert( const char* text, int32 length); virtual BWindow* Window(); virtual status_t GetRef( entry_ref& outRef); virtual bool IsEditable(); private: MIDETextView& fText; }; #endif
--- +++ @@ -1,3 +1,4 @@ +// [zooey, 2005]: made MTextAddon really an abstract class //================================================================== // MTextAddOn.h // Copyright 1996 Metrowerks Corporation, All Rights Reserved. @@ -5,45 +6,40 @@ // This is a proxy class used by Editor add_ons. It does not inherit from BView // but provides an abstract interface to a text engine. -#ifndef _MTEXTADDON_H -#define _MTEXTADDON_H +#ifndef MTEXTADDON_H +#define MTEXTADDON_H -#include <SupportKit.h> +//#include "HLibHekkel.h" -class MIDETextView; class BWindow; struct entry_ref; - -class MTextAddOn +class /*IMPEXP_LIBHEKKEL*/ MTextAddOn { public: - MTextAddOn( - MIDETextView& inTextView); virtual ~MTextAddOn(); - virtual const char* Text(); - virtual int32 TextLength() const; - virtual void GetSelection( - int32 *start, - int32 *end) const; - virtual void Select( - int32 newStart, - int32 newEnd); - virtual void Delete(); - virtual void Insert( - const char* inText); - virtual void Insert( - const char* text, - int32 length); + virtual const char* Text() = 0; + virtual int32 TextLength() const = 0; + virtual void GetSelection(int32 *start, int32 *end) const = 0; + virtual void Select(int32 newStart, int32 newEnd) = 0; + virtual void Delete() = 0; + virtual void Insert(const char* inText) = 0; + virtual void Insert(const char* text, int32 length) = 0; - virtual BWindow* Window(); - virtual status_t GetRef( - entry_ref& outRef); - virtual bool IsEditable(); - -private: - - MIDETextView& fText; + virtual BWindow* Window() = 0; + virtual status_t GetRef(entry_ref& outRef) = 0; }; +#if !__INTEL__ +#pragma export on #endif +extern "C" { +long perform_edit(MTextAddOn *addon); +} +#if !__INTEL__ +#pragma export reset +#endif + +typedef long (*perform_edit_func)(MTextAddOn *addon); + +#endif
Replace BeIDE header by the Pe version We won't be building for BeIDE anyway...
mit
mmuman/dontworry,mmuman/dontworry
6d5fabbdb3b2f9e81ad75c93c0b238fa0a6e14fa
#include "modlib.h" uint16_t MODBUSSwapEndian( uint16_t Data ) { //Change big-endian to little-endian and vice versa uint8_t Swap; //Create 2 bytes long union union Conversion { uint16_t Data; uint8_t Bytes[2]; } Conversion; //Swap bytes Conversion.Data = Data; Swap = Conversion.Bytes[0]; Conversion.Bytes[0] = Conversion.Bytes[1]; Conversion.Bytes[1] = Swap; return Conversion.Data; } uint16_t MODBUSCRC16( uint16_t *Data, uint16_t Length ) { //Calculate CRC16 checksum using given data and length uint16_t CRC = 0xFFFF; uint16_t i; uint8_t j; for ( i = 0; i < Length; i++ ) { CRC ^= Data[i]; //XOR current data byte with CRC value for ( j = 8; j != 0; j-- ) { //For each bit //Is least-significant-bit is set? if ( ( CRC & 0x0001 ) != 0 ) { CRC >>= 1; //Shift to right and xor CRC ^= 0xA001; } else // Else LSB is not set CRC >>= 1; } } return CRC; }
#include "modlib.h" uint16_t MODBUSSwapEndian( uint16_t Data ) { //Change big-endian to little-endian and vice versa unsigned char Swap; //Create 2 bytes long union union Conversion { uint16_t Data; unsigned char Bytes[2]; } Conversion; //Swap bytes Conversion.Data = Data; Swap = Conversion.Bytes[0]; Conversion.Bytes[0] = Conversion.Bytes[1]; Conversion.Bytes[1] = Swap; return Conversion.Data; } uint16_t MODBUSCRC16( uint16_t *Data, uint16_t Length ) { //Calculate CRC16 checksum using given data and length uint16_t CRC = 0xFFFF; uint16_t i; unsigned char j; for ( i = 0; i < Length; i++ ) { CRC ^= Data[i]; //XOR current data byte with CRC value for ( j = 8; j != 0; j-- ) { //For each bit //Is least-significant-bit is set? if ( ( CRC & 0x0001 ) != 0 ) { CRC >>= 1; //Shift to right and xor CRC ^= 0xA001; } else // Else LSB is not set CRC >>= 1; } } return CRC; }
--- +++ @@ -4,13 +4,13 @@ { //Change big-endian to little-endian and vice versa - unsigned char Swap; + uint8_t Swap; //Create 2 bytes long union union Conversion { uint16_t Data; - unsigned char Bytes[2]; + uint8_t Bytes[2]; } Conversion; //Swap bytes @@ -28,7 +28,7 @@ uint16_t CRC = 0xFFFF; uint16_t i; - unsigned char j; + uint8_t j; for ( i = 0; i < Length; i++ ) {
Change 'unsigned character' type variables to 'uint8_t'
mit
Jacajack/modlib
19faea809ec3ea8a9722b0e87bb028fd23c721a1
/*===- count.c - The 'count' testing tool ---------------------------------===*\ * * The LLVM Compiler Infrastructure * * This file is distributed under the University of Illinois Open Source * License. See LICENSE.TXT for details. * \*===----------------------------------------------------------------------===*/ #include <stdlib.h> #include <stdio.h> int main(int argc, char **argv) { unsigned Count, NumLines, NumRead; char Buffer[4096], *End; if (argc != 2) { fprintf(stderr, "usage: %s <expected line count>\n", argv[0]); return 2; } Count = strtol(argv[1], &End, 10); if (*End != '\0' && End != argv[1]) { fprintf(stderr, "%s: invalid count argument '%s'\n", argv[0], argv[1]); return 2; } NumLines = 0; do { unsigned i; NumRead = fread(Buffer, 1, sizeof(Buffer), stdin); for (i = 0; i != NumRead; ++i) if (Buffer[i] == '\n') ++NumLines; } while (NumRead == sizeof(Buffer)); if (!feof(stdin)) { fprintf(stderr, "%s: error reading stdin\n", argv[0]); return 3; } if (Count != NumLines) { fprintf(stderr, "Expected %d lines, got %d.\n", Count, NumLines); return 1; } return 0; }
/*===- count.c - The 'count' testing tool ---------------------------------===*\ * * The LLVM Compiler Infrastructure * * This file is distributed under the University of Illinois Open Source * License. See LICENSE.TXT for details. * \*===----------------------------------------------------------------------===*/ #include <stdlib.h> #include <stdio.h> int main(int argc, char **argv) { unsigned Count, NumLines, NumRead; char Buffer[4096], *End; if (argc != 2) { fprintf(stderr, "usage: %s <expected line count>\n", argv[0]); return 2; } Count = strtol(argv[1], &End, 10); if (*End != '\0' && End != argv[1]) { fprintf(stderr, "%s: invalid count argument '%s'\n", argv[0], argv[1]); return 2; } NumLines = 0; while ((NumRead = fread(Buffer, 1, sizeof(Buffer), stdin))) { unsigned i; for (i = 0; i != NumRead; ++i) if (Buffer[i] == '\n') ++NumLines; } if (!feof(stdin)) { fprintf(stderr, "%s: error reading stdin\n", argv[0]); return 3; } if (Count != NumLines) { fprintf(stderr, "Expected %d lines, got %d.\n", Count, NumLines); return 1; } return 0; }
--- +++ @@ -26,13 +26,15 @@ } NumLines = 0; - while ((NumRead = fread(Buffer, 1, sizeof(Buffer), stdin))) { + do { unsigned i; + + NumRead = fread(Buffer, 1, sizeof(Buffer), stdin); for (i = 0; i != NumRead; ++i) if (Buffer[i] == '\n') ++NumLines; - } + } while (NumRead == sizeof(Buffer)); if (!feof(stdin)) { fprintf(stderr, "%s: error reading stdin\n", argv[0]);
Fix extra fread after EOF, non-wires-crossed version. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@105270 91177308-0d34-0410-b5e6-96231b3b80d8
bsd-2-clause
dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap
c6e1f67b17b4cb9d707af1245c1ecf00f91f23c0
#include <stdlib.h> #include <stdio.h> int main(int argc, char ** argv){ printf("Test\n"); void* test = malloc(1024*1024); if(test > 0){ printf("Malloc\n"); free(test); printf("Free\n"); }else{ printf("Malloc Failed\n"); } return 0; }
#include <stdio.h> int main(int argc, char ** argv){ printf("Test\n"); return 0; }
--- +++ @@ -1,6 +1,15 @@ +#include <stdlib.h> #include <stdio.h> int main(int argc, char ** argv){ printf("Test\n"); + void* test = malloc(1024*1024); + if(test > 0){ + printf("Malloc\n"); + free(test); + printf("Free\n"); + }else{ + printf("Malloc Failed\n"); + } return 0; }
WIP: Fix bugs with libc, executor
mit
redox-os/libc,redox-os/libc,redox-os/libc
38bcd605bc3a57bf3bd354826e16e41d74d87933
// mat_x num of rows equals to // mat_a num of rows #define A_ROWS 3 #define X_ROWS 3 // mat_x num of cols equals to // mat_b num of cols #define B_COLS 3 #define X_COLS 3 // mat_a num of cols should be equals to // mat_b num of rows #define A_COLS 2 #define B_ROWS 2 #include <stdio.h> // #include <mpi.h> void print_matrix(char* name, int rows, int cols, int matrix[rows][cols]) { printf("\n%s [%d][%d]\n", name, rows, cols); for (int row = 0; row < rows; row++){ for (int col = 0; col < cols; col++) printf("%d ", matrix[row][col]); printf("\n"); } } int main(int argc, char *argv[]) { int matrix_a [A_ROWS][A_COLS] = { {9, 0}, {5, 6}, {1, 2} }; int matrix_b [B_ROWS][B_COLS] = { {2, 4, 3}, {7, 8, 9} }; int matrix_x [X_ROWS][X_COLS]; // multipy matrices a and b for (int row = 0; row < A_ROWS; row++) { for (int col = 0; col < B_COLS; col++) { int sum = 0; for (int ctrl = 0; ctrl < B_ROWS; ctrl++) sum = sum + matrix_a[row][ctrl] * matrix_b[ctrl][col]; matrix_x[row][col] = sum; } } print_matrix("Matrix A", A_ROWS, A_COLS, matrix_a); print_matrix("Matrix B", B_ROWS, B_COLS, matrix_b); print_matrix("Matrix X", X_ROWS, X_COLS, matrix_x); printf("\n"); // TODO // int numprocs, rank, namelen; // char processor_name[MPI_MAX_PROCESSOR_NAME]; // MPI_Init(&argc, &argv); // MPI_Comm_size(MPI_COMM_WORLD, &numprocs); // MPI_Comm_rank(MPI_COMM_WORLD, &rank); // MPI_Get_processor_name(processor_name, &namelen); // MPI_Finalize(); return 0; }
#include <stdio.h> #include <mpi.h> int main(int argc, char *argv[]) { int numprocs, rank, namelen; char processor_name[MPI_MAX_PROCESSOR_NAME]; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &numprocs); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Get_processor_name(processor_name, &namelen); // TODO MPI_Finalize(); return 0; }
--- +++ @@ -1,17 +1,71 @@ +// mat_x num of rows equals to +// mat_a num of rows +#define A_ROWS 3 +#define X_ROWS 3 +// mat_x num of cols equals to +// mat_b num of cols +#define B_COLS 3 +#define X_COLS 3 +// mat_a num of cols should be equals to +// mat_b num of rows +#define A_COLS 2 +#define B_ROWS 2 + #include <stdio.h> -#include <mpi.h> +// #include <mpi.h> + +void print_matrix(char* name, int rows, int cols, int matrix[rows][cols]) { + + printf("\n%s [%d][%d]\n", name, rows, cols); + for (int row = 0; row < rows; row++){ + for (int col = 0; col < cols; col++) + printf("%d ", matrix[row][col]); + printf("\n"); + } +} int main(int argc, char *argv[]) { - int numprocs, rank, namelen; - char processor_name[MPI_MAX_PROCESSOR_NAME]; - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &numprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - MPI_Get_processor_name(processor_name, &namelen); + int matrix_a [A_ROWS][A_COLS] = { + {9, 0}, + {5, 6}, + {1, 2} + }; - // TODO + int matrix_b [B_ROWS][B_COLS] = { + {2, 4, 3}, + {7, 8, 9} + }; - MPI_Finalize(); - return 0; + int matrix_x [X_ROWS][X_COLS]; + + // multipy matrices a and b + for (int row = 0; row < A_ROWS; row++) { + for (int col = 0; col < B_COLS; col++) { + int sum = 0; + for (int ctrl = 0; ctrl < B_ROWS; ctrl++) + sum = sum + matrix_a[row][ctrl] * matrix_b[ctrl][col]; + matrix_x[row][col] = sum; + } + } + + print_matrix("Matrix A", A_ROWS, A_COLS, matrix_a); + print_matrix("Matrix B", B_ROWS, B_COLS, matrix_b); + print_matrix("Matrix X", X_ROWS, X_COLS, matrix_x); + + printf("\n"); + + // TODO + + // int numprocs, rank, namelen; + // char processor_name[MPI_MAX_PROCESSOR_NAME]; + + // MPI_Init(&argc, &argv); + // MPI_Comm_size(MPI_COMM_WORLD, &numprocs); + // MPI_Comm_rank(MPI_COMM_WORLD, &rank); + // MPI_Get_processor_name(processor_name, &namelen); + + // MPI_Finalize(); + + return 0; }
Add matrix multiplication code in C
mit
arthurazs/uff-lpp,arthurazs/uff-lpp,arthurazs/uff-lpp
fee172d7eafd98a5df3c251ed5065f9e91eb4b2a
//===--- Algorithm.h - ------------------------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See http://swift.org/LICENSE.txt for license information // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// // // This file defines helper algorithms, some of which are ported from C++14, // which may not be available on all platforms yet. // //===----------------------------------------------------------------------===// #ifndef SWIFT_BASIC_ALGORITHM_H #define SWIFT_BASIC_ALGORITHM_H namespace swift { /// Returns the minimum of `a` and `b`, or `a` if they are equivalent. template <typename T> constexpr const T &min(const T &a, const T &b) { return !(b < a) ? a : b; } /// Returns the maximum of `a` and `b`, or `a` if they are equivalent. template <typename T> constexpr const T &max(const T &a, const T &b) { return (a < b) ? b : a; } } // end namespace swift #endif /* SWIFT_BASIC_ALGORITHM_H */
//===--- Algorithm.h - ------------------------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See http://swift.org/LICENSE.txt for license information // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// // // This file defines helper algorithms, some of which are ported from C++14, // which may not be available on all platforms yet. // //===----------------------------------------------------------------------===// #ifndef SWIFT_BASIC_ALGORITHM_H #define SWIFT_BASIC_ALGORITHM_H namespace swift { /// Returns the minimum of `a` and `b`, or `a` if they are equivalent. template <typename T> constexpr const T& min(const T &a, const T &b) { return !(b < a) ? a : b; } /// Returns the maximum of `a` and `b`, or `a` if they are equivalent. template <typename T> constexpr const T& max(const T &a, const T &b) { return (a < b) ? b : a; } } // end namespace swift #endif /* SWIFT_BASIC_ALGORITHM_H */
--- +++ @@ -21,13 +21,13 @@ namespace swift { /// Returns the minimum of `a` and `b`, or `a` if they are equivalent. template <typename T> - constexpr const T& min(const T &a, const T &b) { + constexpr const T &min(const T &a, const T &b) { return !(b < a) ? a : b; } /// Returns the maximum of `a` and `b`, or `a` if they are equivalent. template <typename T> - constexpr const T& max(const T &a, const T &b) { + constexpr const T &max(const T &a, const T &b) { return (a < b) ? b : a; } } // end namespace swift
Fix methods return type ampersand location (NFC)
apache-2.0
hughbe/swift,ken0nek/swift,SwiftAndroid/swift,glessard/swift,djwbrown/swift,swiftix/swift,tjw/swift,austinzheng/swift,manavgabhawala/swift,allevato/swift,therealbnut/swift,xedin/swift,arvedviehweger/swift,aschwaighofer/swift,shajrawi/swift,zisko/swift,ahoppen/swift,OscarSwanros/swift,JaSpa/swift,parkera/swift,swiftix/swift,frootloops/swift,alblue/swift,ahoppen/swift,jmgc/swift,OscarSwanros/swift,danielmartin/swift,CodaFi/swift,kperryua/swift,modocache/swift,IngmarStein/swift,stephentyrone/swift,danielmartin/swift,gregomni/swift,kperryua/swift,practicalswift/swift,therealbnut/swift,johnno1962d/swift,kstaring/swift,jckarter/swift,gmilos/swift,calebd/swift,allevato/swift,tardieu/swift,swiftix/swift,sschiau/swift,JGiola/swift,glessard/swift,jmgc/swift,kperryua/swift,arvedviehweger/swift,modocache/swift,manavgabhawala/swift,johnno1962d/swift,russbishop/swift,amraboelela/swift,codestergit/swift,IngmarStein/swift,sschiau/swift,johnno1962d/swift,felix91gr/swift,jtbandes/swift,apple/swift,ben-ng/swift,return/swift,tardieu/swift,huonw/swift,xedin/swift,gribozavr/swift,lorentey/swift,calebd/swift,JaSpa/swift,gregomni/swift,tjw/swift,hooman/swift,gottesmm/swift,harlanhaskins/swift,apple/swift,milseman/swift,xedin/swift,ken0nek/swift,ben-ng/swift,jtbandes/swift,SwiftAndroid/swift,danielmartin/swift,modocache/swift,ken0nek/swift,shajrawi/swift,airspeedswift/swift,aschwaighofer/swift,return/swift,parkera/swift,harlanhaskins/swift,lorentey/swift,atrick/swift,frootloops/swift,jmgc/swift,natecook1000/swift,roambotics/swift,practicalswift/swift,sschiau/swift,allevato/swift,xwu/swift,jtbandes/swift,jmgc/swift,codestergit/swift,OscarSwanros/swift,lorentey/swift,milseman/swift,huonw/swift,jopamer/swift,Jnosh/swift,IngmarStein/swift,apple/swift,tkremenek/swift,tardieu/swift,return/swift,amraboelela/swift,jckarter/swift,karwa/swift,KrishMunot/swift,KrishMunot/swift,tkremenek/swift,shajrawi/swift,IngmarStein/swift,tinysun212/swift-windows,harlanhaskins/swift,austinzheng/swift,ahoppen/swift,frootloops/swift,tardieu/swift,bitjammer/swift,xedin/swift,amraboelela/swift,xwu/swift,karwa/swift,kstaring/swift,djwbrown/swift,bitjammer/swift,CodaFi/swift,return/swift,jopamer/swift,xwu/swift,johnno1962d/swift,hughbe/swift,aschwaighofer/swift,harlanhaskins/swift,modocache/swift,therealbnut/swift,aschwaighofer/swift,lorentey/swift,roambotics/swift,calebd/swift,russbishop/swift,shajrawi/swift,ken0nek/swift,ken0nek/swift,IngmarStein/swift,manavgabhawala/swift,felix91gr/swift,gribozavr/swift,therealbnut/swift,rudkx/swift,gmilos/swift,allevato/swift,shahmishal/swift,roambotics/swift,ahoppen/swift,kstaring/swift,milseman/swift,Jnosh/swift,brentdax/swift,aschwaighofer/swift,brentdax/swift,calebd/swift,CodaFi/swift,nathawes/swift,brentdax/swift,parkera/swift,deyton/swift,glessard/swift,rudkx/swift,ben-ng/swift,deyton/swift,shajrawi/swift,therealbnut/swift,therealbnut/swift,tkremenek/swift,kperryua/swift,dreamsxin/swift,djwbrown/swift,gregomni/swift,alblue/swift,austinzheng/swift,JGiola/swift,gmilos/swift,djwbrown/swift,benlangmuir/swift,huonw/swift,brentdax/swift,ahoppen/swift,austinzheng/swift,IngmarStein/swift,djwbrown/swift,bitjammer/swift,johnno1962d/swift,tinysun212/swift-windows,russbishop/swift,russbishop/swift,hughbe/swift,JGiola/swift,allevato/swift,natecook1000/swift,xwu/swift,natecook1000/swift,manavgabhawala/swift,nathawes/swift,amraboelela/swift,djwbrown/swift,arvedviehweger/swift,jmgc/swift,harlanhaskins/swift,shajrawi/swift,kstaring/swift,atrick/swift,alblue/swift,hughbe/swift,JaSpa/swift,benlangmuir/swift,danielmartin/swift,felix91gr/swift,uasys/swift,lorentey/swift,rudkx/swift,benlangmuir/swift,stephentyrone/swift,deyton/swift,gregomni/swift,ahoppen/swift,practicalswift/swift,roambotics/swift,kperryua/swift,devincoughlin/swift,xwu/swift,KrishMunot/swift,parkera/swift,huonw/swift,shahmishal/swift,shajrawi/swift,allevato/swift,frootloops/swift,karwa/swift,tjw/swift,karwa/swift,jmgc/swift,modocache/swift,gribozavr/swift,tjw/swift,OscarSwanros/swift,jtbandes/swift,arvedviehweger/swift,KrishMunot/swift,xedin/swift,hughbe/swift,codestergit/swift,sschiau/swift,atrick/swift,calebd/swift,KrishMunot/swift,austinzheng/swift,codestergit/swift,glessard/swift,tardieu/swift,kperryua/swift,JGiola/swift,airspeedswift/swift,JGiola/swift,jckarter/swift,shahmishal/swift,sschiau/swift,ken0nek/swift,amraboelela/swift,kstaring/swift,stephentyrone/swift,jopamer/swift,arvedviehweger/swift,stephentyrone/swift,uasys/swift,brentdax/swift,IngmarStein/swift,tjw/swift,manavgabhawala/swift,harlanhaskins/swift,manavgabhawala/swift,huonw/swift,modocache/swift,practicalswift/swift,arvedviehweger/swift,zisko/swift,jckarter/swift,brentdax/swift,parkera/swift,ben-ng/swift,milseman/swift,airspeedswift/swift,frootloops/swift,nathawes/swift,gmilos/swift,uasys/swift,tinysun212/swift-windows,aschwaighofer/swift,xedin/swift,felix91gr/swift,swiftix/swift,deyton/swift,calebd/swift,frootloops/swift,hooman/swift,hughbe/swift,Jnosh/swift,apple/swift,rudkx/swift,lorentey/swift,jtbandes/swift,rudkx/swift,nathawes/swift,karwa/swift,deyton/swift,SwiftAndroid/swift,gribozavr/swift,xwu/swift,amraboelela/swift,tkremenek/swift,swiftix/swift,tkremenek/swift,CodaFi/swift,nathawes/swift,modocache/swift,shahmishal/swift,allevato/swift,karwa/swift,milseman/swift,tkremenek/swift,JaSpa/swift,jckarter/swift,huonw/swift,gmilos/swift,benlangmuir/swift,xedin/swift,bitjammer/swift,practicalswift/swift,johnno1962d/swift,CodaFi/swift,danielmartin/swift,uasys/swift,zisko/swift,shahmishal/swift,bitjammer/swift,felix91gr/swift,practicalswift/swift,karwa/swift,hooman/swift,JGiola/swift,jtbandes/swift,tinysun212/swift-windows,swiftix/swift,stephentyrone/swift,felix91gr/swift,devincoughlin/swift,karwa/swift,atrick/swift,amraboelela/swift,shahmishal/swift,tardieu/swift,tinysun212/swift-windows,return/swift,kstaring/swift,kperryua/swift,alblue/swift,alblue/swift,jopamer/swift,atrick/swift,gottesmm/swift,milseman/swift,codestergit/swift,airspeedswift/swift,uasys/swift,OscarSwanros/swift,uasys/swift,russbishop/swift,ken0nek/swift,sschiau/swift,atrick/swift,danielmartin/swift,apple/swift,practicalswift/swift,gregomni/swift,dreamsxin/swift,gribozavr/swift,russbishop/swift,gribozavr/swift,austinzheng/swift,tinysun212/swift-windows,ben-ng/swift,devincoughlin/swift,arvedviehweger/swift,natecook1000/swift,xwu/swift,Jnosh/swift,jckarter/swift,therealbnut/swift,JaSpa/swift,shahmishal/swift,OscarSwanros/swift,gmilos/swift,danielmartin/swift,JaSpa/swift,ben-ng/swift,benlangmuir/swift,tjw/swift,swiftix/swift,gmilos/swift,tjw/swift,hooman/swift,glessard/swift,calebd/swift,OscarSwanros/swift,shajrawi/swift,parkera/swift,jopamer/swift,return/swift,glessard/swift,bitjammer/swift,gottesmm/swift,CodaFi/swift,roambotics/swift,gribozavr/swift,apple/swift,deyton/swift,devincoughlin/swift,russbishop/swift,gottesmm/swift,alblue/swift,lorentey/swift,natecook1000/swift,manavgabhawala/swift,jmgc/swift,parkera/swift,deyton/swift,CodaFi/swift,rudkx/swift,practicalswift/swift,return/swift,Jnosh/swift,KrishMunot/swift,djwbrown/swift,codestergit/swift,milseman/swift,natecook1000/swift,sschiau/swift,uasys/swift,jtbandes/swift,nathawes/swift,felix91gr/swift,gottesmm/swift,brentdax/swift,KrishMunot/swift,tkremenek/swift,stephentyrone/swift,codestergit/swift,airspeedswift/swift,gottesmm/swift,kstaring/swift,SwiftAndroid/swift,SwiftAndroid/swift,benlangmuir/swift,gribozavr/swift,hooman/swift,natecook1000/swift,xedin/swift,zisko/swift,Jnosh/swift,jckarter/swift,hooman/swift,aschwaighofer/swift,johnno1962d/swift,shahmishal/swift,jopamer/swift,SwiftAndroid/swift,jopamer/swift,sschiau/swift,devincoughlin/swift,gottesmm/swift,frootloops/swift,airspeedswift/swift,devincoughlin/swift,zisko/swift,stephentyrone/swift,alblue/swift,parkera/swift,Jnosh/swift,zisko/swift,huonw/swift,JaSpa/swift,nathawes/swift,zisko/swift,gregomni/swift,hooman/swift,devincoughlin/swift,ben-ng/swift,bitjammer/swift,harlanhaskins/swift,roambotics/swift,tardieu/swift,lorentey/swift,tinysun212/swift-windows,airspeedswift/swift,austinzheng/swift,devincoughlin/swift,SwiftAndroid/swift,hughbe/swift
0c84db950784ba4dd56f92220419490faff1f915
#include "h_iconv.h" // Wrapper functions, since iconv_open et al are macros in libiconv. iconv_t h_iconv_open(const char *tocode, const char *fromcode) { return iconv_open(tocode, fromcode); } void h_iconv_close(iconv_t cd) { iconv_close(cd); } size_t h_iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { // Cast inbuf to (void*) so that it works both on Solaris, which expects // a (const char**), and on other platforms (e.g. Linux), which expect // a (char **). return iconv(cd, (void*)inbuf, inbytesleft, outbuf, outbytesleft); }
#include "h_iconv.h" // Wrapper functions, since iconv_open et al are macros in libiconv. iconv_t h_iconv_open(const char *tocode, const char *fromcode) { return iconv_open(tocode, fromcode); } void h_iconv_close(iconv_t cd) { iconv_close(cd); } size_t h_iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return iconv(cd, (void*)inbuf, inbytesleft, outbuf, outbytesleft); }
--- +++ @@ -11,5 +11,8 @@ size_t h_iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { + // Cast inbuf to (void*) so that it works both on Solaris, which expects + // a (const char**), and on other platforms (e.g. Linux), which expect + // a (char **). return iconv(cd, (void*)inbuf, inbytesleft, outbuf, outbytesleft); }
Add a comment explaining why iconv needs a (void*) for its parameter.
bsd-3-clause
judah/haskeline,ghc/packages-haskeline,leroux/packages-haskeline,ghc/packages-haskeline,judah/haskeline
f26f972cf79bc911fd3997d903128b7aac8b1677
/* * PBKDF2 * (C) 1999-2007 Jack Lloyd * * Distributed under the terms of the Botan license */ #ifndef BOTAN_PBKDF2_H__ #define BOTAN_PBKDF2_H__ #include <botan/pbkdf.h> #include <botan/mac.h> namespace Botan { /** * PKCS #5 PBKDF2 */ class BOTAN_DLL PKCS5_PBKDF2 : public PBKDF { public: std::string name() const { return "PBKDF2(" + mac->name() + ")"; } PBKDF* clone() const { return new PKCS5_PBKDF2(mac->clone()); } OctetString derive_key(u32bit output_len, const std::string& passphrase, const byte salt[], u32bit salt_len, u32bit iterations) const; /** * Create a PKCS #5 instance using the specified message auth code * @param mac_fn the MAC to use */ PKCS5_PBKDF2(MessageAuthenticationCode* mac_fn) : mac(mac_fn) {} /** * Destructor */ ~PKCS5_PBKDF2() { delete mac; } private: MessageAuthenticationCode* mac; }; } #endif
/* * PBKDF2 * (C) 1999-2007 Jack Lloyd * * Distributed under the terms of the Botan license */ #ifndef BOTAN_PBKDF2_H__ #define BOTAN_PBKDF2_H__ #include <botan/pbkdf.h> #include <botan/mac.h> namespace Botan { /** * PKCS #5 PBKDF2 */ class BOTAN_DLL PKCS5_PBKDF2 : public PBKDF { public: std::string name() const { return "PBKDF2(" + mac->name() + ")"; } PBKDF* clone() const { return new PKCS5_PBKDF2(mac->clone()); } OctetString derive_key(u32bit output_len, const std::string& passphrase, const byte salt[], u32bit salt_len, u32bit iterations) const; /** * Create a PKCS #5 instance using the specified message auth code * @param mac the MAC to use */ PKCS5_PBKDF2(MessageAuthenticationCode* m) : mac(m) {} /** * Destructor */ ~PKCS5_PBKDF2() { delete mac; } private: MessageAuthenticationCode* mac; }; } #endif
--- +++ @@ -36,9 +36,9 @@ /** * Create a PKCS #5 instance using the specified message auth code - * @param mac the MAC to use + * @param mac_fn the MAC to use */ - PKCS5_PBKDF2(MessageAuthenticationCode* m) : mac(m) {} + PKCS5_PBKDF2(MessageAuthenticationCode* mac_fn) : mac(mac_fn) {} /** * Destructor
Fix Doxygen comment in PBKDF2 constructor
bsd-2-clause
Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,randombit/botan,webmaster128/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan
7777019a00df754e5e61f8d26af86014a02f8f92
#pragma once #include <string> #include <sstream> #include <Eigen/Dense> std::string output_matrices(Eigen::MatrixXd expected, Eigen::MatrixXd actual) { std::stringstream ss; ss << "expected:\n" << expected << "\nactual:\n" << actual << std::endl; return ss.str(); } /* * allclose() function to match numpy.allclose * https://stackoverflow.com/questions/15051367/how-to-compare-vectors-approximately-in-eige://stackoverflow.com/questions/15051367/how-to-compare-vectors-approximately-in-eigen */ namespace test { template<typename DerivedA, typename DerivedB> bool allclose(const Eigen::DenseBase<DerivedA>& a, const Eigen::DenseBase<DerivedB>& b, const typename DerivedA::RealScalar& rtol = Eigen::NumTraits<typename DerivedA::RealScalar>::dummy_precision(), const typename DerivedA::RealScalar& atol = Eigen::NumTraits<typename DerivedA::RealScalar>::epsilon()) { return ((a.derived() - b.derived()).array().abs() <= (atol + rtol * b.derived().array().abs())).all(); } } // namespace test
#pragma once #include <string> #include <sstream> #include <Eigen/Dense> std::string output_matrices(Eigen::MatrixXd expected, Eigen::MatrixXd actual) { std::stringstream ss; ss << "expected:\n" << expected << "\nactual:\n" << actual << std::endl; return ss.str(); }
--- +++ @@ -8,3 +8,20 @@ ss << "expected:\n" << expected << "\nactual:\n" << actual << std::endl; return ss.str(); } + +/* + * allclose() function to match numpy.allclose + * https://stackoverflow.com/questions/15051367/how-to-compare-vectors-approximately-in-eige://stackoverflow.com/questions/15051367/how-to-compare-vectors-approximately-in-eigen + */ +namespace test { + +template<typename DerivedA, typename DerivedB> +bool allclose(const Eigen::DenseBase<DerivedA>& a, const Eigen::DenseBase<DerivedB>& b, + const typename DerivedA::RealScalar& rtol + = Eigen::NumTraits<typename DerivedA::RealScalar>::dummy_precision(), + const typename DerivedA::RealScalar& atol + = Eigen::NumTraits<typename DerivedA::RealScalar>::epsilon()) { + return ((a.derived() - b.derived()).array().abs() <= (atol + rtol * b.derived().array().abs())).all(); +} + +} // namespace test
Add allclose function for testing Compare relative and absolute tolerence of matrix elements. Eigen isApprox() functions compare matrix norms.
bsd-2-clause
oliverlee/bicycle,oliverlee/bicycle
fdeab35e4997c16515efea32d97845786d373990
#include <jni.h> #include <signal.h> #include <android/log.h> #define CATCHSIG(X) sigaction(X, &handler, &old_sa[X]) static struct sigaction old_sa[NSIG]; void android_sigaction(int signal, siginfo_t *info, void *reserved) { // TODO invoke java method } JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) { __android_log_print(ANDROID_LOG_VERBOSE, "Scavenger Jni", "JNI_OnLoad is called"); struct sigaction handler; memset(&handler, 0, sizeof(sigaction)); handler.sa_sigaction = android_sigaction; handler.sa_flags = SA_RESETHAND; CATCHSIG(SIGILL); CATCHSIG(SIGABRT); CATCHSIG(SIGBUS); CATCHSIG(SIGFPE); CATCHSIG(SIGSEGV); CATCHSIG(SIGPIPE); return JNI_VERSION_1_4; }
#include <jni.h> #include <android/log.h> JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) { __android_log_print(ANDROID_LOG_VERBOSE, "Scavenger Jni", "JNI_OnLoad is called"); }
--- +++ @@ -1,7 +1,27 @@ #include <jni.h> +#include <signal.h> #include <android/log.h> + +#define CATCHSIG(X) sigaction(X, &handler, &old_sa[X]) + +static struct sigaction old_sa[NSIG]; + +void android_sigaction(int signal, siginfo_t *info, void *reserved) { + // TODO invoke java method +} JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) { __android_log_print(ANDROID_LOG_VERBOSE, "Scavenger Jni", "JNI_OnLoad is called"); + struct sigaction handler; + memset(&handler, 0, sizeof(sigaction)); + handler.sa_sigaction = android_sigaction; + handler.sa_flags = SA_RESETHAND; + CATCHSIG(SIGILL); + CATCHSIG(SIGABRT); + CATCHSIG(SIGBUS); + CATCHSIG(SIGFPE); + CATCHSIG(SIGSEGV); + CATCHSIG(SIGPIPE); + return JNI_VERSION_1_4; }
Add jni code to catch crash signal
apache-2.0
Shunix/Scavenger,Shunix/Scavenger
0d91ee8a0d9b26e4847ce5724a08a0d5160b38e8
char* file_to_buffer(const char *filename) { struct stat sb; stat(filename, &sb); char *buffer = (char*) malloc(sb.st_size * sizeof(char)); FILE *f = fopen(filename, "rb"); assert(fread((void*) buffer, sizeof(char), sb.st_size, f)); fclose(f); return buffer; } void* mmalloc(size_t sz, char *filename) { int fd = open(filename, O_RDWR | O_CREAT, 0666); assert(fd != -1); char v = 0; for (size_t i = 0; i < sz; i++) { assert(write(fd, &v, sizeof(char))); } void *map = mmap(NULL, sz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); madvise(map, sz, MADV_RANDOM); return map; }
char* file_to_buffer(const char *filename) { struct stat sb; stat(filename, &sb); char *buffer = (char*) malloc(sb.st_size * sizeof(char)); FILE *f = fopen(filename, "rb"); assert(fread((void*) buffer, sizeof(char), sb.st_size, f)); fclose(f); return buffer; }
--- +++ @@ -7,3 +7,15 @@ fclose(f); return buffer; } + +void* mmalloc(size_t sz, char *filename) { + int fd = open(filename, O_RDWR | O_CREAT, 0666); + assert(fd != -1); + char v = 0; + for (size_t i = 0; i < sz; i++) { + assert(write(fd, &v, sizeof(char))); + } + void *map = mmap(NULL, sz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + madvise(map, sz, MADV_RANDOM); + return map; +}
Implement dirty unallocatable memory mapped alloc.
mit
frostburn/tinytsumego,frostburn/tinytsumego
9075cf1aa531252ffd4b97bddcbc4ca702da5436
#include <kotaka/paths.h> #include <kotaka/log.h> #include "~/test.h" #include <status.h> static void create() { } void ignite(int count) { call_out("bomb", 0, count); } void touchall() { int i; LOGD->post_message("test", LOG_INFO, "Beginning touch"); call_out("do_touch", 0, status(ST_OTABSIZE) - 1); } static void do_touch(int quota) { int limit; limit = 1024; if (quota % limit != 0) { limit = quota % limit; } for (; quota >= 0 && limit > 0; quota--, limit--) { object bomb; if (bomb = find_object("~/obj/bomb" + quota)) { call_touch(bomb); } } LOGD->post_message("test", LOG_INFO, quota + " objects left to check for touches."); if (quota > 0) { call_out("do_touch", 0, quota); } } static void bomb(int quota) { int limit; limit = 200; for (; quota > 0 && limit > 0; quota--, limit--) { clone_object("~/obj/bomb"); } LOGD->post_message("test", LOG_INFO, quota + " bombs left to clone."); if (quota > 0) { call_out("bomb", 0, quota); } }
#include <kotaka/paths.h> #include <kotaka/log.h> #include "~/test.h" #include <status.h> static void create() { } void ignite(int count) { call_out("bomb", 0, count); } static void bomb(int quota) { int max; max = (int)sqrt((float)quota); if (quota % max != 0) { max = quota % max; } if (max > quota) { max = quota; } for (; quota > 0 && max > 0; quota--, max--) { clone_object("~/obj/bomb"); } LOGD->post_message("test", LOG_INFO, quota + " bombs left to clone."); if (quota > 0) { call_out("bomb", 0, quota); } }
--- +++ @@ -13,21 +13,47 @@ call_out("bomb", 0, count); } +void touchall() +{ + int i; + + LOGD->post_message("test", LOG_INFO, "Beginning touch"); + + call_out("do_touch", 0, status(ST_OTABSIZE) - 1); +} + +static void do_touch(int quota) +{ + int limit; + + limit = 1024; + + if (quota % limit != 0) { + limit = quota % limit; + } + + for (; quota >= 0 && limit > 0; quota--, limit--) { + object bomb; + + if (bomb = find_object("~/obj/bomb" + quota)) { + call_touch(bomb); + } + } + + LOGD->post_message("test", LOG_INFO, quota + " objects left to check for touches."); + + if (quota > 0) { + call_out("do_touch", 0, quota); + } +} + static void bomb(int quota) { - int max; + int limit; - max = (int)sqrt((float)quota); + limit = 200; - if (quota % max != 0) { - max = quota % max; - } - - if (max > quota) { - max = quota; - } - - for (; quota > 0 && max > 0; quota--, max--) { + for (; quota > 0 && limit > 0; quota--, limit--) { clone_object("~/obj/bomb"); }
Add call_touch to game test
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
83cf9c9d6a93e0a651547662d556da840bf66b98
#ifndef ALCOMPLEX_H #define ALCOMPLEX_H #include <complex> #include "alspan.h" /** * Iterative implementation of 2-radix FFT (In-place algorithm). Sign = -1 is * FFT and 1 is iFFT (inverse). Fills the buffer with the Discrete Fourier * Transform (DFT) of the time domain data stored in the buffer. The buffer is * an array of complex numbers, and MUST BE power of two. */ void complex_fft(const al::span<std::complex<double>> buffer, const double sign); /** * Calculate the complex helical sequence (discrete-time analytical signal) of * the given input using the discrete Hilbert transform (In-place algorithm). * Fills the buffer with the discrete-time analytical signal stored in the * buffer. The buffer is an array of complex numbers and MUST BE power of two, * and the imaginary components should be cleared to 0. */ void complex_hilbert(const al::span<std::complex<double>> buffer); #endif /* ALCOMPLEX_H */
#ifndef ALCOMPLEX_H #define ALCOMPLEX_H #include <complex> #include "alspan.h" /** * Iterative implementation of 2-radix FFT (In-place algorithm). Sign = -1 is * FFT and 1 is iFFT (inverse). Fills the buffer with the Discrete Fourier * Transform (DFT) of the time domain data stored in the buffer. The buffer is * an array of complex numbers, and MUST BE power of two. */ void complex_fft(const al::span<std::complex<double>> buffer, const double sign); /** * Calculate the complex helical sequence (discrete-time analytical signal) of * the given input using the discrete Hilbert transform (In-place algorithm). * Fills the buffer with the discrete-time analytical signal stored in the * buffer. The buffer is an array of complex numbers and MUST BE power of two. */ void complex_hilbert(const al::span<std::complex<double>> buffer); #endif /* ALCOMPLEX_H */
--- +++ @@ -17,7 +17,8 @@ * Calculate the complex helical sequence (discrete-time analytical signal) of * the given input using the discrete Hilbert transform (In-place algorithm). * Fills the buffer with the discrete-time analytical signal stored in the - * buffer. The buffer is an array of complex numbers and MUST BE power of two. + * buffer. The buffer is an array of complex numbers and MUST BE power of two, + * and the imaginary components should be cleared to 0. */ void complex_hilbert(const al::span<std::complex<double>> buffer);
Add a note about clearing complex_hilbert's imaginary input
lgpl-2.1
aaronmjacobs/openal-soft,aaronmjacobs/openal-soft
b212ab9ea21a093ba8fa9895e723bc76b84cf284
/* Chrome Linux plugin * * This software is released under either the GNU Library General Public * License (see LICENSE.LGPL). * * Note that the only valid version of the LGPL license as far as this * project is concerned is the original GNU Library General Public License * Version 2.1, February 1999 */ #ifndef LABELS_H #define LABELS_H #define USER_CANCEL 1 #define READER_NOT_FOUND 5 #define UNKNOWN_ERROR 5 #define CERT_NOT_FOUND 2 #define INVALID_HASH 17 #define ONLY_HTTPS_ALLOWED 19 #include <map> #include <string> #include <vector> class Labels { private: int selectedLanguage; std::map<std::string,std::vector<std::string> > labels; std::map<int,std::vector<std::string> > errors; std::map<std::string, int> languages; void init(); public: Labels(); void setLanguage(std::string language); std::string get(std::string labelKey); std::string getError(int errorCode); }; extern Labels l10nLabels; #endif /* LABELS_H */
/* Chrome Linux plugin * * This software is released under either the GNU Library General Public * License (see LICENSE.LGPL). * * Note that the only valid version of the LGPL license as far as this * project is concerned is the original GNU Library General Public License * Version 2.1, February 1999 */ #ifndef LABELS_H #define LABELS_H #define USER_CANCEL 1 #define READER_NOT_FOUND 5 #define UNKNOWN_ERROR 5 #define CERT_NOT_FOUND 2 #define INVALID_HASH 17 #define ONLY_HTTPS_ALLOWED 19 #include <map> #include <string> #include <vector> class Labels { private: int selectedLanguage; std::map<std::string,std::string[3]> labels; std::map<int,std::string[3]> errors; std::map<std::string, int> languages; void init(); public: Labels(); void setLanguage(std::string language); std::string get(std::string labelKey); std::string getError(int errorCode); }; extern Labels l10nLabels; #endif /* LABELS_H */
--- +++ @@ -25,8 +25,8 @@ class Labels { private: int selectedLanguage; - std::map<std::string,std::string[3]> labels; - std::map<int,std::string[3]> errors; + std::map<std::string,std::vector<std::string> > labels; + std::map<int,std::vector<std::string> > errors; std::map<std::string, int> languages; void init();
Fix GCC bug based code (allows to compile with clang)
lgpl-2.1
metsma/chrome-token-signing,cristiano-andrade/chrome-token-signing,cristiano-andrade/chrome-token-signing,fabiorusso/chrome-token-signing,cristiano-andrade/chrome-token-signing,metsma/chrome-token-signing,metsma/chrome-token-signing,fabiorusso/chrome-token-signing,fabiorusso/chrome-token-signing,cristiano-andrade/chrome-token-signing,open-eid/chrome-token-signing,open-eid/chrome-token-signing,fabiorusso/chrome-token-signing,open-eid/chrome-token-signing,metsma/chrome-token-signing,open-eid/chrome-token-signing,metsma/chrome-token-signing,open-eid/chrome-token-signing
edcfd59b7b9e3e114ba66b552a1cca48b7365008
//===-- llvm/iBinary.h - Binary Operator node definitions --------*- C++ -*--=// // // This file contains the declarations of all of the Binary Operator classes. // //===----------------------------------------------------------------------===// #ifndef LLVM_IBINARY_H #define LLVM_IBINARY_H #include "llvm/InstrTypes.h" //===----------------------------------------------------------------------===// // Classes to represent Binary operators //===----------------------------------------------------------------------===// // // All of these classes are subclasses of the BinaryOperator class... // class GenericBinaryInst : public BinaryOperator { const char *OpcodeString; public: GenericBinaryInst(unsigned Opcode, Value *S1, Value *S2, const char *OpcodeStr, const string &Name = "") : BinaryOperator(Opcode, S1, S2, Name) { OpcodeString = OpcodeStr; } virtual string getOpcode() const { return OpcodeString; } }; class SetCondInst : public BinaryOperator { BinaryOps OpType; public: SetCondInst(BinaryOps opType, Value *S1, Value *S2, const string &Name = ""); virtual string getOpcode() const; }; #endif
//===-- llvm/iBinary.h - Binary Operator node definitions --------*- C++ -*--=// // // This file contains the declarations of all of the Binary Operator classes. // //===----------------------------------------------------------------------===// #ifndef LLVM_IBINARY_H #define LLVM_IBINARY_H #include "llvm/InstrTypes.h" //===----------------------------------------------------------------------===// // Classes to represent Binary operators //===----------------------------------------------------------------------===// // // All of these classes are subclasses of the BinaryOperator class... // class AddInst : public BinaryOperator { public: AddInst(Value *S1, Value *S2, const string &Name = "") : BinaryOperator(Instruction::Add, S1, S2, Name) { } virtual string getOpcode() const { return "add"; } }; class SubInst : public BinaryOperator { public: SubInst(Value *S1, Value *S2, const string &Name = "") : BinaryOperator(Instruction::Sub, S1, S2, Name) { } virtual string getOpcode() const { return "sub"; } }; class SetCondInst : public BinaryOperator { BinaryOps OpType; public: SetCondInst(BinaryOps opType, Value *S1, Value *S2, const string &Name = ""); virtual string getOpcode() const; }; #endif
--- +++ @@ -16,25 +16,17 @@ // All of these classes are subclasses of the BinaryOperator class... // -class AddInst : public BinaryOperator { +class GenericBinaryInst : public BinaryOperator { + const char *OpcodeString; public: - AddInst(Value *S1, Value *S2, const string &Name = "") - : BinaryOperator(Instruction::Add, S1, S2, Name) { + GenericBinaryInst(unsigned Opcode, Value *S1, Value *S2, + const char *OpcodeStr, const string &Name = "") + : BinaryOperator(Opcode, S1, S2, Name) { + OpcodeString = OpcodeStr; } - virtual string getOpcode() const { return "add"; } + virtual string getOpcode() const { return OpcodeString; } }; - - -class SubInst : public BinaryOperator { -public: - SubInst(Value *S1, Value *S2, const string &Name = "") - : BinaryOperator(Instruction::Sub, S1, S2, Name) { - } - - virtual string getOpcode() const { return "sub"; } -}; - class SetCondInst : public BinaryOperator { BinaryOps OpType;
Make a new GenericBinaryInst class, instead of providing lots of silly little classes. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@82 91177308-0d34-0410-b5e6-96231b3b80d8
bsd-2-clause
dslab-epfl/asap,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,chubbymaggie/asap
9af81a685e627783b65a9346fa02270a5b59b304
#include "ug_thread_safe_counter.h" #pragma once // obsolete once intrusive_ref_counter is available everywhere namespace Moses { class reference_counter { public: friend void intrusive_ptr_add_ref(reference_counter const* p) { if (p) ++p->m_refcount; } friend void intrusive_ptr_release(reference_counter const* p) { if (p && --p->m_refcount == 0) delete p; } protected: reference_counter() {} virtual ~reference_counter() {}; private: mutable ThreadSafeCounter m_refcount; }; }
#include "ug_thread_safe_counter.h" #pragma once // obsolete once intrusive_ref_counter is available everywhere namespace Moses { class reference_counter { public: friend void intrusive_ptr_add_ref(reference_counter* p) { if (p) ++p->m_refcount; } friend void intrusive_ptr_release(reference_counter* p) { if (p && --p->m_refcount == 0) delete p; } protected: reference_counter() {} virtual ~reference_counter() {}; private: mutable ThreadSafeCounter m_refcount; }; }
--- +++ @@ -7,11 +7,11 @@ class reference_counter { public: - friend void intrusive_ptr_add_ref(reference_counter* p) + friend void intrusive_ptr_add_ref(reference_counter const* p) { if (p) ++p->m_refcount; } - friend void intrusive_ptr_release(reference_counter* p) + friend void intrusive_ptr_release(reference_counter const* p) { if (p && --p->m_refcount == 0) delete p;
Allow intrusive pointers to const objects.
lgpl-2.1
pjwilliams/mosesdecoder,KonceptGeek/mosesdecoder,tofula/mosesdecoder,pjwilliams/mosesdecoder,pjwilliams/mosesdecoder,KonceptGeek/mosesdecoder,tofula/mosesdecoder,moses-smt/mosesdecoder,alvations/mosesdecoder,KonceptGeek/mosesdecoder,moses-smt/mosesdecoder,pjwilliams/mosesdecoder,alvations/mosesdecoder,hychyc07/mosesdecoder,emjotde/mosesdecoder_nmt,emjotde/mosesdecoder_nmt,tofula/mosesdecoder,hychyc07/mosesdecoder,emjotde/mosesdecoder_nmt,tofula/mosesdecoder,tofula/mosesdecoder,moses-smt/mosesdecoder,tofula/mosesdecoder,KonceptGeek/mosesdecoder,hychyc07/mosesdecoder,tofula/mosesdecoder,moses-smt/mosesdecoder,alvations/mosesdecoder,emjotde/mosesdecoder_nmt,emjotde/mosesdecoder_nmt,hychyc07/mosesdecoder,alvations/mosesdecoder,tofula/mosesdecoder,moses-smt/mosesdecoder,KonceptGeek/mosesdecoder,tofula/mosesdecoder,emjotde/mosesdecoder_nmt,moses-smt/mosesdecoder,alvations/mosesdecoder,alvations/mosesdecoder,tofula/mosesdecoder,alvations/mosesdecoder,pjwilliams/mosesdecoder,alvations/mosesdecoder,hychyc07/mosesdecoder,moses-smt/mosesdecoder,KonceptGeek/mosesdecoder,moses-smt/mosesdecoder,KonceptGeek/mosesdecoder,moses-smt/mosesdecoder,emjotde/mosesdecoder_nmt,moses-smt/mosesdecoder,pjwilliams/mosesdecoder,emjotde/mosesdecoder_nmt,emjotde/mosesdecoder_nmt,KonceptGeek/mosesdecoder,emjotde/mosesdecoder_nmt,alvations/mosesdecoder,hychyc07/mosesdecoder,pjwilliams/mosesdecoder,pjwilliams/mosesdecoder,pjwilliams/mosesdecoder,hychyc07/mosesdecoder,moses-smt/mosesdecoder,alvations/mosesdecoder,hychyc07/mosesdecoder,tofula/mosesdecoder,pjwilliams/mosesdecoder,alvations/mosesdecoder,KonceptGeek/mosesdecoder,hychyc07/mosesdecoder,hychyc07/mosesdecoder,KonceptGeek/mosesdecoder
b2a3bd280e31b194b9cff3e44915f6344e959bef
/* * Copyright (c) 2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #pragma once #include <glog/logging.h> #include <proxygen/lib/utils/Time.h> namespace proxygen { template <typename ClockType = std::chrono::steady_clock> class MockTimeUtilGeneric : public TimeUtilGeneric<ClockType> { public: void advance(std::chrono::milliseconds ms) { t_ += ms; } void setCurrentTime(std::chrono::time_point<ClockType> t) { CHECK(t.time_since_epoch() > t_.time_since_epoch()) << "Time can not move backwards"; t_ = t; } void verifyAndClear() { } std::chrono::time_point<ClockType> now() const override { return t_; } private: std::chrono::time_point<ClockType> t_; }; using MockTimeUtil = MockTimeUtilGeneric<>; }
/* * Copyright (c) 2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #pragma once #include <glog/logging.h> #include <proxygen/lib/utils/Time.h> namespace proxygen { class MockTimeUtil : public TimeUtil { public: void advance(std::chrono::milliseconds ms) { t_ += ms; } void setCurrentTime(TimePoint t) { CHECK(t.time_since_epoch() > t_.time_since_epoch()) << "Time can not move backwards"; t_ = t; } void verifyAndClear() { } TimePoint now() const override { return t_; } private: TimePoint t_; }; }
--- +++ @@ -14,14 +14,15 @@ namespace proxygen { -class MockTimeUtil : public TimeUtil { +template <typename ClockType = std::chrono::steady_clock> +class MockTimeUtilGeneric : public TimeUtilGeneric<ClockType> { public: void advance(std::chrono::milliseconds ms) { t_ += ms; } - void setCurrentTime(TimePoint t) { + void setCurrentTime(std::chrono::time_point<ClockType> t) { CHECK(t.time_since_epoch() > t_.time_since_epoch()) << "Time can not move backwards"; t_ = t; @@ -30,12 +31,14 @@ void verifyAndClear() { } - TimePoint now() const override { + std::chrono::time_point<ClockType> now() const override { return t_; } private: - TimePoint t_; + std::chrono::time_point<ClockType> t_; }; +using MockTimeUtil = MockTimeUtilGeneric<>; + }
Expire cached TLS session tickets using tlsext_tick_lifetime_hint Summary: Our current TLS cache in liger does not respect timeout hints. We should start doing that because it will limit certain kinds of attacks if an attacker gets access to a master key. Test Plan: Added new test in SSLSessionPersistentCacheTest to test expiration Reviewed By: subodh@fb.com Subscribers: bmatheny, seanc, yfeldblum, devonharris FB internal diff: D2299744 Tasks: 7633098 Signature: t1:2299744:1439331830:9d0770149e49b6094ca61bac4e1e4ef16938c4dc
bsd-3-clause
LilMeyer/proxygen,songfj/proxygen,raphaelamorim/proxygen,raphaelamorim/proxygen,raphaelamorim/proxygen,KublaikhanGeek/proxygen,supriyantomaftuh/proxygen,hiproz/proxygen,pueril/proxygen,hongliangzhao/proxygen,raphaelamorim/proxygen,Werror/proxygen,chenmoshushi/proxygen,supriyantomaftuh/proxygen,hiproz/proxygen,jgli/proxygen,chenmoshushi/proxygen,Orvid/proxygen,chenmoshushi/proxygen,LilMeyer/proxygen,hnutank163/proxygen,zhiweicai/proxygen,songfj/proxygen,jgli/proxygen,KublaikhanGeek/proxygen,hiproz/proxygen,Werror/proxygen,songfj/proxygen,hongliangzhao/proxygen,zhiweicai/proxygen,pueril/proxygen,supriyantomaftuh/proxygen,Werror/proxygen,pueril/proxygen,zhiweicai/proxygen,Orvid/proxygen,hnutank163/proxygen,hiproz/proxygen,KublaikhanGeek/proxygen,jgli/proxygen,jgli/proxygen,hongliangzhao/proxygen,hnutank163/proxygen,fqihangf/proxygen,KublaikhanGeek/proxygen,chenmoshushi/proxygen,fqihangf/proxygen,fqihangf/proxygen,pueril/proxygen,supriyantomaftuh/proxygen,Orvid/proxygen,hongliangzhao/proxygen,zhiweicai/proxygen,LilMeyer/proxygen,Werror/proxygen,LilMeyer/proxygen,fqihangf/proxygen,Orvid/proxygen,songfj/proxygen,hnutank163/proxygen
dfdb3a90d41a8d784e39321f64f2c9cca2bbcfb3
// Copyright (c) 2011 The WebM project authors. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the LICENSE file in the root of the source // tree. An additional intellectual property rights grant can be found // in the file PATENTS. All contributing project authors may // be found in the AUTHORS file in the root of the source tree. #ifndef CLIENT_ENCODER_CLIENT_ENCODER_BASE_H_ #define CLIENT_ENCODER_CLIENT_ENCODER_BASE_H_ #if _WIN32 #ifndef _WIN32_WINNT # define _WIN32_WINNT 0x0501 // WinXP #endif #include <windows.h> #ifdef ERROR # undef ERROR // unused by webmlive/collides with glog. #endif #endif // _WIN32 // App Version/Identity namespace webmlive { static const char* kClientName = "webmlive client encoder"; static const char* kClientVersion = "0.0.2.0"; } // namespace webmlive #endif // CLIENT_ENCODER_CLIENT_ENCODER_BASE_H_
// Copyright (c) 2011 The WebM project authors. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the LICENSE file in the root of the source // tree. An additional intellectual property rights grant can be found // in the file PATENTS. All contributing project authors may // be found in the AUTHORS file in the root of the source tree. #ifndef CLIENT_ENCODER_CLIENT_ENCODER_BASE_H_ #define CLIENT_ENCODER_CLIENT_ENCODER_BASE_H_ #if _WIN32 #ifndef _WIN32_WINNT # define _WIN32_WINNT 0x0501 // WinXP #endif #include <windows.h> #ifdef ERROR # undef ERROR // unused by webmlive/collides with glog. #endif #endif // _WIN32 #endif // CLIENT_ENCODER_CLIENT_ENCODER_BASE_H_
--- +++ @@ -21,4 +21,12 @@ #endif // _WIN32 +// App Version/Identity +namespace webmlive { + +static const char* kClientName = "webmlive client encoder"; +static const char* kClientVersion = "0.0.2.0"; + +} // namespace webmlive + #endif // CLIENT_ENCODER_CLIENT_ENCODER_BASE_H_
Add client name and version constants. Change-Id: Ic5aeafb91ebb9d04ca89679512d3088c612f84e1
bsd-3-clause
kleopatra999/webm.webmlive,kalli123/webm.webmlive,gshORTON/webm.webmlive,reimaginemedia/webm.webmlive,ericmckean/webm.webmlive,kim42083/webm.webmlive,ericmckean/webm.webmlive,Acidburn0zzz/webm.webmlive,Maria1099/webm.webmlive,abwiz0086/webm.webmlive,kleopatra999/webm.webmlive,Acidburn0zzz/webm.webmlive,felipebetancur/webmlive,ericmckean/webm.webmlive,iniwf/webm.webmlive,Acidburn0zzz/webm.webmlive,kalli123/webm.webmlive,kalli123/webm.webmlive,gshORTON/webm.webmlive,reimaginemedia/webm.webmlive,Maria1099/webm.webmlive,felipebetancur/webmlive,webmproject/webmlive,matanbs/webm.webmlive,iniwf/webm.webmlive,Acidburn0zzz/webm.webmlive,gshORTON/webm.webmlive,matanbs/webm.webmlive,webmproject/webmlive,reimaginemedia/webm.webmlive,felipebetancur/webmlive,altogother/webm.webmlive,kleopatra999/webm.webmlive,kalli123/webm.webmlive,iniwf/webm.webmlive,Suvarna1488/webm.webmlive,reimaginemedia/webm.webmlive,webmproject/webmlive,iniwf/webm.webmlive,Suvarna1488/webm.webmlive,kim42083/webm.webmlive,abwiz0086/webm.webmlive,felipebetancur/webmlive,felipebetancur/webmlive,ericmckean/webm.webmlive,altogother/webm.webmlive,kim42083/webm.webmlive,altogother/webm.webmlive,gshORTON/webm.webmlive,kim42083/webm.webmlive,Maria1099/webm.webmlive,abwiz0086/webm.webmlive,abwiz0086/webm.webmlive,webmproject/webmlive,webmproject/webmlive,altogother/webm.webmlive,kleopatra999/webm.webmlive,Suvarna1488/webm.webmlive,matanbs/webm.webmlive,matanbs/webm.webmlive,Suvarna1488/webm.webmlive,Maria1099/webm.webmlive
ecb1728e6880e9368cc9bbd4ba3a82b47456152a
#pragma once /* Customer Structure */ typedef struct customer { char name[25]; // Customer's name long int accnum; // Customer's Account Number long int balance; // Customer's Balance long long int ccn; // Customer's CCN short int pin; // Customer's PIN } customer; /* Current Logged In Customer */ long int currentUserLoggedIn = 0L; bool Login_Menu(); int CCN_VALIDATE(long long CCN); int CCNLength(long long cardNumber); bool CCNCheckLuhn(long long cardNumber, int digits); int getDigit(long long cardNumber, int location); void Show_Stats(long currentUserLoggedIn); bool CCN_OwnerExists(long long CCN); bool PIN_Validate(long long CCN, short int PIN); void LoginUser(long long CCN, short PIN); string GetAccNum(long long CCN); string CCN_GetOwner(long long CCN); void ATMMenu(long accnum); void cash_withdraw(long accnum); void pay_utilitybill(long accnum); void credit_transfer(long accnum); void acc_update(long accnum); void add_funds(long accnum); customer customers[5]; const char* welcome_message = "********************************\ *-->Welcome to Bahria Bank!<---*\ ********************************\n";
#pragma once /* Customer Structure */ typedef struct customer { char name[25]; // Customer's name long int accnum; // Customer's Account Number long int balance; // Customer's Balance long long int ccn; // Customer's CCN short int pin; // Customer's PIN } customer; /* Current Logged In Customer */ long int currentUserLoggedIn = 0L; bool Login_Menu(); int CCN_VALIDATE(long long CCN); int CCNLength(long long cardNumber); bool CCNCheckLuhn(long long cardNumber, int digits); int getDigit(long long cardNumber, int location); void Show_Stats(long currentUserLoggedIn); bool CCN_OwnerExists(long long CCN); bool PIN_Validate(long long CCN, short int PIN); void LoginUser(long long CCN, short PIN); string GetAccNum(long long CCN); string CCN_GetOwner(long long CCN); void ATMMenu(long accnum); void cash_withdraw(long accnum); void pay_utilitybill(long accnum); void credit_transfer(long accnum); void acc_update(long accnum); void add_funds(long accnum); customer customers[5]; char char* welcome_message = "********************************\ *-->Welcome to Bahria Bank!<---*\ ********************************\n";
--- +++ @@ -34,7 +34,7 @@ customer customers[5]; -char char* welcome_message = "********************************\ +const char* welcome_message = "********************************\ *-->Welcome to Bahria Bank!<---*\ ********************************\n";
Fix declaration of welcome message!
mit
saifali96/ATM-Simulator,saifali96/ATM-Simulator
5e35dc73b64ddcb393f291139a394007f6ebb166
/* Copyright (C) 2003 Timo Sirainen */ #include "lib.h" #include "ioloop-internal.h" #ifdef IOLOOP_NOTIFY_NONE #undef io_add_notify struct io *io_add_notify(const char *path __attr_unused__, io_callback_t *callback __attr_unused__, void *context __attr_unused__) { return NULL; } void io_loop_notify_remove(struct ioloop *ioloop __attr_unused__, struct io *io __attr_unused__) { } void io_loop_notify_handler_deinit(struct ioloop *ioloop __attr_unused__) { } #endif
/* Copyright (C) 2003 Timo Sirainen */ #include "lib.h" #include "ioloop-internal.h" #ifdef IOLOOP_NOTIFY_NONE struct io *io_loop_notify_add(struct ioloop *ioloop __attr_unused__, const char *path __attr_unused__, io_callback_t *callback __attr_unused__, void *context __attr_unused__) { return NULL; } void io_loop_notify_remove(struct ioloop *ioloop __attr_unused__, struct io *io __attr_unused__) { } void io_loop_notify_handler_init(struct ioloop *ioloop __attr_unused__) { } void io_loop_notify_handler_deinit(struct ioloop *ioloop __attr_unused__) { } #endif
--- +++ @@ -5,10 +5,10 @@ #ifdef IOLOOP_NOTIFY_NONE -struct io *io_loop_notify_add(struct ioloop *ioloop __attr_unused__, - const char *path __attr_unused__, - io_callback_t *callback __attr_unused__, - void *context __attr_unused__) +#undef io_add_notify +struct io *io_add_notify(const char *path __attr_unused__, + io_callback_t *callback __attr_unused__, + void *context __attr_unused__) { return NULL; } @@ -18,10 +18,6 @@ { } -void io_loop_notify_handler_init(struct ioloop *ioloop __attr_unused__) -{ -} - void io_loop_notify_handler_deinit(struct ioloop *ioloop __attr_unused__) { }
Fix for building without notify
mit
LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot
9af5280bb7f53ddff998b69ad6007349ffcfeb7c
#ifndef __ASM_SH_FTRACE_H #define __ASM_SH_FTRACE_H #ifdef CONFIG_FUNCTION_TRACER #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ #define FTRACE_SYSCALL_MAX NR_syscalls #ifndef __ASSEMBLY__ extern void mcount(void); #define MCOUNT_ADDR ((long)(mcount)) #ifdef CONFIG_DYNAMIC_FTRACE #define CALL_ADDR ((long)(ftrace_call)) #define STUB_ADDR ((long)(ftrace_stub)) #define GRAPH_ADDR ((long)(ftrace_graph_call)) #define CALLER_ADDR ((long)(ftrace_caller)) #define MCOUNT_INSN_OFFSET ((STUB_ADDR - CALL_ADDR) - 4) #define GRAPH_INSN_OFFSET ((CALLER_ADDR - GRAPH_ADDR) - 4) struct dyn_arch_ftrace { /* No extra data needed on sh */ }; #endif /* CONFIG_DYNAMIC_FTRACE */ static inline unsigned long ftrace_call_adjust(unsigned long addr) { /* 'addr' is the memory table address. */ return addr; } #endif /* __ASSEMBLY__ */ #endif /* CONFIG_FUNCTION_TRACER */ #endif /* __ASM_SH_FTRACE_H */
#ifndef __ASM_SH_FTRACE_H #define __ASM_SH_FTRACE_H #ifdef CONFIG_FUNCTION_TRACER #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ #define FTRACE_SYSCALL_MAX (NR_syscalls - 1) #ifndef __ASSEMBLY__ extern void mcount(void); #define MCOUNT_ADDR ((long)(mcount)) #ifdef CONFIG_DYNAMIC_FTRACE #define CALL_ADDR ((long)(ftrace_call)) #define STUB_ADDR ((long)(ftrace_stub)) #define GRAPH_ADDR ((long)(ftrace_graph_call)) #define CALLER_ADDR ((long)(ftrace_caller)) #define MCOUNT_INSN_OFFSET ((STUB_ADDR - CALL_ADDR) - 4) #define GRAPH_INSN_OFFSET ((CALLER_ADDR - GRAPH_ADDR) - 4) struct dyn_arch_ftrace { /* No extra data needed on sh */ }; #endif /* CONFIG_DYNAMIC_FTRACE */ static inline unsigned long ftrace_call_adjust(unsigned long addr) { /* 'addr' is the memory table address. */ return addr; } #endif /* __ASSEMBLY__ */ #endif /* CONFIG_FUNCTION_TRACER */ #endif /* __ASM_SH_FTRACE_H */
--- +++ @@ -4,7 +4,7 @@ #ifdef CONFIG_FUNCTION_TRACER #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ -#define FTRACE_SYSCALL_MAX (NR_syscalls - 1) +#define FTRACE_SYSCALL_MAX NR_syscalls #ifndef __ASSEMBLY__ extern void mcount(void);
sh: Fix an off-by-1 in FTRACE_SYSCALL_MAX. This is supposed to be the equivalent of __NR_syscalls, not __NR_syscalls -1. The x86 code this was based on had simply fallen out of sync at the time this was implemented. Fix it up now. As a result, tracing of __NR_perf_counter_open works as advertised. Signed-off-by: Paul Mundt <38b52dbb5f0b63d149982b6c5de788ec93a89032@linux-sh.org>
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs
c68e3206862f647117a46a73af76764d750c05bd
/* * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #define L_strlcpy #define Wstrlcpy __strlcpy #include "wstring.c" strong_alias(__strlcpy, strlcpy) #ifdef __LOCALE_C_ONLY weak_alias(__strlcpy, __strxfrm) strong_alias(__strxfrm, strxfrm) #endif #undef L_strlcpy
/* * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #define L_strlcpy #define Wstrlcpy __strlcpy #include "wstring.c" strong_alias(__strlcpy, strlcpy) #ifdef __LOCALE_C_ONLY weak_alias(strlcpy, strxfrm) #endif #undef L_strlcpy
--- +++ @@ -12,7 +12,8 @@ strong_alias(__strlcpy, strlcpy) #ifdef __LOCALE_C_ONLY -weak_alias(strlcpy, strxfrm) +weak_alias(__strlcpy, __strxfrm) +strong_alias(__strxfrm, strxfrm) #endif #undef L_strlcpy
Use correct syntax, correct weak/strong for [__]strxfrm
lgpl-2.1
joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc
3b4851ccd8e04b2db4127ced955cbfecb1e99786
#ifndef _MAIN_H_ #define _MAIN_H_ #define PROGRAM_MAJOR_VERSION 0 #define PROGRAM_MINOR_VERSION 1 #define PROGRAM_PATCH_VERSION 0 #endif /* _MAIN_H_ */
#ifndef _MAIN_H_ #define _MAIN_H_ #define PROGRAM_MAJOR_VERSION 0 #define PROGRAM_MINOR_VERSION 0 #define PROGRAM_PATCH_VERSION 6 #endif /* _MAIN_H_ */
--- +++ @@ -2,8 +2,8 @@ #define _MAIN_H_ #define PROGRAM_MAJOR_VERSION 0 -#define PROGRAM_MINOR_VERSION 0 -#define PROGRAM_PATCH_VERSION 6 +#define PROGRAM_MINOR_VERSION 1 +#define PROGRAM_PATCH_VERSION 0 #endif /* _MAIN_H_ */
Increase game version to 0.1.0.
mit
zear/HomingFever
0d0f6c5793f01a6ef27140ec881d2f5605d5260e
#ifndef SYSSTATS_H #define SYSSTATS_H #include <stdbool.h> #include <ncurses.h> #include <sys/timerfd.h> #include "../util/file_utils.h" #define MAXTOT 16 #define BASE 1024 #define MAXPIDS "/proc/sys/kernel/pid_max" #define MEMFREE "MemAvailable:" #define SECS 60 #define TIME_READ_DEFAULT 0 #define SYS_TIMER_EXPIRED_SEC 0 #define SYS_TIMER_EXPIRED_NSEC 0 #define SYS_TIMER_LENGTH 1 #define PTY_BUFFER_SZ 64 #define NRPTYS "/proc/sys/kernel/pty/nr" typedef struct { char *fstype; uid_t euid; int max_pids; long memtotal; char **current_pids; } sysaux; void build_sys_info(WINDOW *system_window, char *fstype); char *mem_avail(unsigned long memory, unsigned long base); void current_uptime(WINDOW *system_window, unsigned long seconds, int y, int x); int nr_ptys(void); bool is_sysfield_timer_expired(int sys_timer_fd); int set_sys_timer(struct itimerspec *sys_timer); int max_pids(void); #endif
#ifndef SYSSTATS_H #define SYSSTATS_H #include <stdbool.h> #include <ncurses.h> #include <sys/timerfd.h> #include "../util/file_utils.h" #define MAXTOT 16 #define BASE 1024 #define MAXPIDS "/proc/sys/kernel/pid_max" #define MEMFREE "MemFree:" #define SECS 60 #define TIME_READ_DEFAULT 0 #define SYS_TIMER_EXPIRED_SEC 0 #define SYS_TIMER_EXPIRED_NSEC 0 #define SYS_TIMER_LENGTH 1 #define PTY_BUFFER_SZ 64 #define NRPTYS "/proc/sys/kernel/pty/nr" typedef struct { char *fstype; uid_t euid; int max_pids; long memtotal; char **current_pids; } sysaux; void build_sys_info(WINDOW *system_window, char *fstype); char *mem_avail(unsigned long memory, unsigned long base); void current_uptime(WINDOW *system_window, unsigned long seconds, int y, int x); int nr_ptys(void); bool is_sysfield_timer_expired(int sys_timer_fd); int set_sys_timer(struct itimerspec *sys_timer); int max_pids(void); #endif
--- +++ @@ -13,7 +13,7 @@ #define MAXPIDS "/proc/sys/kernel/pid_max" -#define MEMFREE "MemFree:" +#define MEMFREE "MemAvailable:" #define SECS 60
Use MemAvailable for "free mem"
mit
tijko/dashboard
31810dca7c6aec8eaaaf4e690f24d126c7ac917c
#ifndef DASHBOARD_H #define DASHBOARD_H #include <sys/types.h> #include "src/process/process.h" #include "src/system/sys_stats.h" typedef struct { int max_x; int max_y; int prev_x; int prev_y; char *fieldbar; sysaux *system; ps_node *process_list; Tree *process_tree; } Board; void print_usage(void); char set_sort_option(char *opt); void dashboard_mainloop(char attr_sort); void update_process_stats(Tree *ps_tree, ps_node *ps, sysaux *sys); Board *init_board(void); void free_board(Board *board); #endif
#ifndef DASHBOARD_H #define DASHBOARD_H #include <sys/types.h> #include "src/process/process.h" #include "src/system/sys_stats.h" typedef struct { int max_x; int max_y; int prev_x; int prev_y; char *fieldbar; sysaux *system; ps_node *process_list; Tree *process_tree; } Board; void print_usage(void); char set_sort_option(char *opt); void dashboard_mainloop(char attr_sort); void update_process_stats(Tree *ps_tree, ps_node *ps, sysaux *sys); static int calculate_ln_diff(Board *board, int ln, int prev_ln); Board *init_board(void); void free_board(Board *board); #endif
--- +++ @@ -26,8 +26,6 @@ void update_process_stats(Tree *ps_tree, ps_node *ps, sysaux *sys); -static int calculate_ln_diff(Board *board, int ln, int prev_ln); - Board *init_board(void); void free_board(Board *board);
Remove static declaration of line diff
mit
tijko/dashboard
63eaf55f3ec45366e1ef5dab02f1d98a096d1ea2
#include <stdlib.h> #include <stdio.h> #include <assert.h> #include "greatest.h" TEST standalone_pass(void) { PASS(); } /* Add all the definitions that need to be in the test runner's main file. */ GREATEST_MAIN_DEFS(); int main(int argc, char **argv) { struct greatest_report_t report; (void)argc; (void)argv; /* Initialize greatest, but don't build the CLI test runner code. */ GREATEST_INIT(); RUN_TEST(standalone_pass); /* Print report, but do not exit. */ printf("\nStandard report, as printed by greatest:\n"); GREATEST_PRINT_REPORT(); greatest_get_report(&report); printf("\nCustom report:\n"); printf("pass %u, fail %u, skip %u, assertions %u\n", report.passed, report.failed, report.skipped, report.assertions); if (report.failed > 0) { return 1; } return 0; }
#include <stdlib.h> #include <stdio.h> #include <assert.h> #include "greatest.h" TEST standalone_pass(void) { PASS(); } /* Add all the definitions that need to be in the test runner's main file. */ GREATEST_MAIN_DEFS(); int main(int argc, char **argv) { (void)argc; (void)argv; /* Initialize greatest, but don't build the CLI test runner code. */ GREATEST_INIT(); RUN_TEST(standalone_pass); /* Print report, but do not exit. */ printf("\nStandard report, as printed by greatest:\n"); GREATEST_PRINT_REPORT(); struct greatest_report_t report; greatest_get_report(&report); printf("\nCustom report:\n"); printf("pass %u, fail %u, skip %u, assertions %u\n", report.passed, report.failed, report.skipped, report.assertions); if (report.failed > 0) { return 1; } return 0; }
--- +++ @@ -12,6 +12,7 @@ GREATEST_MAIN_DEFS(); int main(int argc, char **argv) { + struct greatest_report_t report; (void)argc; (void)argv; @@ -24,7 +25,6 @@ printf("\nStandard report, as printed by greatest:\n"); GREATEST_PRINT_REPORT(); - struct greatest_report_t report; greatest_get_report(&report); printf("\nCustom report:\n");
Fix warning for mixing declarations and code in ISO C90.
isc
silentbicycle/greatest,silentbicycle/greatest
c2b84152f437e86cc2b55c1cc0bbb35d3fa645b5
/* * Copyright 2016 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include "rpm-helper.h" #ifdef HAVE_CONFIG_H #include <config.h> #endif int rpmErrorCb (rpmlogRec rec, rpmlogCallbackData data) { dE("RPM: %s", rpmlogRecMessage(rec)); return RPMLOG_DEFAULT; } void rpmLibsPreload() { rpmReadConfigFiles(NULL, NULL); }
/* * Copyright 2016 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include "rpm-helper.h" #ifdef HAVE_CONFIG_H #include <config.h> #endif int rpmErrorCb (rpmlogRec rec, rpmlogCallbackData data) { dE("RPM: %s", rpmlogRecMessage(rec)); return RPMLOG_EXIT; // don't perform default logging void rpmLibsPreload() { rpmReadConfigFiles(NULL, NULL); }
--- +++ @@ -27,7 +27,8 @@ int rpmErrorCb (rpmlogRec rec, rpmlogCallbackData data) { dE("RPM: %s", rpmlogRecMessage(rec)); - return RPMLOG_EXIT; // don't perform default logging + return RPMLOG_DEFAULT; +} void rpmLibsPreload() {
probes/rpm: Fix erro cb return value We have to use RPMLOG_DEFAULT, because RPMLOG_EXIT cause exit of whole probe.
lgpl-2.1
redhatrises/openscap,OpenSCAP/openscap,mpreisler/openscap,jan-cerny/openscap,mpreisler/openscap,jan-cerny/openscap,ybznek/openscap,jan-cerny/openscap,ybznek/openscap,jan-cerny/openscap,OpenSCAP/openscap,Hexadorsimal/openscap,jan-cerny/openscap,OpenSCAP/openscap,ybznek/openscap,jan-cerny/openscap,Hexadorsimal/openscap,mpreisler/openscap,OpenSCAP/openscap,mpreisler/openscap,mpreisler/openscap,redhatrises/openscap,OpenSCAP/openscap,Hexadorsimal/openscap,Hexadorsimal/openscap,ybznek/openscap,Hexadorsimal/openscap,redhatrises/openscap,redhatrises/openscap,ybznek/openscap,OpenSCAP/openscap,Hexadorsimal/openscap,redhatrises/openscap,mpreisler/openscap,redhatrises/openscap,ybznek/openscap
e2ca3c802f97b5ee52f1d15d0e43097a5bef6187
#ifndef COMPAT_H #define COMPAT_H #ifndef HAVE_PLEDGE #include "pledge.h" #endif #ifndef HAVE_STRTONUM #include "strtonum.h" #endif /* Use CLOCK_REALTIME if CLOCK_MONOTONIC is not available */ #ifndef CLOCK_MONOTONIC #define CLOCK_MONOTONIC CLOCK_REALTIME #endif #ifndef timespecsub #define timespecsub(tsp, usp, vsp) \ do { \ (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \ (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ if ((vsp)->tv_nsec < 0) { \ (vsp)->tv_sec--; \ (vsp)->tv_nsec += 1000000000L; \ } \ } while (0) #endif #endif /* COMPAT_H */
#ifndef COMPAT_H #define COMPAT_H #ifndef HAVE_PLEDGE #include "pledge.h" #endif #ifndef HAVE_STRTONUM #include "strtonum.h" #endif #ifndef timespecsub #define timespecsub(tsp, usp, vsp) \ do { \ (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \ (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ if ((vsp)->tv_nsec < 0) { \ (vsp)->tv_sec--; \ (vsp)->tv_nsec += 1000000000L; \ } \ } while (0) #endif #endif /* COMPAT_H */
--- +++ @@ -7,6 +7,11 @@ #ifndef HAVE_STRTONUM #include "strtonum.h" +#endif + +/* Use CLOCK_REALTIME if CLOCK_MONOTONIC is not available */ +#ifndef CLOCK_MONOTONIC +#define CLOCK_MONOTONIC CLOCK_REALTIME #endif #ifndef timespecsub
Use CLOCK_REALTIME if CLOCK_MONOTONIC is not available.
bsd-2-clause
ansilove/ansilove,ansilove/AnsiLove-C
f00bfc8fa7c73e6c58dc71d2da4555ce1712aef4
#pragma once #include <stdint.h> #include <stdlib.h> #include "ewok.h" enum { N_DIVISIONS = 1<<14 }; struct indexed_ewah_map { struct ewah_bitmap *map; size_t bit_from_division[N_DIVISIONS], ptr_from_division[N_DIVISIONS]; }; /* Build an index on top of an existing libewok EWAH map. */ extern void ewah_build_index(struct indexed_ewah_map *); /* Test whether a given bit is set in an indexed EWAH map. */ extern bool indexed_ewah_get(struct indexed_ewah_map *, size_t);
#pragma once #include <stdint.h> #include <stdlib.h> #include "ewok.h" enum { N_DIVISIONS = 65536, LOG2_DIVISIONS = 16 }; struct indexed_ewah_map { struct ewah_bitmap *map; size_t bit_from_division[N_DIVISIONS], ptr_from_division[N_DIVISIONS]; }; /* Build an index on top of an existing libewok EWAH map. */ extern void ewah_build_index(struct indexed_ewah_map *); /* Test whether a given bit is set in an indexed EWAH map. */ extern bool indexed_ewah_get(struct indexed_ewah_map *, size_t);
--- +++ @@ -4,7 +4,7 @@ #include <stdlib.h> #include "ewok.h" -enum { N_DIVISIONS = 65536, LOG2_DIVISIONS = 16 }; +enum { N_DIVISIONS = 1<<14 }; struct indexed_ewah_map { struct ewah_bitmap *map; size_t bit_from_division[N_DIVISIONS], ptr_from_division[N_DIVISIONS];
Change number of divisions in index to 2^14
mit
ratelle/erl_ip_index,ratelle/erl_ip_index,ratelle/erl_ip_index
1200ec14e9e0ec6b27033f59778c7c4dd6690ca4
/* rwsem-const.h: RW semaphore counter constants. */ #ifndef _SPARC64_RWSEM_CONST_H #define _SPARC64_RWSEM_CONST_H #define RWSEM_UNLOCKED_VALUE 0x00000000 #define RWSEM_ACTIVE_BIAS 0x00000001 #define RWSEM_ACTIVE_MASK 0x0000ffff #define RWSEM_WAITING_BIAS (-0x00010000) #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) #endif /* _SPARC64_RWSEM_CONST_H */
/* rwsem-const.h: RW semaphore counter constants. */ #ifndef _SPARC64_RWSEM_CONST_H #define _SPARC64_RWSEM_CONST_H #define RWSEM_UNLOCKED_VALUE 0x00000000 #define RWSEM_ACTIVE_BIAS 0x00000001 #define RWSEM_ACTIVE_MASK 0x0000ffff #define RWSEM_WAITING_BIAS 0xffff0000 #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) #endif /* _SPARC64_RWSEM_CONST_H */
--- +++ @@ -5,7 +5,7 @@ #define RWSEM_UNLOCKED_VALUE 0x00000000 #define RWSEM_ACTIVE_BIAS 0x00000001 #define RWSEM_ACTIVE_MASK 0x0000ffff -#define RWSEM_WAITING_BIAS 0xffff0000 +#define RWSEM_WAITING_BIAS (-0x00010000) #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
sparc64: Fix rwsem constant bug leading to hangs. As noticed by Linus, it is critical that some of the rwsem constants be signed. Yet, hex constants are unsigned unless explicitly casted or negated. The most critical one is RWSEM_WAITING_BIAS. This bug was exacerbated by commit 424acaaeb3a3932d64a9b4bd59df6cf72c22d8f3 ("rwsem: wake queued readers when writer blocks on active read lock") Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>
mit
KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
ef201bebe5afc91a2b99b45dacc8c6dd88ca9e58
#ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class AliQuarkoniaAcceptance+; #pragma link C++ class AliQuarkoniaEfficiency+; #pragma link C++ class AliAODRecoDecayHF+; #pragma link C++ class AliAODRecoDecayHF2Prong+; #pragma link C++ class AliAODRecoDecayHF3Prong+; #pragma link C++ class AliAODRecoDecayHF4Prong+; #pragma link C++ class AliAnalysisVertexingHF+; #pragma link C++ class AliAnalysisTaskVertexingHF+; #pragma link C++ class AliAODDimuon+; #pragma link C++ class AliAODEventInfo+; #pragma link C++ class AliAnalysisTaskMuonAODfromGeneral+; #pragma link C++ class AliAnalysisTaskSingleMu+; #endif
#ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class AliQuarkoniaAcceptance+; #pragma link C++ class AliQuarkoniaEfficiency+; #pragma link C++ class AliD0toKpi+; #pragma link C++ class AliD0toKpiAnalysis+; #pragma link C++ class AliBtoJPSItoEle+; #pragma link C++ class AliBtoJPSItoEleAnalysis+; #pragma link C++ class AliAODRecoDecayHF+; #pragma link C++ class AliAODRecoDecayHF2Prong+; #pragma link C++ class AliAODRecoDecayHF3Prong+; #pragma link C++ class AliAODRecoDecayHF4Prong+; #pragma link C++ class AliAnalysisVertexingHF+; #pragma link C++ class AliAnalysisTaskVertexingHF+; #pragma link C++ class AliAODDimuon+; #pragma link C++ class AliAODEventInfo+; #pragma link C++ class AliAnalysisTaskMuonAODfromGeneral+; #pragma link C++ class AliAnalysisTaskSingleMu+; #endif
--- +++ @@ -6,11 +6,6 @@ #pragma link C++ class AliQuarkoniaAcceptance+; #pragma link C++ class AliQuarkoniaEfficiency+; - -#pragma link C++ class AliD0toKpi+; -#pragma link C++ class AliD0toKpiAnalysis+; -#pragma link C++ class AliBtoJPSItoEle+; -#pragma link C++ class AliBtoJPSItoEleAnalysis+; #pragma link C++ class AliAODRecoDecayHF+; #pragma link C++ class AliAODRecoDecayHF2Prong+;
Move AliD0toKpi* and AliBtoJPSI* from libPWG3base to libPWG3 (Andrea)
bsd-3-clause
yowatana/AliPhysics,akubera/AliPhysics,rderradi/AliPhysics,rbailhac/AliPhysics,AMechler/AliPhysics,adriansev/AliPhysics,ppribeli/AliPhysics,hcab14/AliPhysics,pbatzing/AliPhysics,dlodato/AliPhysics,ALICEHLT/AliPhysics,pbuehler/AliPhysics,alisw/AliPhysics,SHornung1/AliPhysics,dstocco/AliPhysics,hzanoli/AliPhysics,rihanphys/AliPhysics,mpuccio/AliPhysics,pbuehler/AliPhysics,sebaleh/AliPhysics,lfeldkam/AliPhysics,rihanphys/AliPhysics,preghenella/AliPhysics,alisw/AliPhysics,mazimm/AliPhysics,amaringarcia/AliPhysics,pchrista/AliPhysics,fcolamar/AliPhysics,kreisl/AliPhysics,pbuehler/AliPhysics,hcab14/AliPhysics,jgronefe/AliPhysics,AudreyFrancisco/AliPhysics,hcab14/AliPhysics,dstocco/AliPhysics,preghenella/AliPhysics,dmuhlhei/AliPhysics,fbellini/AliPhysics,mbjadhav/AliPhysics,jmargutt/AliPhysics,fbellini/AliPhysics,mkrzewic/AliPhysics,mvala/AliPhysics,hcab14/AliPhysics,ALICEHLT/AliPhysics,fbellini/AliPhysics,pchrista/AliPhysics,dlodato/AliPhysics,victor-gonzalez/AliPhysics,jmargutt/AliPhysics,mpuccio/AliPhysics,AudreyFrancisco/AliPhysics,fbellini/AliPhysics,fcolamar/AliPhysics,mbjadhav/AliPhysics,btrzecia/AliPhysics,carstooon/AliPhysics,jgronefe/AliPhysics,dmuhlhei/AliPhysics,mvala/AliPhysics,hzanoli/AliPhysics,AMechler/AliPhysics,rbailhac/AliPhysics,nschmidtALICE/AliPhysics,pbatzing/AliPhysics,mkrzewic/AliPhysics,akubera/AliPhysics,kreisl/AliPhysics,aaniin/AliPhysics,lfeldkam/AliPhysics,pchrista/AliPhysics,mazimm/AliPhysics,victor-gonzalez/AliPhysics,btrzecia/AliPhysics,akubera/AliPhysics,sebaleh/AliPhysics,AMechler/AliPhysics,SHornung1/AliPhysics,mkrzewic/AliPhysics,ppribeli/AliPhysics,lcunquei/AliPhysics,dmuhlhei/AliPhysics,lfeldkam/AliPhysics,rihanphys/AliPhysics,alisw/AliPhysics,amatyja/AliPhysics,lcunquei/AliPhysics,fbellini/AliPhysics,AudreyFrancisco/AliPhysics,pbatzing/AliPhysics,pbuehler/AliPhysics,mkrzewic/AliPhysics,lfeldkam/AliPhysics,mbjadhav/AliPhysics,dstocco/AliPhysics,dmuhlhei/AliPhysics,kreisl/AliPhysics,carstooon/AliPhysics,pbatzing/AliPhysics,mkrzewic/AliPhysics,dlodato/AliPhysics,preghenella/AliPhysics,kreisl/AliPhysics,mbjadhav/AliPhysics,rderradi/AliPhysics,dstocco/AliPhysics,dlodato/AliPhysics,AudreyFrancisco/AliPhysics,dmuhlhei/AliPhysics,rbailhac/AliPhysics,ppribeli/AliPhysics,akubera/AliPhysics,adriansev/AliPhysics,jmargutt/AliPhysics,mvala/AliPhysics,nschmidtALICE/AliPhysics,fcolamar/AliPhysics,rderradi/AliPhysics,rderradi/AliPhysics,ppribeli/AliPhysics,carstooon/AliPhysics,lcunquei/AliPhysics,mpuccio/AliPhysics,ALICEHLT/AliPhysics,mvala/AliPhysics,aaniin/AliPhysics,mbjadhav/AliPhysics,victor-gonzalez/AliPhysics,kreisl/AliPhysics,AMechler/AliPhysics,hzanoli/AliPhysics,hzanoli/AliPhysics,hcab14/AliPhysics,rderradi/AliPhysics,aaniin/AliPhysics,dstocco/AliPhysics,akubera/AliPhysics,mazimm/AliPhysics,carstooon/AliPhysics,rihanphys/AliPhysics,amatyja/AliPhysics,sebaleh/AliPhysics,pchrista/AliPhysics,akubera/AliPhysics,adriansev/AliPhysics,amatyja/AliPhysics,alisw/AliPhysics,pbatzing/AliPhysics,yowatana/AliPhysics,mvala/AliPhysics,aaniin/AliPhysics,AudreyFrancisco/AliPhysics,sebaleh/AliPhysics,AMechler/AliPhysics,hcab14/AliPhysics,aaniin/AliPhysics,hzanoli/AliPhysics,pbuehler/AliPhysics,carstooon/AliPhysics,yowatana/AliPhysics,mkrzewic/AliPhysics,nschmidtALICE/AliPhysics,btrzecia/AliPhysics,AMechler/AliPhysics,SHornung1/AliPhysics,lcunquei/AliPhysics,mpuccio/AliPhysics,nschmidtALICE/AliPhysics,rbailhac/AliPhysics,amaringarcia/AliPhysics,SHornung1/AliPhysics,aaniin/AliPhysics,fcolamar/AliPhysics,lfeldkam/AliPhysics,adriansev/AliPhysics,mkrzewic/AliPhysics,btrzecia/AliPhysics,jgronefe/AliPhysics,fcolamar/AliPhysics,pbatzing/AliPhysics,lfeldkam/AliPhysics,yowatana/AliPhysics,mazimm/AliPhysics,pchrista/AliPhysics,rderradi/AliPhysics,SHornung1/AliPhysics,fbellini/AliPhysics,mvala/AliPhysics,aaniin/AliPhysics,yowatana/AliPhysics,ALICEHLT/AliPhysics,mpuccio/AliPhysics,fcolamar/AliPhysics,rihanphys/AliPhysics,carstooon/AliPhysics,mvala/AliPhysics,pbuehler/AliPhysics,lcunquei/AliPhysics,dlodato/AliPhysics,hzanoli/AliPhysics,amatyja/AliPhysics,amatyja/AliPhysics,dlodato/AliPhysics,adriansev/AliPhysics,jmargutt/AliPhysics,ALICEHLT/AliPhysics,mpuccio/AliPhysics,AudreyFrancisco/AliPhysics,mazimm/AliPhysics,alisw/AliPhysics,kreisl/AliPhysics,SHornung1/AliPhysics,lcunquei/AliPhysics,rbailhac/AliPhysics,nschmidtALICE/AliPhysics,yowatana/AliPhysics,amaringarcia/AliPhysics,jmargutt/AliPhysics,preghenella/AliPhysics,pbatzing/AliPhysics,dmuhlhei/AliPhysics,adriansev/AliPhysics,preghenella/AliPhysics,sebaleh/AliPhysics,victor-gonzalez/AliPhysics,dstocco/AliPhysics,preghenella/AliPhysics,lfeldkam/AliPhysics,ppribeli/AliPhysics,nschmidtALICE/AliPhysics,akubera/AliPhysics,mbjadhav/AliPhysics,SHornung1/AliPhysics,amatyja/AliPhysics,amaringarcia/AliPhysics,ppribeli/AliPhysics,mazimm/AliPhysics,mbjadhav/AliPhysics,alisw/AliPhysics,jmargutt/AliPhysics,AudreyFrancisco/AliPhysics,rihanphys/AliPhysics,victor-gonzalez/AliPhysics,jgronefe/AliPhysics,nschmidtALICE/AliPhysics,ALICEHLT/AliPhysics,fcolamar/AliPhysics,AMechler/AliPhysics,rderradi/AliPhysics,mpuccio/AliPhysics,dstocco/AliPhysics,ALICEHLT/AliPhysics,pbuehler/AliPhysics,lcunquei/AliPhysics,hcab14/AliPhysics,alisw/AliPhysics,sebaleh/AliPhysics,hzanoli/AliPhysics,amatyja/AliPhysics,sebaleh/AliPhysics,carstooon/AliPhysics,pchrista/AliPhysics,rbailhac/AliPhysics,amaringarcia/AliPhysics,preghenella/AliPhysics,btrzecia/AliPhysics,btrzecia/AliPhysics,fbellini/AliPhysics,jgronefe/AliPhysics,dlodato/AliPhysics,yowatana/AliPhysics,ppribeli/AliPhysics,victor-gonzalez/AliPhysics,jgronefe/AliPhysics,mazimm/AliPhysics,amaringarcia/AliPhysics,rihanphys/AliPhysics,jmargutt/AliPhysics,jgronefe/AliPhysics,kreisl/AliPhysics,adriansev/AliPhysics,dmuhlhei/AliPhysics,amaringarcia/AliPhysics,rbailhac/AliPhysics,pchrista/AliPhysics,victor-gonzalez/AliPhysics,btrzecia/AliPhysics
31c42798c74f5ae31a996ea17c96ec1301876a26
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CONSENSUS_CONSENSUS_H #define BITCOIN_CONSENSUS_CONSENSUS_H /** The maximum allowed size for a serialized block, in bytes (network rule) */ static const unsigned int MAX_BLOCK_SIZE = 2000000; /** The maximum allowed number of signature check operations in a block (network rule) */ static const unsigned int MAX_BLOCK_SIGOPS = 20000; /** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */ static const int COINBASE_MATURITY = 100; /** Flags for LockTime() */ enum { /* Use GetMedianTimePast() instead of nTime for end point timestamp. */ LOCKTIME_MEDIAN_TIME_PAST = (1 << 1), }; /** Used as the flags parameter to CheckFinalTx() in non-consensus code */ static const unsigned int STANDARD_LOCKTIME_VERIFY_FLAGS = LOCKTIME_MEDIAN_TIME_PAST; #endif // BITCOIN_CONSENSUS_CONSENSUS_H
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CONSENSUS_CONSENSUS_H #define BITCOIN_CONSENSUS_CONSENSUS_H /** The maximum allowed size for a serialized block, in bytes (network rule) */ static const unsigned int MAX_BLOCK_SIZE = 2000000; /** The maximum allowed number of signature check operations in a block (network rule) */ static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50; /** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */ static const int COINBASE_MATURITY = 100; /** Flags for LockTime() */ enum { /* Use GetMedianTimePast() instead of nTime for end point timestamp. */ LOCKTIME_MEDIAN_TIME_PAST = (1 << 1), }; /** Used as the flags parameter to CheckFinalTx() in non-consensus code */ static const unsigned int STANDARD_LOCKTIME_VERIFY_FLAGS = LOCKTIME_MEDIAN_TIME_PAST; #endif // BITCOIN_CONSENSUS_CONSENSUS_H
--- +++ @@ -9,7 +9,7 @@ /** The maximum allowed size for a serialized block, in bytes (network rule) */ static const unsigned int MAX_BLOCK_SIZE = 2000000; /** The maximum allowed number of signature check operations in a block (network rule) */ -static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50; +static const unsigned int MAX_BLOCK_SIGOPS = 20000; /** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */ static const int COINBASE_MATURITY = 100;
Make sigop limit `20000` just as in Bitcoin, ignoring our change to the blocksize limit.
mit
bitcoinsSG/zcash,CTRoundTable/Encrypted.Cash,bitcoinsSG/zcash,CTRoundTable/Encrypted.Cash,CTRoundTable/Encrypted.Cash,bitcoinsSG/zcash,CTRoundTable/Encrypted.Cash,bitcoinsSG/zcash,bitcoinsSG/zcash,CTRoundTable/Encrypted.Cash,CTRoundTable/Encrypted.Cash,bitcoinsSG/zcash
6ef996a3b60c5e85621acb5f1ef9ccf7da6a1925
#ifndef BANDIT_DEFAULT_FAILURE_FORMATTER_H #define BANDIT_DEFAULT_FAILURE_FORMATTER_H namespace bandit { namespace detail { struct default_failure_formatter : public failure_formatter { std::string format(const assertion_exception& err) const { std::stringstream ss; if(err.file_name().size()) { ss << err.file_name(); if(err.line_number()) { ss << ":" << err.line_number(); } ss << ": "; } ss << std::endl << err.what(); return ss.str(); } }; }} #endif
#ifndef BANDIT_DEFAULT_FAILURE_FORMATTER_H #define BANDIT_DEFAULT_FAILURE_FORMATTER_H namespace bandit { namespace detail { struct default_failure_formatter : public failure_formatter { std::string format(const assertion_exception& err) const { std::stringstream ss; if(err.file_name().size()) { ss << err.file_name(); if(err.line_number()) { ss << ":" << err.line_number(); } ss << ": "; } ss << err.what(); return ss.str(); } }; }} #endif
--- +++ @@ -20,7 +20,7 @@ ss << ": "; } - ss << err.what(); + ss << std::endl << err.what(); return ss.str(); }
Add line break in default error formatter
mit
ogdf/bandit,ogdf/bandit
f7d94cd1d223a1e0ede58bb361e28e0f14ad4ff9
/* @(#)root/treeplayer:$Name: $:$Id: LinkDef.h,v 1.2 2000/07/06 17:20:52 brun Exp $ */ /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class TTreePlayer+; #pragma link C++ class TPacketGenerator; #pragma link C++ class TTreeFormula-; #endif
/* @(#)root/treeplayer:$Name: $:$Id: LinkDef.h,v 1.1.1.1 2000/05/16 17:00:44 rdm Exp $ */ /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class TTreePlayer; #pragma link C++ class TPacketGenerator; #pragma link C++ class TTreeFormula-; #endif
--- +++ @@ -1,4 +1,4 @@ -/* @(#)root/treeplayer:$Name: $:$Id: LinkDef.h,v 1.1.1.1 2000/05/16 17:00:44 rdm Exp $ */ +/* @(#)root/treeplayer:$Name: $:$Id: LinkDef.h,v 1.2 2000/07/06 17:20:52 brun Exp $ */ /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * @@ -14,7 +14,7 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class TTreePlayer; +#pragma link C++ class TTreePlayer+; #pragma link C++ class TPacketGenerator; #pragma link C++ class TTreeFormula-;
Declare option "+" for TTreePlayer git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@986 27541ba8-7e3a-0410-8455-c3a389f83636
lgpl-2.1
root-mirror/root,mattkretz/root,krafczyk/root,olifre/root,root-mirror/root,mhuwiler/rootauto,omazapa/root-old,krafczyk/root,veprbl/root,perovic/root,smarinac/root,esakellari/root,sawenzel/root,buuck/root,ffurano/root5,beniz/root,zzxuanyuan/root,Duraznos/root,veprbl/root,krafczyk/root,jrtomps/root,mkret2/root,abhinavmoudgil95/root,veprbl/root,abhinavmoudgil95/root,kirbyherm/root-r-tools,BerserkerTroll/root,georgtroska/root,zzxuanyuan/root-compressor-dummy,davidlt/root,root-mirror/root,buuck/root,perovic/root,sirinath/root,pspe/root,tc3t/qoot,strykejern/TTreeReader,Y--/root,BerserkerTroll/root,gganis/root,ffurano/root5,kirbyherm/root-r-tools,abhinavmoudgil95/root,veprbl/root,arch1tect0r/root,smarinac/root,sbinet/cxx-root,BerserkerTroll/root,vukasinmilosevic/root,gganis/root,thomaskeck/root,dfunke/root,gbitzes/root,vukasinmilosevic/root,bbockelm/root,olifre/root,esakellari/root,beniz/root,gbitzes/root,vukasinmilosevic/root,mhuwiler/rootauto,jrtomps/root,pspe/root,veprbl/root,Duraznos/root,evgeny-boger/root,kirbyherm/root-r-tools,BerserkerTroll/root,gganis/root,sbinet/cxx-root,olifre/root,gbitzes/root,mattkretz/root,sbinet/cxx-root,smarinac/root,tc3t/qoot,sbinet/cxx-root,abhinavmoudgil95/root,simonpf/root,simonpf/root,root-mirror/root,omazapa/root,strykejern/TTreeReader,perovic/root,ffurano/root5,perovic/root,gbitzes/root,sawenzel/root,arch1tect0r/root,Y--/root,thomaskeck/root,root-mirror/root,smarinac/root,esakellari/root,bbockelm/root,zzxuanyuan/root-compressor-dummy,smarinac/root,BerserkerTroll/root,Duraznos/root,gbitzes/root,lgiommi/root,0x0all/ROOT,lgiommi/root,cxx-hep/root-cern,alexschlueter/cern-root,esakellari/my_root_for_test,satyarth934/root,bbockelm/root,gganis/root,perovic/root,mattkretz/root,Y--/root,perovic/root,olifre/root,esakellari/root,smarinac/root,cxx-hep/root-cern,krafczyk/root,Y--/root,alexschlueter/cern-root,Dr15Jones/root,karies/root,sawenzel/root,pspe/root,zzxuanyuan/root-compressor-dummy,karies/root,buuck/root,0x0all/ROOT,BerserkerTroll/root,sirinath/root,mattkretz/root,nilqed/root,nilqed/root,root-mirror/root,strykejern/TTreeReader,veprbl/root,Y--/root,arch1tect0r/root,agarciamontoro/root,mkret2/root,dfunke/root,arch1tect0r/root,jrtomps/root,mkret2/root,satyarth934/root,jrtomps/root,georgtroska/root,pspe/root,arch1tect0r/root,abhinavmoudgil95/root,esakellari/my_root_for_test,omazapa/root,simonpf/root,gbitzes/root,esakellari/my_root_for_test,CristinaCristescu/root,karies/root,tc3t/qoot,simonpf/root,buuck/root,nilqed/root,omazapa/root-old,krafczyk/root,gbitzes/root,thomaskeck/root,georgtroska/root,satyarth934/root,krafczyk/root,sirinath/root,vukasinmilosevic/root,thomaskeck/root,tc3t/qoot,nilqed/root,evgeny-boger/root,omazapa/root,evgeny-boger/root,satyarth934/root,Dr15Jones/root,satyarth934/root,beniz/root,mhuwiler/rootauto,arch1tect0r/root,mattkretz/root,BerserkerTroll/root,0x0all/ROOT,esakellari/root,olifre/root,buuck/root,bbockelm/root,CristinaCristescu/root,kirbyherm/root-r-tools,buuck/root,evgeny-boger/root,mkret2/root,veprbl/root,zzxuanyuan/root,omazapa/root-old,simonpf/root,olifre/root,gbitzes/root,omazapa/root,gbitzes/root,sirinath/root,mattkretz/root,omazapa/root,nilqed/root,vukasinmilosevic/root,davidlt/root,omazapa/root,jrtomps/root,gbitzes/root,thomaskeck/root,sawenzel/root,zzxuanyuan/root,lgiommi/root,smarinac/root,pspe/root,omazapa/root,perovic/root,veprbl/root,dfunke/root,CristinaCristescu/root,perovic/root,krafczyk/root,ffurano/root5,veprbl/root,esakellari/my_root_for_test,satyarth934/root,Duraznos/root,davidlt/root,kirbyherm/root-r-tools,Y--/root,simonpf/root,beniz/root,mhuwiler/rootauto,tc3t/qoot,mattkretz/root,lgiommi/root,abhinavmoudgil95/root,sbinet/cxx-root,gganis/root,georgtroska/root,karies/root,zzxuanyuan/root-compressor-dummy,sirinath/root,mkret2/root,pspe/root,ffurano/root5,esakellari/root,zzxuanyuan/root,sbinet/cxx-root,nilqed/root,mattkretz/root,esakellari/root,esakellari/my_root_for_test,esakellari/root,tc3t/qoot,0x0all/ROOT,vukasinmilosevic/root,pspe/root,agarciamontoro/root,karies/root,georgtroska/root,cxx-hep/root-cern,mkret2/root,perovic/root,lgiommi/root,dfunke/root,mkret2/root,0x0all/ROOT,nilqed/root,mhuwiler/rootauto,mhuwiler/rootauto,alexschlueter/cern-root,zzxuanyuan/root,davidlt/root,buuck/root,Duraznos/root,omazapa/root-old,evgeny-boger/root,Duraznos/root,root-mirror/root,Y--/root,pspe/root,satyarth934/root,cxx-hep/root-cern,root-mirror/root,bbockelm/root,davidlt/root,dfunke/root,esakellari/root,davidlt/root,Y--/root,Dr15Jones/root,agarciamontoro/root,omazapa/root-old,CristinaCristescu/root,mattkretz/root,mattkretz/root,beniz/root,sirinath/root,krafczyk/root,olifre/root,olifre/root,lgiommi/root,buuck/root,dfunke/root,agarciamontoro/root,simonpf/root,dfunke/root,bbockelm/root,beniz/root,sawenzel/root,BerserkerTroll/root,Duraznos/root,davidlt/root,tc3t/qoot,georgtroska/root,bbockelm/root,Dr15Jones/root,bbockelm/root,mkret2/root,bbockelm/root,Duraznos/root,alexschlueter/cern-root,omazapa/root-old,dfunke/root,omazapa/root-old,gganis/root,esakellari/my_root_for_test,smarinac/root,jrtomps/root,vukasinmilosevic/root,nilqed/root,sbinet/cxx-root,Dr15Jones/root,smarinac/root,agarciamontoro/root,sawenzel/root,CristinaCristescu/root,gganis/root,bbockelm/root,abhinavmoudgil95/root,mhuwiler/rootauto,nilqed/root,agarciamontoro/root,tc3t/qoot,mkret2/root,olifre/root,georgtroska/root,georgtroska/root,nilqed/root,Duraznos/root,olifre/root,nilqed/root,strykejern/TTreeReader,sirinath/root,olifre/root,gganis/root,root-mirror/root,CristinaCristescu/root,mhuwiler/rootauto,Duraznos/root,lgiommi/root,vukasinmilosevic/root,pspe/root,CristinaCristescu/root,strykejern/TTreeReader,Y--/root,alexschlueter/cern-root,arch1tect0r/root,zzxuanyuan/root-compressor-dummy,beniz/root,agarciamontoro/root,zzxuanyuan/root-compressor-dummy,strykejern/TTreeReader,sbinet/cxx-root,veprbl/root,lgiommi/root,sirinath/root,zzxuanyuan/root-compressor-dummy,smarinac/root,Dr15Jones/root,esakellari/my_root_for_test,karies/root,alexschlueter/cern-root,evgeny-boger/root,BerserkerTroll/root,jrtomps/root,zzxuanyuan/root-compressor-dummy,beniz/root,perovic/root,zzxuanyuan/root,jrtomps/root,sbinet/cxx-root,omazapa/root-old,0x0all/ROOT,buuck/root,karies/root,beniz/root,satyarth934/root,CristinaCristescu/root,karies/root,gganis/root,beniz/root,zzxuanyuan/root,sawenzel/root,kirbyherm/root-r-tools,bbockelm/root,zzxuanyuan/root,cxx-hep/root-cern,sawenzel/root,arch1tect0r/root,dfunke/root,omazapa/root,zzxuanyuan/root,pspe/root,thomaskeck/root,cxx-hep/root-cern,mkret2/root,sawenzel/root,evgeny-boger/root,tc3t/qoot,Y--/root,esakellari/my_root_for_test,omazapa/root-old,esakellari/my_root_for_test,mhuwiler/rootauto,jrtomps/root,abhinavmoudgil95/root,omazapa/root,esakellari/root,evgeny-boger/root,thomaskeck/root,simonpf/root,jrtomps/root,arch1tect0r/root,zzxuanyuan/root-compressor-dummy,0x0all/ROOT,georgtroska/root,perovic/root,zzxuanyuan/root,zzxuanyuan/root-compressor-dummy,lgiommi/root,zzxuanyuan/root-compressor-dummy,CristinaCristescu/root,beniz/root,sbinet/cxx-root,sirinath/root,arch1tect0r/root,davidlt/root,strykejern/TTreeReader,sirinath/root,vukasinmilosevic/root,BerserkerTroll/root,gganis/root,krafczyk/root,georgtroska/root,sirinath/root,esakellari/root,evgeny-boger/root,krafczyk/root,agarciamontoro/root,ffurano/root5,sawenzel/root,krafczyk/root,abhinavmoudgil95/root,omazapa/root-old,gbitzes/root,Y--/root,lgiommi/root,satyarth934/root,karies/root,simonpf/root,arch1tect0r/root,zzxuanyuan/root,dfunke/root,abhinavmoudgil95/root,mattkretz/root,satyarth934/root,agarciamontoro/root,agarciamontoro/root,gganis/root,BerserkerTroll/root,buuck/root,dfunke/root,0x0all/ROOT,Dr15Jones/root,root-mirror/root,root-mirror/root,omazapa/root-old,simonpf/root,satyarth934/root,thomaskeck/root,vukasinmilosevic/root,evgeny-boger/root,esakellari/my_root_for_test,davidlt/root,tc3t/qoot,sbinet/cxx-root,0x0all/ROOT,zzxuanyuan/root,thomaskeck/root,lgiommi/root,thomaskeck/root,abhinavmoudgil95/root,CristinaCristescu/root,jrtomps/root,simonpf/root,cxx-hep/root-cern,georgtroska/root,agarciamontoro/root,karies/root,mhuwiler/rootauto,pspe/root,mhuwiler/rootauto,evgeny-boger/root,veprbl/root,omazapa/root,CristinaCristescu/root,alexschlueter/cern-root,omazapa/root,davidlt/root,kirbyherm/root-r-tools,mkret2/root,sawenzel/root,cxx-hep/root-cern,buuck/root,ffurano/root5,davidlt/root,vukasinmilosevic/root,karies/root,Duraznos/root
d0adf82885e8d650575f9290ca2e2620e240bec5
/* * C Interface between calcterm and a calculator. * A shared library must implement this interface * to be loadable by calcterm. */ extern "C" { struct CI_Config { int flag; }; struct CI_Result { char* one_line; char** grid; int y; }; void CI_init( CI_Config* config ); CI_Result* CI_submit( char const* input ); void CI_result_release( CI_Result* result ); } /* extern "C" */
typedef CI_Config void*; CI_Result CI_submit(char const* input);
--- +++ @@ -1,6 +1,23 @@ +/* + * C Interface between calcterm and a calculator. + * A shared library must implement this interface + * to be loadable by calcterm. + */ -typedef CI_Config void*; +extern "C" { +struct CI_Config { + int flag; +}; +struct CI_Result { + char* one_line; + char** grid; + int y; +}; -CI_Result CI_submit(char const* input); +void CI_init( CI_Config* config ); +CI_Result* CI_submit( char const* input ); +void CI_result_release( CI_Result* result ); + +} /* extern "C" */
Add a basic interface for calcterm
bsd-2-clause
dpacbach/calcterm,dpacbach/calcterm,dpacbach/calcterm,dpacbach/calcterm
f4370ff2104c52e41aa4a01935f22aae342e07f7
// Copyright 2020 The IREE Authors // // Licensed under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // This files defines a helper to trigger the registration of dialects to // the system. #ifndef IREE_TOOLS_INIT_XLA_DIALECTS_H_ #define IREE_TOOLS_INIT_XLA_DIALECTS_H_ #include "mlir-hlo/Dialect/mhlo/IR/chlo_ops.h" #include "mlir-hlo/Dialect/mhlo/IR/hlo_ops.h" #include "mlir/IR/Dialect.h" namespace mlir { // Add all the XLA dialects to the provided registry. inline void registerXLADialects(DialectRegistry &registry) { // clang-format off registry.insert<mlir::chlo::HloClientDialect, mlir::mhlo::MhloDialect>(); // clang-format on } } // namespace mlir #endif // IREE_TOOLS_INIT_XLA_DIALECTS_H_
// Copyright 2020 The IREE Authors // // Licensed under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // This files defines a helper to trigger the registration of dialects to // the system. #ifndef IREE_TOOLS_INIT_XLA_DIALECTS_H_ #define IREE_TOOLS_INIT_XLA_DIALECTS_H_ #include "mlir-hlo/Dialect/mhlo/IR/chlo_ops.h" #include "mlir-hlo/Dialect/mhlo/IR/hlo_ops.h" #include "mlir-hlo/Dialect/mhlo/IR/lhlo_ops.h" #include "mlir/IR/Dialect.h" namespace mlir { // Add all the XLA dialects to the provided registry. inline void registerXLADialects(DialectRegistry &registry) { // clang-format off registry.insert<mlir::chlo::HloClientDialect, mlir::lmhlo::LmhloDialect, mlir::mhlo::MhloDialect>(); // clang-format on } } // namespace mlir #endif // IREE_TOOLS_INIT_XLA_DIALECTS_H_
--- +++ @@ -12,7 +12,6 @@ #include "mlir-hlo/Dialect/mhlo/IR/chlo_ops.h" #include "mlir-hlo/Dialect/mhlo/IR/hlo_ops.h" -#include "mlir-hlo/Dialect/mhlo/IR/lhlo_ops.h" #include "mlir/IR/Dialect.h" namespace mlir { @@ -21,7 +20,6 @@ inline void registerXLADialects(DialectRegistry &registry) { // clang-format off registry.insert<mlir::chlo::HloClientDialect, - mlir::lmhlo::LmhloDialect, mlir::mhlo::MhloDialect>(); // clang-format on }
Move the lhlo dialect into its own directory. Also remove it from registerAllMhloDialects and make registrations explicit. PiperOrigin-RevId: 412411838
apache-2.0
iree-org/iree,iree-org/iree,google/iree,google/iree,google/iree,iree-org/iree,iree-org/iree,google/iree,google/iree,google/iree,iree-org/iree,iree-org/iree,google/iree,iree-org/iree
b650f4bc8e04662493546c8ab2ab0fbca1081dac
#ifndef _OFFLINE_STATES_H_ #define _OFFLINE_STATES_H_ /* Cpu offline states go here */ enum cpu_state_vals { CPU_STATE_OFFLINE, CPU_STATE_INACTIVE, CPU_STATE_ONLINE, CPU_MAX_OFFLINE_STATES }; #ifdef CONFIG_HOTPLUG_CPU extern enum cpu_state_vals get_cpu_current_state(int cpu); extern void set_cpu_current_state(int cpu, enum cpu_state_vals state); extern void set_preferred_offline_state(int cpu, enum cpu_state_vals state); extern void set_default_offline_state(int cpu); #else static inline enum cpu_state_vals get_cpu_current_state(int cpu) { return CPU_STATE_ONLINE; } static inline void set_cpu_current_state(int cpu, enum cpu_state_vals state) { } static inline void set_preferred_offline_state(int cpu, enum cpu_state_vals state) { } static inline void set_default_offline_state(int cpu) { } #endif extern enum cpu_state_vals get_preferred_offline_state(int cpu); extern int start_secondary(void); #endif
#ifndef _OFFLINE_STATES_H_ #define _OFFLINE_STATES_H_ /* Cpu offline states go here */ enum cpu_state_vals { CPU_STATE_OFFLINE, CPU_STATE_INACTIVE, CPU_STATE_ONLINE, CPU_MAX_OFFLINE_STATES }; extern enum cpu_state_vals get_cpu_current_state(int cpu); extern void set_cpu_current_state(int cpu, enum cpu_state_vals state); extern enum cpu_state_vals get_preferred_offline_state(int cpu); extern void set_preferred_offline_state(int cpu, enum cpu_state_vals state); extern void set_default_offline_state(int cpu); extern int start_secondary(void); #endif
--- +++ @@ -9,10 +9,30 @@ CPU_MAX_OFFLINE_STATES }; +#ifdef CONFIG_HOTPLUG_CPU extern enum cpu_state_vals get_cpu_current_state(int cpu); extern void set_cpu_current_state(int cpu, enum cpu_state_vals state); -extern enum cpu_state_vals get_preferred_offline_state(int cpu); extern void set_preferred_offline_state(int cpu, enum cpu_state_vals state); extern void set_default_offline_state(int cpu); +#else +static inline enum cpu_state_vals get_cpu_current_state(int cpu) +{ + return CPU_STATE_ONLINE; +} + +static inline void set_cpu_current_state(int cpu, enum cpu_state_vals state) +{ +} + +static inline void set_preferred_offline_state(int cpu, enum cpu_state_vals state) +{ +} + +static inline void set_default_offline_state(int cpu) +{ +} +#endif + +extern enum cpu_state_vals get_preferred_offline_state(int cpu); extern int start_secondary(void); #endif
powerpc: Fix SMP build with disabled CPU hotplugging. Compiling 2.6.33 with SMP enabled and HOTPLUG_CPU disabled gives me the following link errors: LD init/built-in.o LD .tmp_vmlinux1 arch/powerpc/platforms/built-in.o: In function `.smp_xics_setup_cpu': smp.c:(.devinit.text+0x88): undefined reference to `.set_cpu_current_state' smp.c:(.devinit.text+0x94): undefined reference to `.set_default_offline_state' arch/powerpc/platforms/built-in.o: In function `.smp_pSeries_kick_cpu': smp.c:(.devinit.text+0x13c): undefined reference to `.set_preferred_offline_state' smp.c:(.devinit.text+0x148): undefined reference to `.get_cpu_current_state' smp.c:(.devinit.text+0x1a8): undefined reference to `.get_cpu_current_state' make: *** [.tmp_vmlinux1] Error 1 The following change fixes that for me and seems to work as expected. Signed-off-by: Adam Lackorzynski <0e18f44c1fec03ec4083422cb58ba6a09ac4fb2a@os.inf.tu-dresden.de> Signed-off-by: Benjamin Herrenschmidt <a7089bb6e7e92505d88aaff006cbdd60cc9120b6@kernel.crashing.org>
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas
5b72d74ce2fccca2a301de60f31b16ddf5c93984
#ifndef __libfixmath_color_h__ #define __libfixmath_color_h__ #include "fix16.h" typedef union { struct { unsigned int :1; unsigned int b:5; unsigned int g:5; unsigned int r:5; } __packed; uint8_t comp[3]; uint16_t raw; } __aligned (4) color_rgb_t; typedef union { struct { fix16_t v; fix16_t s; fix16_t h; }; fix16_t comp[3]; } __aligned (4) color_fix16_hsv_t; typedef union { struct { uint8_t v; uint8_t s; uint8_t h; }; uint8_t comp[3]; } __aligned (4) color_uint8_hsv_t; extern void color_rgb_hsv_convert(const color_rgb_t *, color_fix16_hsv_t *); extern void color_hsv_lerp(const color_fix16_hsv_t *, const color_fix16_hsv_t *, fix16_t, color_fix16_hsv_t *); #endif /* !__libfixmath_color_h__ */
#ifndef __libfixmath_color_h__ #define __libfixmath_color_h__ #include "fix16.h" typedef union { struct { unsigned int r:5; unsigned int g:5; unsigned int b:5; unsigned int :1; } __packed; uint8_t comp[3]; uint16_t raw; } __aligned (4) color_rgb_t; typedef union { struct { fix16_t h; fix16_t s; fix16_t v; }; fix16_t comp[3]; } __aligned (4) color_fix16_hsv_t; typedef union { struct { uint8_t h; uint8_t s; uint8_t v; }; uint8_t comp[3]; } __aligned (4) color_uint8_hsv_t; extern void color_rgb_hsv_convert(const color_rgb_t *, color_fix16_hsv_t *); extern void color_hsv_lerp(const color_fix16_hsv_t *, const color_fix16_hsv_t *, fix16_t, color_fix16_hsv_t *); #endif /* !__libfixmath_color_h__ */
--- +++ @@ -5,10 +5,10 @@ typedef union { struct { + unsigned int :1; + unsigned int b:5; + unsigned int g:5; unsigned int r:5; - unsigned int g:5; - unsigned int b:5; - unsigned int :1; } __packed; uint8_t comp[3]; uint16_t raw; @@ -16,18 +16,18 @@ typedef union { struct { + fix16_t v; + fix16_t s; fix16_t h; - fix16_t s; - fix16_t v; }; fix16_t comp[3]; } __aligned (4) color_fix16_hsv_t; typedef union { struct { + uint8_t v; + uint8_t s; uint8_t h; - uint8_t s; - uint8_t v; }; uint8_t comp[3]; } __aligned (4) color_uint8_hsv_t;
Change R and B components
mit
ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul
3c1245b31011d25f7c660592d456cf9109766195
/* * Copyright 2006 The WebRTC Project Authors. All rights reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ // This module contains some basic debugging facilities. // Originally comes from shared/commandlineflags/checks.h #ifndef WEBRTC_BASE_CHECKS_H_ #define WEBRTC_BASE_CHECKS_H_ namespace rtc { // Prints an error message to stderr and aborts execution. void Fatal(const char* file, int line, const char* format, ...); } // namespace rtc // Trigger a fatal error (which aborts the process and prints an error // message). FATAL_ERROR_IF may seem a lot like assert, but there's a crucial // difference: it's always "on". This means that it can be used to check for // regular errors that could actually happen, not just programming errors that // supposedly can't happen---but triggering a fatal error will kill the process // in an ugly way, so it's not suitable for catching errors that might happen // in production. #define FATAL_ERROR(msg) do { rtc::Fatal(__FILE__, __LINE__, msg); } while (0) #define FATAL_ERROR_IF(x) do { if (x) FATAL_ERROR("check failed"); } while (0) // The UNREACHABLE macro is very useful during development. #define UNREACHABLE() FATAL_ERROR("unreachable code") #endif // WEBRTC_BASE_CHECKS_H_
/* * Copyright 2006 The WebRTC Project Authors. All rights reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ // This module contains some basic debugging facilities. // Originally comes from shared/commandlineflags/checks.h #ifndef WEBRTC_BASE_CHECKS_H_ #define WEBRTC_BASE_CHECKS_H_ namespace rtc { // Prints an error message to stderr and aborts execution. void Fatal(const char* file, int line, const char* format, ...); } // namespace rtc // The UNREACHABLE macro is very useful during development. #define UNREACHABLE() \ rtc::Fatal(__FILE__, __LINE__, "unreachable code") #endif // WEBRTC_BASE_CHECKS_H_
--- +++ @@ -21,8 +21,17 @@ } // namespace rtc +// Trigger a fatal error (which aborts the process and prints an error +// message). FATAL_ERROR_IF may seem a lot like assert, but there's a crucial +// difference: it's always "on". This means that it can be used to check for +// regular errors that could actually happen, not just programming errors that +// supposedly can't happen---but triggering a fatal error will kill the process +// in an ugly way, so it's not suitable for catching errors that might happen +// in production. +#define FATAL_ERROR(msg) do { rtc::Fatal(__FILE__, __LINE__, msg); } while (0) +#define FATAL_ERROR_IF(x) do { if (x) FATAL_ERROR("check failed"); } while (0) + // The UNREACHABLE macro is very useful during development. -#define UNREACHABLE() \ - rtc::Fatal(__FILE__, __LINE__, "unreachable code") +#define UNREACHABLE() FATAL_ERROR("unreachable code") #endif // WEBRTC_BASE_CHECKS_H_
Define convenient FATAL_ERROR() and FATAL_ERROR_IF() macros R=henrike@webrtc.org Review URL: https://webrtc-codereview.appspot.com/16079004 Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc Cr-Mirrored-Commit: 0fa6366ed15f48b3ec227987f21f339180fb4936
bsd-3-clause
sippet/webrtc,sippet/webrtc,sippet/webrtc,sippet/webrtc,sippet/webrtc,sippet/webrtc
d660bde85ad87e3309082e9031b77e9e16b5752d
#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); }
--- +++ @@ -24,7 +24,7 @@ /* send message */ void -_midisend(unsigned char message[], size_t count) +midisend(unsigned char message[], size_t count) { snd_seq_event_t ev;
Fix undefined reference to "midisend" when using ALSA Signed-off-by: Henrique N. Lengler <6cdc851d94ddec54baafad133c2f9a87abb571af@openmailbox.org>
isc
henriqueleng/svmidi
b814282dc2db635d31fbe219e99a423337aa2dbf
/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */ #include "common.h" #include "commands.h" #include "imap-expunge.h" bool cmd_close(struct client_command_context *cmd) { struct client *client = cmd->client; struct mailbox *mailbox = client->mailbox; struct mail_storage *storage; if (!client_verify_open_mailbox(cmd)) return TRUE; storage = mailbox_get_storage(mailbox); client->mailbox = NULL; if (!imap_expunge(mailbox, NULL)) client_send_untagged_storage_error(client, storage); else if (mailbox_sync(mailbox, 0, 0, NULL) < 0) client_send_untagged_storage_error(client, storage); if (mailbox_close(&mailbox) < 0) client_send_untagged_storage_error(client, storage); client_update_mailbox_flags(client, NULL); client_send_tagline(cmd, "OK Close completed."); return TRUE; }
/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */ #include "common.h" #include "commands.h" #include "imap-expunge.h" bool cmd_close(struct client_command_context *cmd) { struct client *client = cmd->client; struct mailbox *mailbox = client->mailbox; struct mail_storage *storage; if (!client_verify_open_mailbox(cmd)) return TRUE; storage = mailbox_get_storage(mailbox); client->mailbox = NULL; if (!imap_expunge(mailbox, NULL)) client_send_untagged_storage_error(client, storage); if (mailbox_close(&mailbox) < 0) client_send_untagged_storage_error(client, storage); client_update_mailbox_flags(client, NULL); client_send_tagline(cmd, "OK Close completed."); return TRUE; }
--- +++ @@ -18,6 +18,8 @@ if (!imap_expunge(mailbox, NULL)) client_send_untagged_storage_error(client, storage); + else if (mailbox_sync(mailbox, 0, 0, NULL) < 0) + client_send_untagged_storage_error(client, storage); if (mailbox_close(&mailbox) < 0) client_send_untagged_storage_error(client, storage);
CLOSE: Synchronize the mailbox after expunging messages to actually get them expunged.
mit
damoxc/dovecot,damoxc/dovecot,damoxc/dovecot,damoxc/dovecot,damoxc/dovecot
ff7a33c4f1e341dbdd4775307e3f52c004c21444
// // FileSystemObject.h // arc // // Created by Jerome Cheng on 1/4/13. // Copyright (c) 2013 nus.cs3217. All rights reserved. // #import <Foundation/Foundation.h> @protocol FileSystemObject <NSObject> @required // The name of this object. @property (strong, nonatomic) NSString *name; // This should be able to be used to reconstruct whatever is needed // to actually access the file/folder. @property (strong, nonatomic) NSString *identifier; // The parent of this object. @property (weak, nonatomic) id<FileSystemObject> parent; // Whether or not this object can be removed. @property BOOL isRemovable; // The size of this object. Folders should return the number of objects // within, Files their size in bytes. @property float size; // Returns the contents of this object. - (id<NSObject>)contents; @optional // Removes this object. // Returns YES if successful, NO otherwise. // If NO is returned, the state of the object or its contents is unstable. - (BOOL)remove; // Initialises this object with the given name, path, and parent. - (id)initWithName:(NSString *)name path:(NSString *)path parent:(id<FileSystemObject>)parent; @end
// // FileSystemObject.h // arc // // Created by Jerome Cheng on 1/4/13. // Copyright (c) 2013 nus.cs3217. All rights reserved. // #import <Foundation/Foundation.h> @protocol FileSystemObject <NSObject> @required // The name of this object. @property (strong, nonatomic) NSString *name; // This should be able to be used to reconstruct whatever is needed // to actually access the file/folder. @property (strong, nonatomic) NSString *identifier; // The parent of this object. @property (weak, nonatomic) id<FileSystemObject> parent; // Whether or not this object can be removed. @property BOOL isRemovable; // The size of this object. Folders should return the number of objects // within, Files their size in bytes. @property float size; // Initialises this object with the given name, path, and parent. - (id)initWithName:(NSString *)name path:(NSString *)path parent:(id<FileSystemObject>)parent; // Returns the contents of this object. - (id<NSObject>)contents; // Removes this object. // Returns YES if successful, NO otherwise. // If NO is returned, the state of the object or its contents is unstable. - (BOOL)remove; @end
--- +++ @@ -29,15 +29,16 @@ // within, Files their size in bytes. @property float size; -// Initialises this object with the given name, path, and parent. -- (id)initWithName:(NSString *)name path:(NSString *)path parent:(id<FileSystemObject>)parent; - // Returns the contents of this object. - (id<NSObject>)contents; +@optional // Removes this object. // Returns YES if successful, NO otherwise. // If NO is returned, the state of the object or its contents is unstable. - (BOOL)remove; +// Initialises this object with the given name, path, and parent. +- (id)initWithName:(NSString *)name path:(NSString *)path parent:(id<FileSystemObject>)parent; + @end
Make remove and initWithName:path:parent optional.
mit
BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc
f5920cfe85c21bb1c928d4550c33a1bedf543913
// PARAM: --enable sem.unknown_function.spawn #include <goblint.h> #include <stddef.h> int magic(void* (f (void *))); void *t_fun(void *arg) { __goblint_check(1); // reachable return NULL; } int main() { magic(t_fun); // unknown function return 0; }
// PARAM: --enable sem.unknown_function.spawn #include <goblint.h> #include <stddef.h> int magic(void* (f (void *))); void *t_fun(void *arg) { // __goblint_check(1); // reachable return NULL; } int main() { magic(t_fun); // unknown function return 0; }
--- +++ @@ -5,7 +5,7 @@ int magic(void* (f (void *))); void *t_fun(void *arg) { - // __goblint_check(1); // reachable + __goblint_check(1); // reachable return NULL; }
Undo commenting out of __goblint_check
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
70e0426892b6df38ce023b41ea86526e55a43c11
// Copyright 2016, Jeffrey E. Bedard #include "xstatus.h" #include "config.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> static const char helptext[] = "DESCRIPTION: Simple X toolbar for minimalistic" " window managers.\n" "USAGE: xstatus [-d DELAY][-f FILE][-h]\n" "\t-d DELAY Set delay between status updates," " in seconds.\n" "\t-f FILE Set FILE to be continuously polled and" " displayed.\n" "\t-h Print this usage information. \n" "Copyright 2016, Jeffrey E. Bedard <jefbed@gmail.com>\n" "Project page: https://github.com/jefbed/xstatus\n"; int main(int argc, char ** argv) { char *filename=DEFAULTF; uint8_t delay=1; int opt; while((opt = getopt(argc, argv, "d:f:h")) != -1) { switch(opt) { case 'd': delay=atoi(optarg); break; case 'f': filename=optarg; break; case 'h': default: write(2, helptext, sizeof(helptext)); exit(0); } } run_xstatus(filename, delay); }
// Copyright 2016, Jeffrey E. Bedard #include "xstatus.h" #include "config.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> static const char * helptext = "DESCRIPTION: Simple X toolbar for minimalistic" " window managers.\n" "USAGE: xstatus [-d DELAY][-f FILE][-h]\n" "\t-d DELAY Set delay between status updates," " in seconds.\n" "\t-f FILE Set FILE to be continuously polled and" " displayed.\n" "\t-h Print this usage information. \n" "Copyright 2016, Jeffrey E. Bedard <jefbed@gmail.com>\n" "Project page: https://github.com/jefbed/xstatus\n"; int main(int argc, char ** argv) { char *filename=DEFAULTF; uint8_t delay=1; int opt; while((opt = getopt(argc, argv, "d:f:h")) != -1) { switch(opt) { case 'd': delay=atoi(optarg); break; case 'f': filename=optarg; break; case 'h': default: fprintf(stdout, "%s", helptext); exit(0); } } run_xstatus(filename, delay); }
--- +++ @@ -7,7 +7,7 @@ #include <stdlib.h> #include <unistd.h> -static const char * helptext = +static const char helptext[] = "DESCRIPTION: Simple X toolbar for minimalistic" " window managers.\n" "USAGE: xstatus [-d DELAY][-f FILE][-h]\n" @@ -34,7 +34,7 @@ break; case 'h': default: - fprintf(stdout, "%s", helptext); + write(2, helptext, sizeof(helptext)); exit(0); } }
Use write(2) to display helptext.
mit
jefbed/xstatus,jefbed/xstatus,jefbed/xstatus,jefbed/xstatus
6ffac22050217acb02c85c9f199c2bb18131b484
#define _XOPEN_SOURCE 4 #define _XOPEN_SOURCE_EXTENDED 1 /* 1 needed for AIX */ #define _XOPEN_VERSION 4 #define _XPG4_2 #ifdef CRYPT_USE_XPG6 # define _XPG6 /* Some Solaris versions require this, some break with this */ #endif #include <unistd.h> #include "mycrypt.h" char *mycrypt(const char *key, const char *salt) { return crypt(key, salt); }
#define _XOPEN_SOURCE 4 #define _XOPEN_SOURCE_EXTENDED 1 /* 1 needed for AIX */ #define _XOPEN_VERSION 4 #define _XPG4_2 #include <unistd.h> #include "mycrypt.h" char *mycrypt(const char *key, const char *salt) { return crypt(key, salt); }
--- +++ @@ -2,6 +2,9 @@ #define _XOPEN_SOURCE_EXTENDED 1 /* 1 needed for AIX */ #define _XOPEN_VERSION 4 #define _XPG4_2 +#ifdef CRYPT_USE_XPG6 +# define _XPG6 /* Some Solaris versions require this, some break with this */ +#endif #include <unistd.h> #include "mycrypt.h"
Add _XPG6 macro if needed..
mit
LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot
fc7e29bc154d67f627274c657b4157132a1503e8
#import <Foundation/Foundation.h> #import <CoreData/CoreData.h> @class FacilitiesLocation; @interface FacilitiesRoom : NSManagedObject { @private } @property (nonatomic, retain) NSString * floor; @property (nonatomic, retain) NSString * number; @property (nonatomic, retain) NSString * building; - (NSString*)displayString; - (NSString*)description; @end
// // FacilitiesRoom.h // MIT Mobile // // Created by Blake Skinner on 5/11/11. // Copyright (c) 2011 MIT. All rights reserved. // #import <Foundation/Foundation.h> #import <CoreData/CoreData.h> @class FacilitiesLocation; @interface FacilitiesRoom : NSManagedObject { @private } @property (nonatomic, retain) NSString * floor; @property (nonatomic, retain) NSString * number; @property (nonatomic, retain) NSString * building; - (NSString*)displayString; - (NSString*)description; @end
--- +++ @@ -1,11 +1,3 @@ -// -// FacilitiesRoom.h -// MIT Mobile -// -// Created by Blake Skinner on 5/11/11. -// Copyright (c) 2011 MIT. All rights reserved. -// - #import <Foundation/Foundation.h> #import <CoreData/CoreData.h>
Remove the templated copyright statement
lgpl-2.1
MIT-Mobile/MIT-Mobile-for-iOS,xNUTs/MIT-Mobile-for-iOS,smartcop/MIT-Mobile-for-iOS,MIT-Mobile/MIT-Mobile-for-iOS,xNUTs/MIT-Mobile-for-iOS,smartcop/MIT-Mobile-for-iOS
9d7dfc15495bd6f005b8ede5b33aa10dfa0a8fce
// Test if PGO sample use passes are invoked. // // Ensure Pass PGOInstrumentationGenPass is invoked. // RUN: %clang_cc1 -O2 -fno-experimental-new-pass-manager -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=LEGACY // RUN: %clang_cc1 -O2 -fexperimental-new-pass-manager -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s -fdebug-pass-manager -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=NEWPM // LEGACY: Remove unused exception handling info // LEGACY: Sample profile pass // NEWPM: SimplifyCFGPass // NEWPM: SampleProfileLoaderPass int func(int a) { return a; }
// Test if PGO sample use passes are invoked. // // Ensure Pass PGOInstrumentationGenPass is invoked. // RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s // CHECK: Remove unused exception handling info // CHECK: Sample profile pass
--- +++ @@ -1,6 +1,13 @@ // Test if PGO sample use passes are invoked. // // Ensure Pass PGOInstrumentationGenPass is invoked. -// RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s -// CHECK: Remove unused exception handling info -// CHECK: Sample profile pass +// RUN: %clang_cc1 -O2 -fno-experimental-new-pass-manager -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=LEGACY +// RUN: %clang_cc1 -O2 -fexperimental-new-pass-manager -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s -fdebug-pass-manager -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=NEWPM + +// LEGACY: Remove unused exception handling info +// LEGACY: Sample profile pass + +// NEWPM: SimplifyCFGPass +// NEWPM: SampleProfileLoaderPass + +int func(int a) { return a; }
[clang][NewPM] Remove exception handling before loading pgo sample profile data This patch ensures that SimplifyCFGPass comes before SampleProfileLoaderPass on PGO runs in the new PM and fixes clang/test/CodeGen/pgo-sample.c. Differential Revision: https://reviews.llvm.org/D63626 git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@364201 91177308-0d34-0410-b5e6-96231b3b80d8
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
557d3de09e89c71aa82403b113bd9b863ae3fb0d
// 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}} }
// 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}} }
--- +++ @@ -1,8 +1,7 @@ // 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. +// 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}}
[analyzer] Fix an outdated comment in a test. NFC. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@314298 91177308-0d34-0410-b5e6-96231b3b80d8 (cherry picked from commit a0d7ea7ad167665974775befd200847e5d84dd02)
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
ca910100761ba025d9b7156d1030184a42bdd486
// // SQRLShipItLauncher.h // Squirrel // // Created by Justin Spahr-Summers on 2013-08-12. // Copyright (c) 2013 GitHub. All rights reserved. // #import <Foundation/Foundation.h> // The domain for errors originating within SQRLShipItLauncher. extern NSString * const SQRLShipItLauncherErrorDomain; // The ShipIt service could not be started. extern const NSInteger SQRLShipItLauncherErrorCouldNotStartService; // Responsible for launching the ShipIt service to actually install an update. @interface SQRLShipItLauncher : NSObject // Attempts to launch the ShipIt service. // // error - If not NULL, set to any error that occurs. // // Returns the XPC connection established, or NULL if an error occurs. The // connection will be automatically released once it has completed or received // an error. Retain the connection if you'll still need it after that point. - (xpc_connection_t)launch:(NSError **)error; @end
// // SQRLShipItLauncher.h // Squirrel // // Created by Justin Spahr-Summers on 2013-08-12. // Copyright (c) 2013 GitHub. All rights reserved. // #import <Foundation/Foundation.h> // The domain for errors originating within SQRLShipItLauncher. extern NSString * const SQRLShipItLauncherErrorDomain; // The ShipIt service could not be started. extern const NSInteger SQRLShipItLauncherErrorCouldNotStartService; // Responsible for launching the ShipIt service to actually install an update. @interface SQRLShipItLauncher : NSObject // Attempts to launch the ShipIt service. // // error - If not NULL, set to any error that occurs. // // Returns the XPC connection established, or NULL if an error occurs. If an // error occurs in the connection, it will be automatically released. Retain it // if you'll still need it after that point. - (xpc_connection_t)launch:(NSError **)error; @end
--- +++ @@ -21,9 +21,9 @@ // // error - If not NULL, set to any error that occurs. // -// Returns the XPC connection established, or NULL if an error occurs. If an -// error occurs in the connection, it will be automatically released. Retain it -// if you'll still need it after that point. +// Returns the XPC connection established, or NULL if an error occurs. The +// connection will be automatically released once it has completed or received +// an error. Retain the connection if you'll still need it after that point. - (xpc_connection_t)launch:(NSError **)error; @end
Clarify XPC connection lifecycle for -launch:
mit
emiscience/Squirrel.Mac,EdZava/Squirrel.Mac,Squirrel/Squirrel.Mac,EdZava/Squirrel.Mac,Squirrel/Squirrel.Mac,emiscience/Squirrel.Mac,EdZava/Squirrel.Mac,emiscience/Squirrel.Mac,Squirrel/Squirrel.Mac
b6d178b4dcb894180356c445b8cde644e7dc4327
#ifndef PERL_MONGO #define PERL_MONGO #include <mongo/client/dbclient.h> extern "C" { #define PERL_GCC_BRACE_GROUPS_FORBIDDEN #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #define PERL_MONGO_CALL_BOOT(name) perl_mongo_call_xs (aTHX_ name, cv, mark) void perl_mongo_call_xs (pTHX_ void (*subaddr) (pTHX_ CV *cv), CV *cv, SV **mark); SV *perl_mongo_call_reader (SV *self, const char *reader); void perl_mongo_attach_ptr_to_instance (SV *self, void *ptr); void *perl_mongo_get_ptr_from_instance (SV *self); SV *perl_mongo_construct_instance (const char *klass, ...); SV *perl_mongo_construct_instance_va (const char *klass, va_list ap); SV *perl_mongo_construct_instance_with_magic (const char *klass, void *ptr, ...); SV *perl_mongo_bson_to_sv (const char *oid_class, mongo::BSONObj obj); mongo::BSONObj perl_mongo_sv_to_bson (SV *sv, const char *oid_class); } #endif
#ifndef PERL_MONGO #define PERL_MONGO #include <mongo/client/dbclient.h> extern "C" { #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #define PERL_MONGO_CALL_BOOT(name) perl_mongo_call_xs (aTHX_ name, cv, mark) void perl_mongo_call_xs (pTHX_ void (*subaddr) (pTHX_ CV *cv), CV *cv, SV **mark); SV *perl_mongo_call_reader (SV *self, const char *reader); void perl_mongo_attach_ptr_to_instance (SV *self, void *ptr); void *perl_mongo_get_ptr_from_instance (SV *self); SV *perl_mongo_construct_instance (const char *klass, ...); SV *perl_mongo_construct_instance_va (const char *klass, va_list ap); SV *perl_mongo_construct_instance_with_magic (const char *klass, void *ptr, ...); SV *perl_mongo_bson_to_sv (const char *oid_class, mongo::BSONObj obj); mongo::BSONObj perl_mongo_sv_to_bson (SV *sv, const char *oid_class); } #endif
--- +++ @@ -4,6 +4,8 @@ #include <mongo/client/dbclient.h> extern "C" { + +#define PERL_GCC_BRACE_GROUPS_FORBIDDEN #include "EXTERN.h" #include "perl.h"
Stop the headers of debugging perls to generate gcc brace groups. Those don't work with g++ easily.
apache-2.0
xdg/mongo-perl-driver,kainwinterheart/mongo-perl-driver,kainwinterheart/mongo-perl-driver,rahuldhodapkar/mongo-perl-driver,kainwinterheart/mongo-perl-driver,gormanb/mongo-perl-driver,dagolden/mongo-perl-driver,gormanb/mongo-perl-driver,jorol/mongo-perl-driver,mongodb/mongo-perl-driver,mongodb/mongo-perl-driver,gormanb/mongo-perl-driver,jorol/mongo-perl-driver,dagolden/mongo-perl-driver,xdg/mongo-perl-driver,gormanb/mongo-perl-driver,dagolden/mongo-perl-driver,rahuldhodapkar/mongo-perl-driver,jorol/mongo-perl-driver,jorol/mongo-perl-driver,rahuldhodapkar/mongo-perl-driver,rahuldhodapkar/mongo-perl-driver,kainwinterheart/mongo-perl-driver,mongodb/mongo-perl-driver,xdg/mongo-perl-driver,dagolden/mongo-perl-driver
fcdccff46beacec0b37271d75f1ced3093a773e2
#ifndef GVKILL_DEBUG_H #define GVKILL_DEBUG_H #include <cstdlib> #include <iostream> // FIXME: These need to be made Windows comptabile #define DEBUG(X) if (getenv("GVKI_DEBUG") != NULL) X #define DEBUG_MSG(X) DEBUG( std::cerr << "\033[32m***GVKI:" << X << "***\033[0m" << std::endl) // FIXME: This belongs in its own header file #define ERROR_MSG(X) std::cerr << "\033[31m**GVKI ERROR:" << X << "***\033\[0m" << std::endl #endif
#ifndef GVKILL_DEBUG_H #define GVKILL_DEBUG_H #include <cstdlib> #include <iostream> // FIXME: These need to be made Windows comptabile #define DEBUG(X) if (getenv("GVKI_DEBUG") != NULL) X #define DEBUG_MSG(X) DEBUG( std::cerr << "\033[32m***GVKILL:" << X << "***\033[0m" << std::endl) // FIXME: This belongs in its own header file #define ERROR_MSG(X) std::cerr << "\033[31m**GVKILL ERROR:" << X << "***\033\[0m" << std::endl #endif
--- +++ @@ -5,9 +5,9 @@ // FIXME: These need to be made Windows comptabile #define DEBUG(X) if (getenv("GVKI_DEBUG") != NULL) X -#define DEBUG_MSG(X) DEBUG( std::cerr << "\033[32m***GVKILL:" << X << "***\033[0m" << std::endl) +#define DEBUG_MSG(X) DEBUG( std::cerr << "\033[32m***GVKI:" << X << "***\033[0m" << std::endl) // FIXME: This belongs in its own header file -#define ERROR_MSG(X) std::cerr << "\033[31m**GVKILL ERROR:" << X << "***\033\[0m" << std::endl +#define ERROR_MSG(X) std::cerr << "\033[31m**GVKI ERROR:" << X << "***\033\[0m" << std::endl #endif
Fix typos in DEBUG_MSG and ERROR_MSG macros
bsd-3-clause
mc-imperial/gvki,mc-imperial/gvki,giuliojiang/gvki,giuliojiang/gvki,mc-imperial/gvki,giuliojiang/gvki
8d0c966cb3b23c9383c76d7bd919fff09702cc31
#ifndef MLPACK_IO_OPTION_IMPL_H #define MLPACK_IO_OPTION_IMPL_H #include "io.h" namespace mlpack { /* * @brief Registers a parameter with IO. * This allows the registration of parameters at program start. */ template<typename N> Option<N>::Option(bool ignoreTemplate, N defaultValue, const char* identifier, const char* description, const char* parent, bool required) { if (ignoreTemplate) IO::Add(identifier, description, parent, required); else { IO::Add<N>(identifier, description, parent, required); // Create the full pathname to set the default value. std::string pathname = IO::SanitizeString(parent) + std::string(identifier); IO::GetParam<N>(pathname.c_str()) = defaultValue; } } /* * @brief Registers a flag parameter with IO. */ template<typename N> Option<N>::Option(const char* identifier, const char* description, const char* parent) { IO::AddFlag(identifier, description, parent); // Set the default value (false). std::string pathname = IO::SanitizeString(parent) + std::string(identifier); IO::GetParam<bool>(pathname.c_str()) = false; } }; // namespace mlpack #endif
#ifndef MLPACK_IO_OPTION_IMPL_H #define MLPACK_IO_OPTION_IMPL_H #include "io.h" namespace mlpack { /* * @brief Registers a parameter with IO. * This allows the registration of parameters at program start. */ template<typename N> Option<N>::Option(bool ignoreTemplate, N defaultValue, const char* identifier, const char* description, const char* parent, bool required) { if (ignoreTemplate) IO::Add(identifier, description, parent, required); else { IO::Add<N>(identifier, description, parent, required); //Create the full pathname. std::string pathname = IO::SanitizeString(parent) + std::string(identifier); IO::GetParam<N>(pathname.c_str()) = defaultValue; } } /* * @brief Registers a flag parameter with IO. */ template<typename N> Option<N>::Option(const char* identifier, const char* description, const char* parent) { IO::AddFlag(identifier, description, parent); } }; // namespace mlpack #endif
--- +++ @@ -21,7 +21,7 @@ else { IO::Add<N>(identifier, description, parent, required); - //Create the full pathname. + // Create the full pathname to set the default value. std::string pathname = IO::SanitizeString(parent) + std::string(identifier); IO::GetParam<N>(pathname.c_str()) = defaultValue; } @@ -36,6 +36,10 @@ const char* description, const char* parent) { IO::AddFlag(identifier, description, parent); + + // Set the default value (false). + std::string pathname = IO::SanitizeString(parent) + std::string(identifier); + IO::GetParam<bool>(pathname.c_str()) = false; } }; // namespace mlpack
Set a default value for boolean options (false).
bsd-3-clause
minhpqn/mlpack,palashahuja/mlpack,Azizou/mlpack,ajjl/mlpack,minhpqn/mlpack,ranjan1990/mlpack,bmswgnp/mlpack,lezorich/mlpack,ranjan1990/mlpack,theranger/mlpack,thirdwing/mlpack,trungda/mlpack,stereomatchingkiss/mlpack,chenmoshushi/mlpack,BookChan/mlpack,darcyliu/mlpack,ersanliqiao/mlpack,stereomatchingkiss/mlpack,datachand/mlpack,thirdwing/mlpack,lezorich/mlpack,bmswgnp/mlpack,stereomatchingkiss/mlpack,bmswgnp/mlpack,datachand/mlpack,theranger/mlpack,trungda/mlpack,erubboli/mlpack,ranjan1990/mlpack,ajjl/mlpack,palashahuja/mlpack,darcyliu/mlpack,ajjl/mlpack,chenmoshushi/mlpack,lezorich/mlpack,datachand/mlpack,BookChan/mlpack,minhpqn/mlpack,chenmoshushi/mlpack,ersanliqiao/mlpack,erubboli/mlpack,theranger/mlpack,BookChan/mlpack,trungda/mlpack,thirdwing/mlpack,palashahuja/mlpack,Azizou/mlpack,ersanliqiao/mlpack,erubboli/mlpack,Azizou/mlpack,darcyliu/mlpack
44dfccfeb025f4eb61c9f31af287c00a46a37a0d
#include <time.h> #include <stdio.h> #define NANO 10000000000 int multiples_three_five(int limit) { long total = 0; for (int i=1; i < limit; i++) total += i % 3 == 0 || i % 5 == 0 ? i : 0; return total; } int main(void) { struct timespec start; clock_gettime(CLOCK_REALTIME, &start); double start_time = ((float) start.tv_sec) + ((float) start.tv_nsec) / NANO; long ans = multiples_three_five(1000); printf ("Answer: %ld\n", ans); struct timespec stop; clock_gettime(CLOCK_REALTIME, &stop); double stop_time = ((float) stop.tv_sec) + ((float) stop.tv_nsec) / NANO; printf ("Time: %.8f\n", stop_time - start_time); return 0; }
#include <stdio.h> #include <time.h> int multiples_three_five(int limit) { long total = 0; int i; for (i=1; i < limit; i++) total += i % 3 == 0 || i % 5 == 0 ? i : 0; return total; } int main(void) { clock_t start, stop; start = clock(); long ans = multiples_three_five(1000); printf ("Answer: %ld\n", ans); stop = clock(); printf ("Time: %f\n", ((float)stop - (float)start) / CLOCKS_PER_SEC); return 0; }
--- +++ @@ -1,28 +1,33 @@ +#include <time.h> #include <stdio.h> -#include <time.h> + +#define NANO 10000000000 int multiples_three_five(int limit) { long total = 0; - int i; - for (i=1; i < limit; i++) + for (int i=1; i < limit; i++) total += i % 3 == 0 || i % 5 == 0 ? i : 0; + return total; } int main(void) { - clock_t start, stop; + struct timespec start; + clock_gettime(CLOCK_REALTIME, &start); + double start_time = ((float) start.tv_sec) + ((float) start.tv_nsec) / NANO; - start = clock(); long ans = multiples_three_five(1000); - printf ("Answer: %ld\n", ans); - stop = clock(); - printf ("Time: %f\n", ((float)stop - (float)start) / CLOCKS_PER_SEC); + struct timespec stop; + clock_gettime(CLOCK_REALTIME, &stop); + double stop_time = ((float) stop.tv_sec) + ((float) stop.tv_nsec) / NANO; + + printf ("Time: %.8f\n", stop_time - start_time); return 0; }
Use WALL time for timer
mit
tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler
4cc26f6ae19b096bae1ec8309671bb415997786c
int asserter_is_false(int); int set_empty(void); int set_size(int); int set_add(int, int); int main(void) { // set_empty tests if (asserter_is_false(set_empty() == 0)) return __LINE__; // set_add tests if (asserter_is_false(set_add(set_empty(), 0) != set_empty())) return __LINE__; if (asserter_is_false(set_add(set_empty(), 1) != set_add(set_empty(), 2))) return __LINE__; if (asserter_is_false(set_add(set_add(set_empty(), 1), 2) != set_add(set_empty(), 2))) return __LINE__; if (asserter_is_false(set_add(set_add(set_empty(), 1), 1) == set_add(set_empty(), 1))) return __LINE__; // TODO: add bigger than sizeof(int) * 8 elements // set_size tests if (asserter_is_false(set_size(set_empty()) == 0)) return __LINE__; if (asserter_is_false(set_size(set_add(set_empty(), 1)) == 1)) return __LINE__; if (asserter_is_false(set_size(set_add(set_add(set_empty(), 1), 2)) == 2)) return __LINE__; // TODO: add more than sizeof(int) * 8 elements return 0; }
int asserter_is_false(int); int set_empty(void); int set_size(int); int set_add(int, int); int main(void) { // set_empty tests if (asserter_is_false(set_empty() == 0)) return __LINE__; // set_add tests if (asserter_is_false(set_add(set_empty(), 0) != set_empty())) return __LINE__; if (asserter_is_false(set_add(set_empty(), 1) != set_add(set_empty(), 2))) return __LINE__; if (asserter_is_false(set_add(set_add(set_empty(), 1), 2) != set_add(set_empty(), 2))) return __LINE__; if (asserter_is_false(set_add(set_add(set_empty(), 1), 1) == set_add(set_empty(), 1))) return __LINE__; // set_size tests if (asserter_is_false(set_size(set_empty()) == 0)) return __LINE__; if (asserter_is_false(set_size(set_add(set_empty(), 1)) == 1)) return __LINE__; if (asserter_is_false(set_size(set_add(set_add(set_empty(), 1), 2)) == 2)) return __LINE__; return 0; }
--- +++ @@ -14,11 +14,13 @@ if (asserter_is_false(set_add(set_empty(), 1) != set_add(set_empty(), 2))) return __LINE__; if (asserter_is_false(set_add(set_add(set_empty(), 1), 2) != set_add(set_empty(), 2))) return __LINE__; if (asserter_is_false(set_add(set_add(set_empty(), 1), 1) == set_add(set_empty(), 1))) return __LINE__; + // TODO: add bigger than sizeof(int) * 8 elements // set_size tests if (asserter_is_false(set_size(set_empty()) == 0)) return __LINE__; if (asserter_is_false(set_size(set_add(set_empty(), 1)) == 1)) return __LINE__; if (asserter_is_false(set_size(set_add(set_add(set_empty(), 1), 2)) == 2)) return __LINE__; + // TODO: add more than sizeof(int) * 8 elements return 0; }
[SET] REFACTOR: Add TODOs for future work
mit
w3ln4/open
c4dc456cdfc6fe4a67f41d2aa02f30bde9968d4c
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ // $Id$ // $MpId: AliMpStationType.h,v 1.5 2005/10/28 15:05:04 ivana Exp $ /// \ingroup basic /// \enum AliMpStationType /// Enumeration for refering to a MUON station /// /// Authors: David Guez, Ivana Hrivnacova; IPN Orsay #ifndef ALI_MP_STATION_TYPE_H #define ALI_MP_STATION_TYPE_H enum AliMpStationType { kStationInvalid = -1,///< invalid station kStation1 = 0, ///< station 1 (quadrants) kStation2, ///< station 2 (quadrants) kStation345, ///< station 3,4,5 (slats) kStationTrigger ///< trigger stations (slats) }; inline const char* StationTypeName(AliMpStationType stationType) { switch ( stationType ) { case kStation1: return "st1"; break; case kStation2: return "st2"; break; case kStation345: return "slat"; break; case kStationTrigger: return "trigger"; break; case kStationInvalid: default: return "invalid"; break; } return "unknown"; } #endif //ALI_MP_STATION_TYPE_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ // $Id$ // $MpId: AliMpStationType.h,v 1.5 2005/10/28 15:05:04 ivana Exp $ /// \ingroup basic /// \enum AliMpStationType /// Enumeration for refering to a MUON station /// /// Authors: David Guez, Ivana Hrivnacova; IPN Orsay #ifndef ALI_MP_STATION_TYPE_H #define ALI_MP_STATION_TYPE_H enum AliMpStationType { kStationInvalid = -1,///< invalid station kStation1 = 0, ///< station 1 (quadrants) kStation2, ///< station 2 (quadrants) kStation345, ///< station 3,4,5 (slats) kStationTrigger ///< trigger stations (slats) }; inline const char* StationTypeName(AliMpStationType stationType) { switch ( stationType ) { case kStation1: return "st1"; break; case kStation2: return "st2"; break; case kStation345: return "slat"; break; case kStationTrigger: return "trigger"; break; case kStationInvalid: default: return "unknown"; break; } } #endif //ALI_MP_STATION_TYPE_H
--- +++ @@ -42,9 +42,10 @@ break; case kStationInvalid: default: - return "unknown"; + return "invalid"; break; } + return "unknown"; } #endif //ALI_MP_STATION_TYPE_H
Fix warning from gcc4 (Laurent)
bsd-3-clause
ALICEHLT/AliRoot,shahor02/AliRoot,sebaleh/AliRoot,ecalvovi/AliRoot,alisw/AliRoot,ecalvovi/AliRoot,mkrzewic/AliRoot,ALICEHLT/AliRoot,miranov25/AliRoot,miranov25/AliRoot,mkrzewic/AliRoot,ecalvovi/AliRoot,jgrosseo/AliRoot,jgrosseo/AliRoot,sebaleh/AliRoot,ecalvovi/AliRoot,ALICEHLT/AliRoot,ALICEHLT/AliRoot,mkrzewic/AliRoot,miranov25/AliRoot,alisw/AliRoot,mkrzewic/AliRoot,miranov25/AliRoot,ALICEHLT/AliRoot,alisw/AliRoot,jgrosseo/AliRoot,coppedis/AliRoot,coppedis/AliRoot,alisw/AliRoot,sebaleh/AliRoot,sebaleh/AliRoot,ecalvovi/AliRoot,coppedis/AliRoot,mkrzewic/AliRoot,sebaleh/AliRoot,sebaleh/AliRoot,miranov25/AliRoot,shahor02/AliRoot,shahor02/AliRoot,miranov25/AliRoot,shahor02/AliRoot,jgrosseo/AliRoot,shahor02/AliRoot,ALICEHLT/AliRoot,ecalvovi/AliRoot,sebaleh/AliRoot,coppedis/AliRoot,shahor02/AliRoot,mkrzewic/AliRoot,miranov25/AliRoot,alisw/AliRoot,coppedis/AliRoot,coppedis/AliRoot,ALICEHLT/AliRoot,alisw/AliRoot,alisw/AliRoot,coppedis/AliRoot,miranov25/AliRoot,jgrosseo/AliRoot,coppedis/AliRoot,shahor02/AliRoot,mkrzewic/AliRoot,jgrosseo/AliRoot,ecalvovi/AliRoot,alisw/AliRoot,jgrosseo/AliRoot
a882990c9d05497540efca385ebb55c200e01e76
#include <hwloc.h> #include <stdio.h> /* The body of the test is in a separate .c file and a separate library, just to ensure that hwloc didn't force compilation with visibility flags enabled. */ int do_test(void) { mytest_hwloc_topology_t topology; unsigned depth; hwloc_bitmap_t cpu_set; /* Just call a bunch of functions to see if we can link and run */ printf("*** Test 1: bitmap alloc\n"); cpu_set = mytest_hwloc_bitmap_alloc(); if (NULL == cpu_set) return 1; printf("*** Test 2: topology init\n"); if (0 != mytest_hwloc_topology_init(&topology)) return 1; printf("*** Test 3: topology load\n"); if (0 != mytest_hwloc_topology_load(topology)) return 1; printf("*** Test 4: topology get depth\n"); depth = mytest_hwloc_topology_get_depth(topology); if (depth < 0) return 1; printf(" Max depth: %u\n", depth); printf("*** Test 5: topology destroy\n"); mytest_hwloc_topology_destroy(topology); printf("*** Test 6: bitmap free\n"); mytest_hwloc_bitmap_free(cpu_set); return 0; }
#include <hwloc.h> #include <stdio.h> /* The body of the test is in a separate .c file and a separate library, just to ensure that hwloc didn't force compilation with visibility flags enabled. */ int do_test(void) { mytest_hwloc_topology_t topology; unsigned depth; hwloc_cpuset_t cpu_set; /* Just call a bunch of functions to see if we can link and run */ printf("*** Test 1: cpuset alloc\n"); cpu_set = mytest_hwloc_cpuset_alloc(); if (NULL == cpu_set) return 1; printf("*** Test 2: topology init\n"); if (0 != mytest_hwloc_topology_init(&topology)) return 1; printf("*** Test 3: topology load\n"); if (0 != mytest_hwloc_topology_load(topology)) return 1; printf("*** Test 4: topology get depth\n"); depth = mytest_hwloc_topology_get_depth(topology); if (depth < 0) return 1; printf(" Max depth: %u\n", depth); printf("*** Test 5: topology destroy\n"); mytest_hwloc_topology_destroy(topology); printf("*** Test 6: cpuset free\n"); mytest_hwloc_cpuset_free(cpu_set); return 0; }
--- +++ @@ -9,12 +9,12 @@ { mytest_hwloc_topology_t topology; unsigned depth; - hwloc_cpuset_t cpu_set; + hwloc_bitmap_t cpu_set; /* Just call a bunch of functions to see if we can link and run */ - printf("*** Test 1: cpuset alloc\n"); - cpu_set = mytest_hwloc_cpuset_alloc(); + printf("*** Test 1: bitmap alloc\n"); + cpu_set = mytest_hwloc_bitmap_alloc(); if (NULL == cpu_set) return 1; printf("*** Test 2: topology init\n"); if (0 != mytest_hwloc_topology_init(&topology)) return 1; @@ -26,8 +26,8 @@ printf(" Max depth: %u\n", depth); printf("*** Test 5: topology destroy\n"); mytest_hwloc_topology_destroy(topology); - printf("*** Test 6: cpuset free\n"); - mytest_hwloc_cpuset_free(cpu_set); + printf("*** Test 6: bitmap free\n"); + mytest_hwloc_bitmap_free(cpu_set); return 0; }
Convert the embedded test to the bitmap API git-svn-id: bb34cd5123d2f821b9f934b050c449c8bfd5d5c1@2512 4b44e086-7f34-40ce-a3bd-00e031736276
bsd-3-clause
BlueBrain/hwloc,BlueBrain/hwloc,BlueBrain/hwloc,BlueBrain/hwloc
f55af7c049c00c39aecc38572ab18b7f11d88d40
// @(#)root/treeplayer:$Id$ // Author: Philippe Canal 01/06/2004 /************************************************************************* * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers and al. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TFriendProxy #define ROOT_TFriendProxy #include "TBranchProxyDirector.h" class TTree; namespace ROOT { namespace Internal { class TFriendProxy { protected: TBranchProxyDirector fDirector; // contain pointer to TTree and entry to be read Int_t fIndex; // Index of this tree in the list of friends public: TFriendProxy(); TFriendProxy(TBranchProxyDirector *director, TTree *main, Int_t index); TBranchProxyDirector *GetDirector() { return &fDirector; } Long64_t GetReadEntry() const; void ResetReadEntry(); void Update(TTree *newmain); }; } // namespace Internal } // namespace ROOT #endif
// @(#)root/treeplayer:$Id$ // Author: Philippe Canal 01/06/2004 /************************************************************************* * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers and al. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TFriendProxy #define ROOT_TFriendProxy #include "TBranchProxyDirector.h" class TTree; namespace ROOT { namespace Internal { class TFriendProxy { protected: TBranchProxyDirector fDirector; // contain pointer to TTree and entry to be read Int_t fIndex; // Index of this tree in the list of friends public: TFriendProxy(); TFriendProxy(TBranchProxyDirector *director, TTree *main, Int_t index); Long64_t GetReadEntry() const; void ResetReadEntry(); void Update(TTree *newmain); }; } // namespace Internal } // namespace ROOT #endif
--- +++ @@ -28,6 +28,8 @@ TFriendProxy(); TFriendProxy(TBranchProxyDirector *director, TTree *main, Int_t index); + TBranchProxyDirector *GetDirector() { return &fDirector; } + Long64_t GetReadEntry() const; void ResetReadEntry(); void Update(TTree *newmain);
Add accessor to Director of a FriendProxy
lgpl-2.1
root-mirror/root,olifre/root,olifre/root,olifre/root,root-mirror/root,karies/root,olifre/root,root-mirror/root,olifre/root,karies/root,karies/root,karies/root,olifre/root,root-mirror/root,olifre/root,karies/root,root-mirror/root,karies/root,olifre/root,karies/root,karies/root,root-mirror/root,root-mirror/root,olifre/root,root-mirror/root,olifre/root,karies/root,root-mirror/root,karies/root,karies/root,root-mirror/root,olifre/root,root-mirror/root
9710c394fb7c54d91aa9929f9530a9fa78cab8de
int puts(const char *); int noop(void); int foo(char *list[5]) { puts(list[0]); puts(list[1]); return sizeof(list[6]); } int prints(int n, ...) { return n; } char s1[] = "Hello"; char *s2 = "World"; int main() { int size = 0; char *words[2]; words[0] = s1; words[1] = s2; size = foo(words); size = size + sizeof(words); size = size + prints(2, "hei", "hoi"); return size; }
int puts(const char *); int noop(void); int foo(char *list[5]) { puts(list[0]); puts(list[1]); return sizeof(list); } int prints(int n, ...) { return n; } char s1[] = "Hello"; char *s2 = "World"; int main() { int size = 0; char *words[2]; words[0] = s1; words[1] = s2; size = foo(words); size = size + sizeof(words); size = size + prints(2, "hei", "hoi"); return size; }
--- +++ @@ -5,7 +5,7 @@ int foo(char *list[5]) { puts(list[0]); puts(list[1]); - return sizeof(list); + return sizeof(list[6]); } int prints(int n, ...) {
Change test to get rid of gcc warning
mit
larmel/lacc,larmel/c-compiler,larmel/c-compiler,larmel/lacc,larmel/c-compiler
1560265b11bb4b4d20d5f566330060f5f8504b04
#ifndef ZOMBIE_STATE_H #define ZOMBIE_STATE_H #include "box2ddef.h" namespace zombie { struct State { Position position_; Velocity velocity_; float angle_; float anglularVelocity_; }; } #endif
#ifndef ZOMBIE_STATE_H #define ZOMBIE_STATE_H #include "box2ddef.h" namespace zombie { struct State { Position position_{0, 0}; Velocity velocity_{0, 0}; float angle_{0.f}; float anglularVelocity_{0.f}; }; } #endif
--- +++ @@ -6,10 +6,10 @@ namespace zombie { struct State { - Position position_{0, 0}; - Velocity velocity_{0, 0}; - float angle_{0.f}; - float anglularVelocity_{0.f}; + Position position_; + Velocity velocity_; + float angle_; + float anglularVelocity_; }; }
Make State struct a clean POD strcut
mit
mwthinker/Zombie
530e6a93a7a953a460502a28a6733d889a245da0
#ifndef __LWP_CONFIG_H #define __LWP_CONFIG_H #include <stdint.h> #include <stdbool.h> typedef enum{ CFLAG_NWKSKEY = (1<<0), CFLAG_APPSKEY = (1<<1), CFLAG_APPKEY = (1<<2), CFLAG_JOINR = (1<<3), CFLAG_JOINA = (1<<4), }config_flag_t; typedef struct message{ uint8_t *buf; int16_t len; struct message *next; }message_t; typedef struct motes_abp{ uint8_t band; uint8_t devaddr[4]; uint8_t nwkskey[16]; uint8_t appskey[16]; struct message *next; }motes_abp_t; typedef struct motes_abp{ uint8_t band; uint8_t devaddr[4]; uint8_t nwkskey[16]; uint8_t appskey[16]; struct message *next; }motes_abp_t; typedef struct{ uint32_t flag; uint8_t nwkskey[16]; uint8_t appskey[16]; uint8_t appkey[16]; uint8_t band; bool joinkey; uint8_t *joinr; uint8_t joinr_size; uint8_t *joina; uint8_t joina_size; message_t *message; message_t *maccmd; }config_t; int config_parse(const char *file, config_t *config); void config_free(config_t *config); #endif // __CONFIG_H
#ifndef __LWP_CONFIG_H #define __LWP_CONFIG_H #include <stdint.h> #include <stdbool.h> typedef enum{ CFLAG_NWKSKEY = (1<<0), CFLAG_APPSKEY = (1<<1), CFLAG_APPKEY = (1<<2), CFLAG_JOINR = (1<<3), CFLAG_JOINA = (1<<4), }config_flag_t; typedef struct message{ uint8_t *buf; int16_t len; struct message *next; }message_t; typedef struct{ uint32_t flag; uint8_t nwkskey[16]; uint8_t appskey[16]; uint8_t appkey[16]; uint8_t band; bool joinkey; uint8_t *joinr; uint8_t joinr_size; uint8_t *joina; uint8_t joina_size; message_t *message; message_t *maccmd; }config_t; int config_parse(const char *file, config_t *config); void config_free(config_t *config); #endif // __CONFIG_H
--- +++ @@ -17,6 +17,22 @@ int16_t len; struct message *next; }message_t; + +typedef struct motes_abp{ + uint8_t band; + uint8_t devaddr[4]; + uint8_t nwkskey[16]; + uint8_t appskey[16]; + struct message *next; +}motes_abp_t; + +typedef struct motes_abp{ + uint8_t band; + uint8_t devaddr[4]; + uint8_t nwkskey[16]; + uint8_t appskey[16]; + struct message *next; +}motes_abp_t; typedef struct{ uint32_t flag;
Add motes_abp and motes_otaa link list structure definition.
mit
JiapengLi/lorawan-parser,JiapengLi/lorawan-parser
3ea520fdbc396ba8d1b859b669d8c16ee34820ad
/* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (c) 1994-2004 AT&T Corp. * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Corp. * * * * Information and Software Systems Research * * AT&T Research, Florham Park NJ * **********************************************************/ #ifndef TOPVIEWSETTINGS_H #define TOPVIEWSETTINGS_H #include "smyrnadefs.h" _BB void on_settingsOKBtn_clicked(GtkWidget * widget, gpointer user_data); _BB void on_settingsCancelBtn_clicked(GtkWidget * widget, gpointer user_data); extern int load_settings_from_graph(Agraph_t * g); extern int update_graph_from_settings(Agraph_t * g); extern int show_settings_form(); #endif
#ifndef TOPVIEWSETTINGS_H #define TOPVIEWSETTINGS_H #include "smyrnadefs.h" _BB void on_settingsOKBtn_clicked (GtkWidget *widget,gpointer user_data); _BB void on_settingsCancelBtn_clicked (GtkWidget *widget,gpointer user_data); int load_settings_from_graph(Agraph_t *g); int update_graph_from_settings(Agraph_t *g); int show_settings_form(); #endif
--- +++ @@ -1,17 +1,28 @@ +/* vim:set shiftwidth=4 ts=8: */ + +/********************************************************** +* This software is part of the graphviz package * +* http://www.graphviz.org/ * +* * +* Copyright (c) 1994-2004 AT&T Corp. * +* and is licensed under the * +* Common Public License, Version 1.0 * +* by AT&T Corp. * +* * +* Information and Software Systems Research * +* AT&T Research, Florham Park NJ * +**********************************************************/ + #ifndef TOPVIEWSETTINGS_H #define TOPVIEWSETTINGS_H - #include "smyrnadefs.h" - -_BB void on_settingsOKBtn_clicked (GtkWidget *widget,gpointer user_data); -_BB void on_settingsCancelBtn_clicked (GtkWidget *widget,gpointer user_data); -int load_settings_from_graph(Agraph_t *g); -int update_graph_from_settings(Agraph_t *g); -int show_settings_form(); - - - +_BB void on_settingsOKBtn_clicked(GtkWidget * widget, gpointer user_data); +_BB void on_settingsCancelBtn_clicked(GtkWidget * widget, + gpointer user_data); +extern int load_settings_from_graph(Agraph_t * g); +extern int update_graph_from_settings(Agraph_t * g); +extern int show_settings_form(); #endif
Clean up smyrna files: remove unnecessary globals modify libraries not to rely on code in cmd/smyrna remove static declarations from .h files remove unnecessary libraries mark unused code and clean up warnings
epl-1.0
pixelglow/graphviz,BMJHayward/graphviz,ellson/graphviz,pixelglow/graphviz,pixelglow/graphviz,kbrock/graphviz,ellson/graphviz,ellson/graphviz,ellson/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,jho1965us/graphviz,jho1965us/graphviz,pixelglow/graphviz,ellson/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,kbrock/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,tkelman/graphviz,kbrock/graphviz,tkelman/graphviz,kbrock/graphviz,MjAbuz/graphviz,pixelglow/graphviz,tkelman/graphviz,kbrock/graphviz,jho1965us/graphviz,ellson/graphviz,kbrock/graphviz,BMJHayward/graphviz,kbrock/graphviz,pixelglow/graphviz,jho1965us/graphviz,ellson/graphviz,MjAbuz/graphviz,ellson/graphviz,kbrock/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,ellson/graphviz,BMJHayward/graphviz,jho1965us/graphviz,pixelglow/graphviz,ellson/graphviz,tkelman/graphviz,jho1965us/graphviz,tkelman/graphviz,jho1965us/graphviz,jho1965us/graphviz,jho1965us/graphviz,tkelman/graphviz,kbrock/graphviz,MjAbuz/graphviz,tkelman/graphviz,tkelman/graphviz,jho1965us/graphviz,MjAbuz/graphviz,ellson/graphviz,pixelglow/graphviz,pixelglow/graphviz,MjAbuz/graphviz,jho1965us/graphviz,tkelman/graphviz,kbrock/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,tkelman/graphviz,kbrock/graphviz,tkelman/graphviz,pixelglow/graphviz,pixelglow/graphviz,MjAbuz/graphviz,MjAbuz/graphviz
7283c0eb982a87ac5afe2897a78f470e078c1e24