commit
stringlengths
40
40
old_file
stringlengths
4
237
new_file
stringlengths
4
237
old_contents
stringlengths
1
4.24k
new_contents
stringlengths
1
4.87k
subject
stringlengths
15
778
message
stringlengths
15
8.75k
lang
stringclasses
266 values
license
stringclasses
13 values
repos
stringlengths
5
127k
60890cc60ccfc7000791a47f1f3d69fdb8884dd7
compat/win32mmap.c
compat/win32mmap.c
#include "../git-compat-util.h" void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) { HANDLE hmap; void *temp; size_t len; struct stat st; uint64_t o = offset; uint32_t l = o & 0xFFFFFFFF; uint32_t h = (o >> 32) & 0xFFFFFFFF; if (!fstat(fd, &st)) len = xsize_t(st.st_size); else die("mmap: could not determine filesize"); if ((length + offset) > len) length = len - offset; if (!(flags & MAP_PRIVATE)) die("Invalid usage of mmap when built with USE_WIN32_MMAP"); hmap = CreateFileMapping((HANDLE)_get_osfhandle(fd), 0, PAGE_WRITECOPY, 0, 0, 0); if (!hmap) return MAP_FAILED; temp = MapViewOfFileEx(hmap, FILE_MAP_COPY, h, l, length, start); if (!CloseHandle(hmap)) warning("unable to close file mapping handle\n"); return temp ? temp : MAP_FAILED; } int git_munmap(void *start, size_t length) { return !UnmapViewOfFile(start); }
#include "../git-compat-util.h" void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) { HANDLE hmap; void *temp; off_t len; struct stat st; uint64_t o = offset; uint32_t l = o & 0xFFFFFFFF; uint32_t h = (o >> 32) & 0xFFFFFFFF; if (!fstat(fd, &st)) len = st.st_size; else die("mmap: could not determine filesize"); if ((length + offset) > len) length = xsize_t(len - offset); if (!(flags & MAP_PRIVATE)) die("Invalid usage of mmap when built with USE_WIN32_MMAP"); hmap = CreateFileMapping((HANDLE)_get_osfhandle(fd), 0, PAGE_WRITECOPY, 0, 0, 0); if (!hmap) return MAP_FAILED; temp = MapViewOfFileEx(hmap, FILE_MAP_COPY, h, l, length, start); if (!CloseHandle(hmap)) warning("unable to close file mapping handle\n"); return temp ? temp : MAP_FAILED; } int git_munmap(void *start, size_t length) { return !UnmapViewOfFile(start); }
Fix "Out of memory? mmap failed" for files larger than 4GB on Windows
Fix "Out of memory? mmap failed" for files larger than 4GB on Windows The git_mmap implementation was broken for file sizes that wouldn't fit into a size_t (32 bits). This was caused by intermediate variables that were only 32 bits wide when they should be 64 bits. Signed-off-by: Johannes Sixt <fd432345609ae4d58c1aa629cb66ba96d1391622@kdbg.org> Signed-off-by: Junio C Hamano <a6723cc3f76163bf7adb636a73ac3b0ceb3e6b9b@pobox.com>
C
mit
destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git
2964992cd8409df9870b8c38e95261c56b58145b
src/appjs_window.h
src/appjs_window.h
#ifndef APPJS_WINDOW_H #define APPJS_WINDOW_H #pragma once #include "appjs.h" // GTK+ binding for linux #if defined(__LINUX__) #include "linux/mainwindow.h" #endif /* end of linux */ // GTK+ binding for linux #if defined(__WIN__) #include "linux/mainwindow.h" #endif /* end of linux */ namespace appjs { using namespace v8; class Window : public node::ObjectWrap { DECLARE_NODE_OBJECT_FACTORY(Window); DEFINE_CPP_METHOD(Show); DEFINE_CPP_METHOD(Hide); }; } /* appjs */ #endif /* end of APPJS_WINDOW_H */
#ifndef APPJS_WINDOW_H #define APPJS_WINDOW_H #pragma once #include "appjs.h" // GTK+ binding for linux #if defined(__LINUX__) #include "linux/mainwindow.h" #endif /* end of linux */ // Windows necessary files #if defined(__WIN__) #include "windows/mainwindow.h" #endif /* end of windows */ namespace appjs { using namespace v8; class Window : public node::ObjectWrap { DECLARE_NODE_OBJECT_FACTORY(Window); DEFINE_CPP_METHOD(Show); DEFINE_CPP_METHOD(Hide); }; } /* appjs */ #endif /* end of APPJS_WINDOW_H */
Copy paste always introduce bugs:|
Copy paste always introduce bugs:|
C
mit
milani/appjs,appjs/appjs,milani/appjs,modulexcite/appjs,imshibaji/appjs,SaravananRajaraman/appjs,yuhangwang/appjs,eric-seekas/appjs,tempbottle/appjs,imshibaji/appjs,imshibaji/appjs,SaravananRajaraman/appjs,modulexcite/appjs,yuhangwang/appjs,tempbottle/appjs,reekoheek/appjs,SaravananRajaraman/appjs,yuhangwang/appjs,modulexcite/appjs,reekoheek/appjs,appjs/appjs,eric-seekas/appjs,milani/appjs,modulexcite/appjs,appjs/appjs,eric-seekas/appjs,tempbottle/appjs,tempbottle/appjs,SaravananRajaraman/appjs,SaravananRajaraman/appjs,reekoheek/appjs,yuhangwang/appjs,imshibaji/appjs,appjs/appjs,eric-seekas/appjs,SaravananRajaraman/appjs
06d59e057530edb17d4532fb92bdbf7599c98339
Firmware/Src/board_id.c
Firmware/Src/board_id.c
#include "board_id.h" //FIXME rm #include "iprintf.h" #include <stdint.h> /** * Returns an approximate GUID (in STM32 land) based on a bunch of fabrication-related metadata. * * See Technical Reference Manual pg933 ("Unique device ID register") for address and explanation. * First 32 bits are wafer X Y coordinates in BCD * Next 8 are wafer number * Next 56 are lot number in ASCII */ #define UNIQUE_ID_REG_ADDR 0x1FFFF7AC #define UNIQUE_ID_REG_GET8(x) ((x >= 0 && x < 12) ? (*(uint8_t *) (UNIQUE_ID_REG_ADDR + (x))) : 0) uint32_t bid_GetID(void) { int i; for(i = 0; i < 12; i++) { //FIXME rm printing iprintf("ID #%d - 0x%x (%c)\n", i, UNIQUE_ID_REG_GET8(i), UNIQUE_ID_REG_GET8(i)); } //use ASCII lot number as u32 board ID return UNIQUE_ID_REG_GET8( 8) << 0 | UNIQUE_ID_REG_GET8( 9) << 8 | UNIQUE_ID_REG_GET8(10) << 16| UNIQUE_ID_REG_GET8(11) << 24; }
#include "board_id.h" //FIXME rm #include "iprintf.h" #include <stdint.h> /** * Returns an approximate GUID (in STM32 land) based on a bunch of fabrication-related metadata. * * See Technical Reference Manual pg933 ("Unique device ID register") for address and explanation. * First 32 bits are wafer X Y coordinates in BCD * Next 8 are wafer number * Next 56 are lot number in ASCII */ #define UNIQUE_ID_REG_ADDR 0x1FFFF7AC #define UNIQUE_ID_REG_GET8(x) ((x >= 0 && x < 12) ? (*(uint8_t *) (UNIQUE_ID_REG_ADDR + (x))) : 0) uint32_t bid_GetID(void) { int i; for(i = 0; i < 12; i++) { //FIXME rm printing iprintf("ID #%d - 0x%x (%c)\n", i, UNIQUE_ID_REG_GET8(i), UNIQUE_ID_REG_GET8(i)); } // use wafer X/Y for ID. The tray I got all has the same lot number return UNIQUE_ID_REG_GET8(0) << 0 | UNIQUE_ID_REG_GET8(1) << 8 | UNIQUE_ID_REG_GET8(2) << 16| UNIQUE_ID_REG_GET8(3) << 24; }
Switch to wafer X/Y for board ID
Switch to wafer X/Y for board ID
C
mit
borgel/sympetrum-v2,borgel/sympetrum-v2
a68fe89852145287bff6727effe9a7e7b680c017
framework/include/base/MeshChangedInterface.h
framework/include/base/MeshChangedInterface.h
/****************************************************************/ /* DO NOT MODIFY THIS HEADER */ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* (c) 2010 Battelle Energy Alliance, LLC */ /* ALL RIGHTS RESERVED */ /* */ /* Prepared by Battelle Energy Alliance, LLC */ /* Under Contract No. DE-AC07-05ID14517 */ /* With the U. S. Department of Energy */ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ #ifndef MESHCHANGEDINTERFACE_H #define MESHCHANGEDINTERFACE_H #include "InputParameters.h" #include "ExecStore.h" #include "MooseEnum.h" // Forward declarations class MeshChangedInterface; template <> InputParameters validParams<MeshChangedInterface>(); /** * Interface for notifications that the mesh has changed. */ class MeshChangedInterface { public: MeshChangedInterface(const InputParameters & params); virtual ~MeshChangedInterface() = default; /** * Called on this object when the mesh changes */ virtual void meshChanged() {} protected: /// Reference to FEProblemBase instance FEProblemBase & _mci_feproblem; }; #endif /* MESHCHANGEDINTERFACE_H */
/****************************************************************/ /* DO NOT MODIFY THIS HEADER */ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* (c) 2010 Battelle Energy Alliance, LLC */ /* ALL RIGHTS RESERVED */ /* */ /* Prepared by Battelle Energy Alliance, LLC */ /* Under Contract No. DE-AC07-05ID14517 */ /* With the U. S. Department of Energy */ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ #ifndef MESHCHANGEDINTERFACE_H #define MESHCHANGEDINTERFACE_H #include "MooseEnum.h" // Forward declarations class FEProblemBase; class InputParameters; class MeshChangedInterface; template <typename T> InputParameters validParams(); template <> InputParameters validParams<MeshChangedInterface>(); /** * Interface for notifications that the mesh has changed. */ class MeshChangedInterface { public: MeshChangedInterface(const InputParameters & params); virtual ~MeshChangedInterface() = default; /** * Called on this object when the mesh changes */ virtual void meshChanged() {} protected: /// Reference to FEProblemBase instance FEProblemBase & _mci_feproblem; }; #endif /* MESHCHANGEDINTERFACE_H */
Remove unused header, switch header to fwd decl
Remove unused header, switch header to fwd decl
C
lgpl-2.1
bwspenc/moose,SudiptaBiswas/moose,dschwen/moose,laagesen/moose,dschwen/moose,yipenggao/moose,idaholab/moose,idaholab/moose,andrsd/moose,harterj/moose,bwspenc/moose,andrsd/moose,jessecarterMOOSE/moose,idaholab/moose,dschwen/moose,idaholab/moose,laagesen/moose,Chuban/moose,lindsayad/moose,lindsayad/moose,bwspenc/moose,YaqiWang/moose,permcody/moose,liuwenf/moose,dschwen/moose,nuclear-wizard/moose,sapitts/moose,YaqiWang/moose,milljm/moose,yipenggao/moose,sapitts/moose,jessecarterMOOSE/moose,milljm/moose,friedmud/moose,Chuban/moose,nuclear-wizard/moose,nuclear-wizard/moose,lindsayad/moose,friedmud/moose,idaholab/moose,sapitts/moose,dschwen/moose,yipenggao/moose,sapitts/moose,YaqiWang/moose,jessecarterMOOSE/moose,sapitts/moose,milljm/moose,harterj/moose,jessecarterMOOSE/moose,friedmud/moose,jessecarterMOOSE/moose,permcody/moose,SudiptaBiswas/moose,harterj/moose,andrsd/moose,laagesen/moose,permcody/moose,SudiptaBiswas/moose,SudiptaBiswas/moose,permcody/moose,lindsayad/moose,milljm/moose,SudiptaBiswas/moose,liuwenf/moose,andrsd/moose,bwspenc/moose,liuwenf/moose,Chuban/moose,liuwenf/moose,liuwenf/moose,yipenggao/moose,YaqiWang/moose,friedmud/moose,lindsayad/moose,laagesen/moose,Chuban/moose,harterj/moose,bwspenc/moose,milljm/moose,nuclear-wizard/moose,harterj/moose,andrsd/moose,liuwenf/moose,laagesen/moose
a3c982089a1443e909ebf8d6cf9be88f23c1f452
libutils/include/utils/assume.h
libutils/include/utils/assume.h
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #ifndef _UTILS_ASSUME_H #define _UTILS_ASSUME_H #include <utils/builtin.h> /* This idiom is a way of passing extra information or hints to GCC. It is only * occasionally successful, so don't think of it as a silver optimisation * bullet. */ #define ASSUME(x) \ do { \ if (!(x)) { \ __builtin_unreachable(); \ } \ } while (0) #endif
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #ifndef _UTILS_ASSUME_H #define _UTILS_ASSUME_H #include <utils/attribute.h> #include <utils/builtin.h> #include <utils/stringify.h> /* This idiom is a way of passing extra information or hints to GCC. It is only * occasionally successful, so don't think of it as a silver optimisation * bullet. */ #define ASSUME(x) \ do { \ if (!(x)) { \ __builtin_unreachable(); \ } \ } while (0) /* Indicate to the compiler that wherever this macro appears is a cold * execution path. That is, it is not performance critical and likely rarely * used. A perfect example is error handling code. This gives the compiler a * light hint to deprioritise optimisation of this path. */ #define COLD_PATH() \ do { \ JOIN(cold_path_, __COUNTER__): COLD UNUSED; \ } while (0) /* The opposite of `COLD_PATH`. That is, aggressively optimise this path, * potentially at the expense of others. */ #define HOT_PATH() \ do { \ JOIN(hot_path_, __COUNTER__): HOT UNUSED; \ } while (0) #endif
Add dedicated macros to indicate hot and cold execution paths.
libutils: Add dedicated macros to indicate hot and cold execution paths.
C
bsd-2-clause
agacek/util_libs,agacek/util_libs,agacek/util_libs,agacek/util_libs
a69d4d917316e4123ec6510845d21ae53b3ecf45
src/config.h
src/config.h
//===----------------------------- config.h -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // // // Defines macros used within the libc++abi project. // //===----------------------------------------------------------------------===// #ifndef LIBCXXABI_CONFIG_H #define LIBCXXABI_CONFIG_H #include <unistd.h> #if defined(_POSIX_THREADS) && _POSIX_THREADS > 0 # define LIBCXXABI_SINGLE_THREADED 0 #else # define LIBCXXABI_SINGLE_THREADED 1 #endif // Set this in the CXXFLAGS when you need it, because otherwise we'd have to // #if !defined(__linux__) && !defined(__APPLE__) && ... // and so-on for *every* platform. #ifndef LIBCXXABI_BAREMETAL # define LIBCXXABI_BAREMETAL 0 #endif #endif // LIBCXXABI_CONFIG_H
//===----------------------------- config.h -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // // // Defines macros used within the libc++abi project. // //===----------------------------------------------------------------------===// #ifndef LIBCXXABI_CONFIG_H #define LIBCXXABI_CONFIG_H #include <unistd.h> #if !defined(LIBCXXABI_SINGLE_THREADED) && \ defined(_POSIX_THREADS) && _POSIX_THREADS > 0 # define LIBCXXABI_SINGLE_THREADED 0 #else # define LIBCXXABI_SINGLE_THREADED 1 #endif // Set this in the CXXFLAGS when you need it, because otherwise we'd have to // #if !defined(__linux__) && !defined(__APPLE__) && ... // and so-on for *every* platform. #ifndef LIBCXXABI_BAREMETAL # define LIBCXXABI_BAREMETAL 0 #endif #endif // LIBCXXABI_CONFIG_H
Allow LIBCXXABI_SINGLE_THREADED to be defined by build scripts
Allow LIBCXXABI_SINGLE_THREADED to be defined by build scripts git-svn-id: 6a9f6578bdee8d959f0ed58970538b4ab6004734@216952 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/libcxxabi,llvm-mirror/libcxxabi,llvm-mirror/libcxxabi,llvm-mirror/libcxxabi,llvm-mirror/libcxxabi
2de28b4ab779c0d530f4381ebc5dd48ed2ebc29b
android/jni/InteriorsExplorer/View/InteriorStreamingDialogView.h
android/jni/InteriorsExplorer/View/InteriorStreamingDialogView.h
// Copyright eeGeo Ltd (2012-2015), All Rights Reserved #pragma once #include "IInteriorStreamingDialogView.h" #include "InteriorsExplorerViewIncludes.h" #include "AndroidNativeState.h" namespace ExampleApp { namespace InteriorsExplorer { namespace View { class InteriorStreamingDialogView : public IInteriorStreamingDialogView { public: AndroidNativeState& m_nativeState; jclass m_uiViewClass; jobject m_uiView; InteriorStreamingDialogView(AndroidNativeState& nativeState); ~InteriorStreamingDialogView(); void Show(); void Hide(bool interiorLoaded); }; } } }
// Copyright eeGeo Ltd (2012-2015), All Rights Reserved #pragma once #include "IInteriorStreamingDialogView.h" #include "InteriorsExplorerViewIncludes.h" #include "AndroidNativeState.h" namespace ExampleApp { namespace InteriorsExplorer { namespace View { class InteriorStreamingDialogView : public IInteriorStreamingDialogView { public: InteriorStreamingDialogView(AndroidNativeState& nativeState); ~InteriorStreamingDialogView(); void Show(); void Hide(bool interiorLoaded); private: AndroidNativeState& m_nativeState; jclass m_uiViewClass; jobject m_uiView; }; } } }
Fix naming concern from previous commit. Buddy: Sam
Fix naming concern from previous commit. Buddy: Sam
C
bsd-2-clause
wrld3d/wrld-example-app,wrld3d/wrld-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,eegeo/eegeo-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,wrld3d/wrld-example-app
166d113686fd20cd8e0bf6e5b4f2ac92e24765a4
interface/cecp_features.h
interface/cecp_features.h
#ifndef _CECP_FEATURES_H #define _CECP_FEATURES_H #include <stdio.h> /* Features of the Chess Engine Communication Protocol supported by this program */ const char *cecp_features[] = { "done=0", "usermove=1", "time=0", "draw=0", "sigint=0", "analyze=0", "variants=\"\"", "name=0", "nps=0", "debug=1", "smp=1", "done=1", 0 }; #endif
#ifndef _CECP_FEATURES_H #define _CECP_FEATURES_H #include <stdio.h> /* Features of the Chess Engine Communication Protocol supported by this program */ const char *cecp_features[] = { "done=0", "usermove=1", "time=0", "draw=0", "sigint=0", "analyze=0", "variants=\"normal\"", "colors=0", "name=0", "nps=0", "debug=1", "smp=1", "done=1", 0 }; #endif
Support variant 'normal' and don't expect xboard to send colors
Support variant 'normal' and don't expect xboard to send colors
C
mit
gustafullberg/drosophila,gustafullberg/drosophila,gustafullberg/drosophila
d4df4c06fc37543ddb37d47e70fa7a3fd7544212
include/tesseract/platform.h
include/tesseract/platform.h
/////////////////////////////////////////////////////////////////////// // File: platform.h // Description: Place holder // // (C) Copyright 2006, 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 TESSERACT_PLATFORM_H_ #define TESSERACT_PLATFORM_H_ #ifndef TESS_API # if defined(_WIN32) || defined(__CYGWIN__) # if defined(TESS_EXPORTS) # define TESS_API __declspec(dllexport) # elif defined(TESS_IMPORTS) # define TESS_API __declspec(dllimport) # else # define TESS_API # endif # else # if defined(TESS_EXPORTS) || defined(TESS_IMPORTS) # define TESS_API __attribute__((visibility("default"))) # endif # endif #endif #endif // TESSERACT_PLATFORM_H_
/////////////////////////////////////////////////////////////////////// // File: platform.h // Description: Place holder // // (C) Copyright 2006, 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 TESSERACT_PLATFORM_H_ #define TESSERACT_PLATFORM_H_ #ifndef TESS_API # if defined(_WIN32) || defined(__CYGWIN__) # if defined(TESS_EXPORTS) # define TESS_API __declspec(dllexport) # elif defined(TESS_IMPORTS) # define TESS_API __declspec(dllimport) # else # define TESS_API # endif # else # if defined(TESS_EXPORTS) || defined(TESS_IMPORTS) # define TESS_API __attribute__((visibility("default"))) # else # define TESS_API # endif # endif #endif #endif // TESSERACT_PLATFORM_H_
Add missing definition for TESS_API
Add missing definition for TESS_API Signed-off-by: Stefan Weil <8d4c780fcfdc41841e5070f4c43da8958ba6aec0@weilnetz.de>
C
apache-2.0
stweil/tesseract,amitdo/tesseract,UB-Mannheim/tesseract,stweil/tesseract,tesseract-ocr/tesseract,tesseract-ocr/tesseract,UB-Mannheim/tesseract,amitdo/tesseract,tesseract-ocr/tesseract,amitdo/tesseract,amitdo/tesseract,UB-Mannheim/tesseract,tesseract-ocr/tesseract,stweil/tesseract,amitdo/tesseract,stweil/tesseract,UB-Mannheim/tesseract,UB-Mannheim/tesseract,stweil/tesseract,tesseract-ocr/tesseract
fecda7a99c7dc2d44e2652a9158dfa86b997afab
test/ASTMerge/codegen-body.c
test/ASTMerge/codegen-body.c
// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/body1.c // RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/body2.c // RUN: %clang_cc1 -emit-obj -o /dev/null -ast-merge %t.1.ast -ast-merge %t.2.ast %s // expected-no-diagnostics
// XFAIL: hexagon // RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/body1.c // RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/body2.c // RUN: %clang_cc1 -emit-obj -o /dev/null -ast-merge %t.1.ast -ast-merge %t.2.ast %s // expected-no-diagnostics
Revert "[Hexagon] Test passes for hexagon target now that the backend correctly generates relocations."
Revert "[Hexagon] Test passes for hexagon target now that the backend correctly generates relocations." This reverts commit r238754. It depends on r238748, which was reverted. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@238773 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
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,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
915afec8f2eb56ad3fb89cedf8b6b6dda363164a
ui/app_list/app_list_export.h
ui/app_list/app_list_export.h
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_APP_LIST_APP_LIST_EXPORT_H_ #define UI_APP_LIST_APP_LIST_EXPORT_H_ #pragma once // Defines APP_LIST_EXPORT so that functionality implemented by the app_list // module can be exported to consumers. #if defined(COMPONENT_BUILD) #if defined(WIN32) #if defined(APP_LIST_IMPLEMENTATION) #define APP_LIST_EXPORT __declspec(dllexport) #else #define APP_LIST_EXPORT __declspec(dllimport) #endif // defined(APP_LIST_IMPLEMENTATION) #else // defined(WIN32) #define APP_LIST_EXPORT __attribute__((visibility("default"))) #endif #else // defined(COMPONENT_BUILD) #define APP_LIST_EXPORT #endif #endif // UI_APP_LIST_APP_LIST_EXPORT_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_APP_LIST_APP_LIST_EXPORT_H_ #define UI_APP_LIST_APP_LIST_EXPORT_H_ #pragma once // Defines APP_LIST_EXPORT so that functionality implemented by the app_list // module can be exported to consumers. #if defined(COMPONENT_BUILD) #if defined(WIN32) #if defined(APP_LIST_IMPLEMENTATION) #define APP_LIST_EXPORT __declspec(dllexport) #else #define APP_LIST_EXPORT __declspec(dllimport) #endif // defined(APP_LIST_IMPLEMENTATION) #else // defined(WIN32) #if defined(APP_LIST_IMPLEMENTATION) #define APP_LIST_EXPORT __attribute__((visibility("default"))) #else #define APP_LIST_EXPORT #endif #endif #else // defined(COMPONENT_BUILD) #define APP_LIST_EXPORT #endif #endif // UI_APP_LIST_APP_LIST_EXPORT_H_
Change the way _EXPORT macros look, app_list edition
Change the way _EXPORT macros look, app_list edition I missed this in https://chromiumcodereview.appspot.com/10386108/ . Thanks to tfarina for noticing. BUG=90078 TEST=none TBR=ben Review URL: https://chromiumcodereview.appspot.com/10377151 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@137221 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
mogoweb/chromium-crosswalk,hujiajie/pa-chromium,anirudhSK/chromium,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,anirudhSK/chromium,Chilledheart/chromium,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,hujiajie/pa-chromium,keishi/chromium,axinging/chromium-crosswalk,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,ondra-novak/chromium.src,pozdnyakov/chromium-crosswalk,ondra-novak/chromium.src,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,M4sse/chromium.src,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,keishi/chromium,Just-D/chromium-1,zcbenz/cefode-chromium,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,jaruba/chromium.src,ChromiumWebApps/chromium,dednal/chromium.src,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,ChromiumWebApps/chromium,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,junmin-zhu/chromium-rivertrail,Pluto-tv/chromium-crosswalk,ltilve/chromium,zcbenz/cefode-chromium,dednal/chromium.src,Fireblend/chromium-crosswalk,keishi/chromium,jaruba/chromium.src,keishi/chromium,ltilve/chromium,fujunwei/chromium-crosswalk,littlstar/chromium.src,jaruba/chromium.src,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,hujiajie/pa-chromium,dushu1203/chromium.src,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,timopulkkinen/BubbleFish,patrickm/chromium.src,keishi/chromium,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,anirudhSK/chromium,timopulkkinen/BubbleFish,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,M4sse/chromium.src,ondra-novak/chromium.src,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,Pluto-tv/chromium-crosswalk,keishi/chromium,littlstar/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,anirudhSK/chromium,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,timopulkkinen/BubbleFish,Jonekee/chromium.src,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,littlstar/chromium.src,Jonekee/chromium.src,M4sse/chromium.src,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,ltilve/chromium,markYoungH/chromium.src,M4sse/chromium.src,ltilve/chromium,ChromiumWebApps/chromium,junmin-zhu/chromium-rivertrail,junmin-zhu/chromium-rivertrail,chuan9/chromium-crosswalk,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,keishi/chromium,dednal/chromium.src,zcbenz/cefode-chromium,jaruba/chromium.src,bright-sparks/chromium-spacewalk,dednal/chromium.src,patrickm/chromium.src,Fireblend/chromium-crosswalk,markYoungH/chromium.src,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,dednal/chromium.src,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,littlstar/chromium.src,M4sse/chromium.src,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,mogoweb/chromium-crosswalk,anirudhSK/chromium,chuan9/chromium-crosswalk,dednal/chromium.src,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,M4sse/chromium.src,Chilledheart/chromium,axinging/chromium-crosswalk,Just-D/chromium-1,jaruba/chromium.src,ChromiumWebApps/chromium,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,dednal/chromium.src,hujiajie/pa-chromium,patrickm/chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,dushu1203/chromium.src,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,keishi/chromium,krieger-od/nwjs_chromium.src,jaruba/chromium.src,hujiajie/pa-chromium,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,dushu1203/chromium.src,dednal/chromium.src,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,Just-D/chromium-1,littlstar/chromium.src,ondra-novak/chromium.src,timopulkkinen/BubbleFish,M4sse/chromium.src,hgl888/chromium-crosswalk,patrickm/chromium.src,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,bright-sparks/chromium-spacewalk,Chilledheart/chromium,axinging/chromium-crosswalk,Jonekee/chromium.src,littlstar/chromium.src,ltilve/chromium,dushu1203/chromium.src,littlstar/chromium.src,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,ltilve/chromium,nacl-webkit/chrome_deps,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,chuan9/chromium-crosswalk,jaruba/chromium.src,junmin-zhu/chromium-rivertrail,keishi/chromium,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,dednal/chromium.src,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,anirudhSK/chromium,hgl888/chromium-crosswalk-efl,dednal/chromium.src,markYoungH/chromium.src,ondra-novak/chromium.src,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,dednal/chromium.src,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,jaruba/chromium.src,Fireblend/chromium-crosswalk,anirudhSK/chromium,ChromiumWebApps/chromium,ltilve/chromium,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,PeterWangIntel/chromium-crosswalk,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,hujiajie/pa-chromium,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,patrickm/chromium.src,M4sse/chromium.src,Just-D/chromium-1,hujiajie/pa-chromium,nacl-webkit/chrome_deps,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,patrickm/chromium.src,M4sse/chromium.src,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,patrickm/chromium.src,zcbenz/cefode-chromium,zcbenz/cefode-chromium,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,ChromiumWebApps/chromium,Chilledheart/chromium,fujunwei/chromium-crosswalk,junmin-zhu/chromium-rivertrail,hujiajie/pa-chromium,anirudhSK/chromium,fujunwei/chromium-crosswalk,jaruba/chromium.src,ChromiumWebApps/chromium,Jonekee/chromium.src,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,keishi/chromium,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,patrickm/chromium.src,zcbenz/cefode-chromium,nacl-webkit/chrome_deps,Just-D/chromium-1,littlstar/chromium.src,hujiajie/pa-chromium,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,hgl888/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,ondra-novak/chromium.src,markYoungH/chromium.src,pozdnyakov/chromium-crosswalk,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,keishi/chromium,zcbenz/cefode-chromium,Just-D/chromium-1,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk
015f3526ea6d0b24900b72ad01c1abd730555136
tests/mypaint-test-surface.h
tests/mypaint-test-surface.h
#ifndef MYPAINTTESTSURFACE_H #define MYPAINTTESTSURFACE_H #include <mypaint-surface.h> typedef MyPaintSurface * (*MyPaintTestsSurfaceFactory)(gpointer user_data); int mypaint_test_surface_run(int argc, char **argv, MyPaintTestsSurfaceFactory surface_factory, gchar *title, gpointer user_data); #endif // MYPAINTTESTSURFACE_H
#ifndef MYPAINTTESTSURFACE_H #define MYPAINTTESTSURFACE_H #include <mypaint-surface.h> #include <mypaint-glib-compat.h> G_BEGIN_DECLS typedef MyPaintSurface * (*MyPaintTestsSurfaceFactory)(gpointer user_data); int mypaint_test_surface_run(int argc, char **argv, MyPaintTestsSurfaceFactory surface_factory, gchar *title, gpointer user_data); G_END_DECLS #endif // MYPAINTTESTSURFACE_H
Add missing extern "C" declaration to header
brushlib/test: Add missing extern "C" declaration to header
C
isc
b3sigma/libmypaint,achadwick/libmypaint,b3sigma/libmypaint,achadwick/libmypaint,b3sigma/libmypaint,achadwick/libmypaint,achadwick/libmypaint
25355d2169bb43eb07b9a60a2f9e4c0436cf906a
vm/external_libs/libtommath/bn_mp_exch.c
vm/external_libs/libtommath/bn_mp_exch.c
#include <tommath.h> #ifdef BN_MP_EXCH_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * * LibTomMath is a library that provides multiple-precision * integer arithmetic as well as number theoretic functionality. * * The library was designed directly after the MPI library by * Michael Fromberger but has been written from scratch with * additional optimizations in place. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* swap the elements of two integers, for cases where you can't simply swap the * mp_int pointers around */ void mp_exch MPA(mp_int * a, mp_int * b) { mp_int t; if(MANAGED(a) || MANAGED(b)) { mp_init_copy(MPST, &t, a); mp_copy(MPST, a, b); mp_copy(MPST, b, &t); mp_clear(&t); return; } t = *a; *a = *b; *b = t; } #endif /* $Source: /cvs/libtom/libtommath/bn_mp_exch.c,v $ */ /* $Revision: 1.4 $ */ /* $Date: 2006/12/28 01:25:13 $ */
#include <tommath.h> #ifdef BN_MP_EXCH_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * * LibTomMath is a library that provides multiple-precision * integer arithmetic as well as number theoretic functionality. * * The library was designed directly after the MPI library by * Michael Fromberger but has been written from scratch with * additional optimizations in place. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* swap the elements of two integers, for cases where you can't simply swap the * mp_int pointers around */ void mp_exch MPA(mp_int * a, mp_int * b) { mp_int t; if(MANAGED(a) || MANAGED(b)) { mp_init(&t); // copy a to t mp_copy(MPST, a, &t); // copy b to a mp_copy(MPST, b, a); // copy t to b mp_copy(MPST, &t, b); mp_clear(&t); return; } t = *a; *a = *b; *b = t; } #endif /* $Source: /cvs/libtom/libtommath/bn_mp_exch.c,v $ */ /* $Revision: 1.4 $ */ /* $Date: 2006/12/28 01:25:13 $ */
Fix argument order in mp_exch
Fix argument order in mp_exch
C
bsd-3-clause
heftig/rubinius,Wirachmat/rubinius,dblock/rubinius,Azizou/rubinius,heftig/rubinius,Azizou/rubinius,ruipserra/rubinius,travis-repos/rubinius,jemc/rubinius,slawosz/rubinius,Wirachmat/rubinius,slawosz/rubinius,dblock/rubinius,pH14/rubinius,ngpestelos/rubinius,travis-repos/rubinius,benlovell/rubinius,lgierth/rubinius,pH14/rubinius,ngpestelos/rubinius,dblock/rubinius,Wirachmat/rubinius,travis-repos/rubinius,kachick/rubinius,jsyeo/rubinius,digitalextremist/rubinius,heftig/rubinius,sferik/rubinius,heftig/rubinius,slawosz/rubinius,sferik/rubinius,jemc/rubinius,ruipserra/rubinius,sferik/rubinius,jsyeo/rubinius,jemc/rubinius,lgierth/rubinius,digitalextremist/rubinius,jemc/rubinius,slawosz/rubinius,kachick/rubinius,lgierth/rubinius,jsyeo/rubinius,ngpestelos/rubinius,ngpestelos/rubinius,ruipserra/rubinius,ruipserra/rubinius,digitalextremist/rubinius,kachick/rubinius,ngpestelos/rubinius,pH14/rubinius,ruipserra/rubinius,kachick/rubinius,benlovell/rubinius,digitalextremist/rubinius,sferik/rubinius,lgierth/rubinius,lgierth/rubinius,travis-repos/rubinius,jsyeo/rubinius,Azizou/rubinius,jemc/rubinius,Azizou/rubinius,pH14/rubinius,benlovell/rubinius,kachick/rubinius,benlovell/rubinius,Wirachmat/rubinius,travis-repos/rubinius,mlarraz/rubinius,Wirachmat/rubinius,pH14/rubinius,Azizou/rubinius,slawosz/rubinius,mlarraz/rubinius,dblock/rubinius,ruipserra/rubinius,jemc/rubinius,digitalextremist/rubinius,kachick/rubinius,pH14/rubinius,Wirachmat/rubinius,benlovell/rubinius,mlarraz/rubinius,slawosz/rubinius,heftig/rubinius,sferik/rubinius,heftig/rubinius,benlovell/rubinius,lgierth/rubinius,jsyeo/rubinius,dblock/rubinius,jsyeo/rubinius,kachick/rubinius,travis-repos/rubinius,ngpestelos/rubinius,sferik/rubinius,mlarraz/rubinius,lgierth/rubinius,ruipserra/rubinius,benlovell/rubinius,Azizou/rubinius,digitalextremist/rubinius,ngpestelos/rubinius,slawosz/rubinius,digitalextremist/rubinius,dblock/rubinius,mlarraz/rubinius,jsyeo/rubinius,kachick/rubinius,heftig/rubinius,jemc/rubinius,pH14/rubinius,travis-repos/rubinius,mlarraz/rubinius,dblock/rubinius,sferik/rubinius,Azizou/rubinius,mlarraz/rubinius,Wirachmat/rubinius
ddfc46de06300cd223ccd6503ff97a29af474303
src/driver_control/dc_dump.c
src/driver_control/dc_dump.c
void dc_dump() { if (vexRT[Btn7U]) dump_set(-127); else if (vexRT[Btn7D]) dump_set(127); else dump_set(0); }
void dc_dump() { if (vexRT[Btn6U]) dump_set(-127); else if (vexRT[Btn6D]) dump_set(127); else if (vexRT[Btn5U]) dump_set(-15); else dump_set(0); }
Change dump buttons and add hold button
Change dump buttons and add hold button
C
mit
qsctr/vex-4194b-2016
d45a05e3563085b8131f3a84c4f3b16c3fab7908
kernel/port/heap.c
kernel/port/heap.c
#include <stddef.h> #include <kernel/port/heap.h> #include <kernel/port/units.h> #include <kernel/port/stdio.h> #include <kernel/port/panic.h> /* round_up returns `n` rounded to the next value that is zero * modulo `align`. */ static uintptr_t round_up(uintptr_t n, uintptr_t align) { if (n % align) { return n + (align - (n % align)); } return n; } uintptr_t heap_next, heap_end; void heap_init(uintptr_t start, uintptr_t end) { heap_next = start; heap_end = end; } void *kalloc_align(uintptr_t size, uintptr_t alignment) { heap_next = round_up(heap_next, alignment); uintptr_t ret = heap_next; heap_next += size; if(heap_next > heap_end) { panic("Out of space!"); } return (void*)ret; } void *kalloc(uintptr_t size) { return kalloc_align(size, sizeof(uintptr_t)); } void kfree(void *ptr, uintptr_t size) { }
#include <stddef.h> #include <kernel/port/heap.h> #include <kernel/port/units.h> #include <kernel/port/stdio.h> #include <kernel/port/panic.h> #include <kernel/arch/lock.h> static mutex_t heap_lock; /* round_up returns `n` rounded to the next value that is zero * modulo `align`. */ static uintptr_t round_up(uintptr_t n, uintptr_t align) { if (n % align) { return n + (align - (n % align)); } return n; } uintptr_t heap_next, heap_end; void heap_init(uintptr_t start, uintptr_t end) { heap_next = start; heap_end = end; } void *kalloc_align(uintptr_t size, uintptr_t alignment) { wait_acquire(&heap_lock); heap_next = round_up(heap_next, alignment); uintptr_t ret = heap_next; heap_next += size; if(heap_next > heap_end) { panic("Out of space!"); } release(&heap_lock); return (void*)ret; } void *kalloc(uintptr_t size) { return kalloc_align(size, sizeof(uintptr_t)); } void kfree(void *ptr, uintptr_t size) { }
Put a lock around kalloc*
Put a lock around kalloc*
C
isc
zenhack/zero,zenhack/zero,zenhack/zero
295b1a050560f0384463c79a09cec83970e9c2d1
peertalk/PTPrivate.h
peertalk/PTPrivate.h
#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (!defined(__IPHONE_6_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0)) || \ (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (!defined(__MAC_10_8) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8)) #define PT_DISPATCH_RETAIN_RELEASE 1 #endif #if !defined(PT_DISPATCH_RETAIN_RELEASE) #define PT_PRECISE_LIFETIME #define PT_PRECISE_LIFETIME_UNUSED #else #define PT_PRECISE_LIFETIME __attribute__((objc_precise_lifetime)) #define PT_PRECISE_LIFETIME_UNUSED __attribute__((objc_precise_lifetime, unused)) #endif
#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (!defined(__IPHONE_6_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0)) || \ (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (!defined(__MAC_10_8) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8)) #define PT_DISPATCH_RETAIN_RELEASE 1 #endif #if (!defined(PT_DISPATCH_RETAIN_RELEASE)) #define PT_PRECISE_LIFETIME __attribute__((objc_precise_lifetime)) #define PT_PRECISE_LIFETIME_UNUSED __attribute__((objc_precise_lifetime, unused)) #else #define PT_PRECISE_LIFETIME #define PT_PRECISE_LIFETIME_UNUSED #endif
Fix header defines based on ARC version
Fix header defines based on ARC version
C
mit
rsms/peertalk,rsms/peertalk,rsms/peertalk
3c065012a278ce325f7f2f64abdb6fa2b78eae41
src/tests/util/bitmap_test.c
src/tests/util/bitmap_test.c
/** * @file * * @date Oct 21, 2013 * @author Eldar Abusalimov */ #include <embox/test.h> #include <util/bitmap.h> EMBOX_TEST_SUITE("util/bitmap test"); #define TEST_BITMAP_SZ 100 TEST_CASE() { BITMAP_DECL(bitmap, TEST_BITMAP_SZ); bitmap_clear_all(bitmap, TEST_BITMAP_SZ); test_assert_equal(bitmap_find_first_set_bit(bitmap, TEST_BITMAP_SZ), TEST_BITMAP_SZ /* not found */ ); for (int i = TEST_BITMAP_SZ-1; i >= 0; --i) { bitmap_set_bit(bitmap, i); test_assert_not_zero(bitmap_test_bit(bitmap, i)); test_assert_equal(bitmap_find_first_set_bit(bitmap, TEST_BITMAP_SZ), i); } }
/** * @file * * @date Oct 21, 2013 * @author Eldar Abusalimov */ #include <embox/test.h> #include <string.h> #include <util/bitmap.h> EMBOX_TEST_SUITE("util/bitmap test"); #define TEST_ALINGED_SZ 64 #define TEST_UNALINGED_SZ 100 TEST_CASE("aligned size with red zone after an array") { BITMAP_DECL(bitmap, TEST_ALINGED_SZ + 1); memset(bitmap, 0xAA, sizeof(bitmap)); bitmap_clear_all(bitmap, TEST_ALINGED_SZ); test_assert_equal(bitmap_find_first_bit(bitmap, TEST_ALINGED_SZ), TEST_ALINGED_SZ /* not found */ ); } TEST_CASE("unaligned size") { BITMAP_DECL(bitmap, TEST_UNALINGED_SZ); bitmap_clear_all(bitmap, TEST_UNALINGED_SZ); test_assert_equal(bitmap_find_first_bit(bitmap, TEST_UNALINGED_SZ), TEST_UNALINGED_SZ /* not found */ ); for (int i = TEST_UNALINGED_SZ-1; i >= 0; --i) { bitmap_set_bit(bitmap, i); test_assert_not_zero(bitmap_test_bit(bitmap, i)); test_assert_equal(bitmap_find_first_bit(bitmap, TEST_UNALINGED_SZ), i); } }
Add bitmap test case which reveals a bug
Add bitmap test case which reveals a bug
C
bsd-2-clause
mike2390/embox,abusalimov/embox,vrxfile/embox-trik,mike2390/embox,Kefir0192/embox,Kefir0192/embox,embox/embox,gzoom13/embox,gzoom13/embox,abusalimov/embox,gzoom13/embox,embox/embox,gzoom13/embox,vrxfile/embox-trik,Kefir0192/embox,abusalimov/embox,Kefir0192/embox,mike2390/embox,gzoom13/embox,vrxfile/embox-trik,Kakadu/embox,vrxfile/embox-trik,vrxfile/embox-trik,Kakadu/embox,gzoom13/embox,Kefir0192/embox,mike2390/embox,embox/embox,Kakadu/embox,mike2390/embox,Kakadu/embox,embox/embox,vrxfile/embox-trik,Kakadu/embox,embox/embox,abusalimov/embox,vrxfile/embox-trik,Kakadu/embox,Kefir0192/embox,mike2390/embox,abusalimov/embox,mike2390/embox,gzoom13/embox,Kakadu/embox,Kefir0192/embox,abusalimov/embox,embox/embox
35793f330181dae066b999c56ef117763c1df13c
test/Headers/altivec-header.c
test/Headers/altivec-header.c
// REQUIRES: powerpc-registered-target // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -S -o - %s | FileCheck %s // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -fno-lax-vector-conversions -S -o - %s | FileCheck %s // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -x c++ -S -o - %s | FileCheck %s #include <altivec.h> // Verify that simply including <altivec.h> does not generate any code // (i.e. all inline routines in the header are marked "static") // CHECK: .text // CHECK-NEXT: .file // CHECK-NEXT: {{^$}} // CHECK-NEXT: .ident{{.*$}} // CHECK-NEXT: .section ".note.GNU-stack","",@progbits // CHECK-NOT: .
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -emit-llvm -o - %s | FileCheck %s // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -emit-llvm -fno-lax-vector-conversions -o - %s | FileCheck %s // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -emit-llvm -x c++ -o - %s | FileCheck %s #include <altivec.h> // Verify that simply including <altivec.h> does not generate any code // (i.e. all inline routines in the header are marked "static") // CHECK: target triple = "powerpc64- // CHECK-NEXT: {{^$}} // CHECK-NEXT: llvm.ident
Make this test not rely on a backend being registered.
Make this test not rely on a backend being registered. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@233993 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
06658dd37b8a6ffcb05603e57720831422785e8b
Library/BigFix/Error.h
Library/BigFix/Error.h
#ifndef BigFix_Error_h #define BigFix_Error_h #include <exception> #include <stddef.h> namespace BigFix { class Error : public std::exception { public: template <size_t n> explicit Error( const char ( &literal )[n] ) : m_what( literal ) { } virtual const char* what() const throw(); private: const char* m_what; }; } #endif
#ifndef BigFix_Error_h #define BigFix_Error_h #include <exception> #include <stddef.h> namespace BigFix { class Error : public std::exception { public: template <size_t n> explicit Error( const char ( &literal )[n] ) throw() : m_what( literal ) { } virtual const char* what() const throw(); private: const char* m_what; }; } #endif
Add throw() declaration to avoid dead code coverage
Add throw() declaration to avoid dead code coverage
C
apache-2.0
bigfix/bfarchive,bigfix/bfarchive,bigfix/bfarchive,bigfix/bfarchive,bigfix/bfarchive,bigfix/bfarchive,bigfix/bfarchive
72e1682bbdfd497ce838d648bb2cb6047c015f6f
test/Analysis/array-struct.c
test/Analysis/array-struct.c
// RUN: clang -checker-simple -verify %s struct s {}; void f(void) { int a[10]; int (*p)[10]; p = &a; (*p)[3] = 1; struct s d; struct s *q; q = &d; }
// RUN: clang -checker-simple -verify %s struct s { int data; int data_array[10]; }; void f(void) { int a[10]; int (*p)[10]; p = &a; (*p)[3] = 1; struct s d; struct s *q; q = &d; q->data = 3; d.data_array[9] = 17; }
Add random array and struct test code for SCA.
Add random array and struct test code for SCA. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@58085 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
9440f74bb456fb8a82a92bb662a00e1ecdb1b14f
3RVX/OSD/BrightnessOSD.h
3RVX/OSD/BrightnessOSD.h
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once #include "OSD.h" class BrightnessOSD : public OSD { public: BrightnessOSD(); virtual void Hide(); virtual void ProcessHotkeys(HotkeyInfo &hki); private: MeterWnd _mWnd; virtual void OnDisplayChange(); virtual LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); };
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once #include "OSD.h" class BrightnessOSD : public OSD { public: BrightnessOSD(); virtual void Hide(); virtual void ProcessHotkeys(HotkeyInfo &hki); private: MeterWnd _mWnd; BrightnessController *_brightnessCtrl; virtual void OnDisplayChange(); virtual LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); };
Add member variable for brightness controller
Add member variable for brightness controller
C
bsd-2-clause
malensek/3RVX,malensek/3RVX,malensek/3RVX
f52cef415e8125d92615a90b2b93497fda5de9c6
GITRepo+Protected.h
GITRepo+Protected.h
// // GITRepo+Protected.h // CocoaGit // // Created by Geoffrey Garside on 05/08/2008. // Copyright 2008 ManicPanda.com. All rights reserved. // @interface GITRepo () - (NSString*)objectPathFromHash:(NSString*)hash; - (NSData*)dataWithContentsOfHash:(NSString*)hash; - (void)extractFromData:(NSData*)data type:(NSString**)theType size:(NSUInteger*)theSize andData:(NSData**)theData; #pragma mark - #pragma mark Object instanciation methods - (id <GITObject>)objectWithHash:(NSString*)hash; - (GITCommit*)commitWithHash:(NSString*)hash; - (GITTag*)tagWithHash:(NSString*)hash; - (GITTree*)treeWithHash:(NSString*)hash; - (GITBlob*)blobWithHash:(NSString*)hash; @end
// // GITRepo+Protected.h // CocoaGit // // Created by Geoffrey Garside on 05/08/2008. // Copyright 2008 ManicPanda.com. All rights reserved. // @protocol GITObject; @interface GITRepo () - (NSString*)objectPathFromHash:(NSString*)hash; - (NSData*)dataWithContentsOfHash:(NSString*)hash; - (void)extractFromData:(NSData*)data type:(NSString**)theType size:(NSUInteger*)theSize andData:(NSData**)theData; #pragma mark - #pragma mark Object instanciation methods - (id <GITObject>)objectWithHash:(NSString*)hash; - (GITCommit*)commitWithHash:(NSString*)hash; - (GITTag*)tagWithHash:(NSString*)hash; - (GITTree*)treeWithHash:(NSString*)hash; - (GITBlob*)blobWithHash:(NSString*)hash; @end
Add missing @protocol forward declaration
Add missing @protocol forward declaration
C
mit
schacon/cocoagit,geoffgarside/cocoagit,schacon/cocoagit,geoffgarside/cocoagit
d4cd3990499d349f671b5dcd6b2b8dd2e6a47f39
meta-extractor/include/CSVWriter.h
meta-extractor/include/CSVWriter.h
#ifndef _CSVWRITER_H_ #define _CSVWRITER_H_ #include <string> #include <istream> #include <stdexcept> namespace CSV { class Writer { public: static const char CSV_SEP = '|'; Writer(std::ostream& output); Writer operator<< (const std::string& data); Writer next(); private: std::ostream& output; bool isFirstValue; std::string clean(const std::string&); }; } #endif
#ifndef _CSVWRITER_H_ #define _CSVWRITER_H_ #include <string> #include <istream> #include <stdexcept> namespace CSV { class Writer { public: static const char CSV_SEP = ','; /** * Construct a CSV::Writer that uses ',' as value separator. */ Writer(std::ostream& output); /** * Write the given value to the csv file */ Writer operator<< (const std::string& data); /** * Advance to the next line */ Writer next(); protected: /** * Clean up (escape) the given value to be used in this object. * Note: This is called internally in operator<<(const std::string&) */ std::string clean(const std::string& data); private: std::ostream& output; bool isFirstValue; }; } #endif
Improve and document CSV::Writer interface
Improve and document CSV::Writer interface ',' is now the default value separator as in "comma-separated values".
C
mit
klemens/ALI-CC,klemens/ALI-CC,klemens/ALI-CC
87b1da17fccaee017c8920dc6da9892ff91e50f3
planb/PBManifest.h
planb/PBManifest.h
/* Copyright 2018 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. */ @import Foundation; /// PBManifest handles downloading and parsing a list of packages to fetch and install. @interface PBManifest : NSObject - (instancetype)init NS_UNAVAILABLE; /// Designated initializer. - (instancetype)initWithURL:(NSURL *)manifestURL NS_DESIGNATED_INITIALIZER; /// Download and parse the manifest. - (void)downloadManifest; /// Return list of packages in the manifest for the given track. - (NSArray *)packagesForTrack:(NSString *)track; /// The NSURLSession to use for downloading packages. If not set, a default one will be used. @property NSURLSession *session; /// The number of seconds to allow downloading before timing out. Defaults to 300 (5 minutes). @property NSUInteger downloadTimeoutSeconds; /// The number of download attempts before giving up. Defaults to 5. @property NSUInteger downloadAttemptsMax; @end
/* Copyright 2018 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. */ @import Foundation; /// PBManifest handles downloading and parsing a list of packages to fetch and install. @interface PBManifest : NSObject - (instancetype)init NS_UNAVAILABLE; /// Designated initializer. - (instancetype)initWithURL:(NSURL *)manifestURL NS_DESIGNATED_INITIALIZER; /// Download and parse the manifest. - (void)downloadManifest; /// Return list of packages in the manifest for the given track. - (NSArray *)packagesForTrack:(NSString *)track; /// The NSURLSession to use for downloading packages. If not set, a default one will be used. @property NSURLSession *session; /// The number of seconds to allow downloading before timing out. Defaults to 300 (5 minutes). /// TODO(nguyenphillip): use session config's timeoutIntervalForResource to handle timeouts, and /// make session a required argument of initializer for both PBManifest and PBPackageInstaller. @property NSUInteger downloadTimeoutSeconds; /// The number of download attempts before giving up. Defaults to 5. @property NSUInteger downloadAttemptsMax; @end
Add TODO to replace downloadTimeoutSeconds property with session config timeout.
Add TODO to replace downloadTimeoutSeconds property with session config timeout.
C
apache-2.0
google/macops-planb,google/macops-planb
0a46d15de59c4921dff03dc06c348cb4f1526708
starlight.h
starlight.h
#pragma once #ifdef _MSC_VER #define SL_CALL __vectorcall #else #define SL_CALL #endif
#pragma once #include <string> #if 0 int Stricmp(const char* str1, const char* str2) { int d; while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; } return d; } int Strnicmp(const char* str1, const char* str2, int count) { int d = 0; while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; count--; } return d; } #endif #ifdef _MSC_VER #define SL_CALL __vectorcall #else #define SL_CALL #endif #define COUNT_OF(X) (sizeof(X) / sizeof((X)[0])) #define ZERO_MEM(X, Y) (memset(X, 0, Y));
Add own versions of _countof and ZeroMemory
Add own versions of _countof and ZeroMemory
C
mit
darkedge/starlight,darkedge/starlight,darkedge/starlight
3a90bf0bcec4c198eb56c676d562c609a4486c46
SSPSolution/SSPSolution/GameStateHandler.h
SSPSolution/SSPSolution/GameStateHandler.h
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #define SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #include "GameState.h" #include "StartState.h" #include "LevelSelectState.h" #include <vector> //#define START_WITHOUT_MENU class GameStateHandler { private: std::vector<GameState*> m_stateStack; std::vector<GameState*> m_statesToRemove; public: GameStateHandler(); ~GameStateHandler(); int ShutDown(); int Initialize(ComponentHandler* cHandler, Camera* cameraRef, std::string levelPath = NULL); int Update(float dt, InputHandler* inputHandler); //Push a state to the stack int PushStateToStack(GameState* state); private: }; #endif
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #define SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #include "GameState.h" #include "StartState.h" #include "LevelSelectState.h" #include <vector> #define START_WITHOUT_MENU class GameStateHandler { private: std::vector<GameState*> m_stateStack; std::vector<GameState*> m_statesToRemove; public: GameStateHandler(); ~GameStateHandler(); int ShutDown(); int Initialize(ComponentHandler* cHandler, Camera* cameraRef, std::string levelPath = NULL); int Update(float dt, InputHandler* inputHandler); //Push a state to the stack int PushStateToStack(GameState* state); private: }; #endif
ADD definition again to start without menu
ADD definition again to start without menu
C
apache-2.0
Chringo/SSP,Chringo/SSP
3ecaae4ae125440770b67f73bb12e6cf9b0f49b5
mudlib/mud/home/Algorithm/sys/mathd.c
mudlib/mud/home/Algorithm/sys/mathd.c
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2013 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/>. */ float rnd() { /* use 30 bits of randomness */ return ldexp((float)random(1 << 30), -30); } float pi() { return atan(1.0) * 4.0; } int dice(int faces, int count) { int sum; while (count) { sum += random(faces) + 1; count--; } return sum; }
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2013 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/>. */ float rnd() { /* use 30 bits of randomness */ return ldexp((float)random(1 << 30), -30); } float bell_rnd(int degree) { float sum; int i; for (i = 0; i < degree; i++) { sum += rnd(); } return sum / (float)degree; } float pi() { return atan(1.0) * 4.0; } int dice(int faces, int count) { int sum; while (count) { sum += random(faces) + 1; count--; } return sum; }
Add bell curve random number generator
Add bell curve random number generator
C
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
97f8ff3579a49100610873ec6f35c8b6e5d6f527
src/include/pool.h
src/include/pool.h
/* ******************************************************************************************************* * Static pool maintained to avoid runtime mallocs. * It comprises of following pools: * 1. Pool for Arraylist * 2. Pool for Hashmap * 3. Pool for Strings * 4. Pool for Integers * 5. Pool for Bytes ******************************************************************************************************* */ #define AS_MAX_STORE_SIZE 4096 typedef struct bytes_static_pool { as_bytes bytes_pool[AS_MAX_STORE_SIZE]; u_int32_t current_bytes_id; } as_static_pool; #define BYTES_CNT(static_pool) \ (((as_static_pool *)static_pool)->current_bytes_id) #define BYTES_POOL(static_pool) \ ((as_static_pool *)static_pool)->bytes_pool #define GET_BYTES_POOL(map_bytes, static_pool, err) \ if (AS_MAX_STORE_SIZE > BYTES_CNT(static_pool)) { \ map_bytes = &(BYTES_POOL(static_pool)[BYTES_CNT(static_pool)++]); \ } else { \ as_error_update(err, AEROSPIKE_ERR, "Cannot allocate as_bytes"); \ } #define POOL_DESTROY(static_pool) \ for (u_int32_t iter = 0; iter < BYTES_CNT(static_pool); iter++) { \ as_bytes_destroy(&BYTES_POOL(static_pool)[iter]); \ }
/* ******************************************************************************************************* * Static pool maintained to avoid runtime mallocs. * It comprises of following pools: * 1. Pool for Arraylist * 2. Pool for Hashmap * 3. Pool for Strings * 4. Pool for Integers * 5. Pool for Bytes ******************************************************************************************************* */ #define AS_MAX_STORE_SIZE 4096 typedef struct bytes_static_pool { as_bytes bytes_pool[AS_MAX_STORE_SIZE]; uint32_t current_bytes_id; } as_static_pool; #define BYTES_CNT(static_pool) \ (((as_static_pool *)static_pool)->current_bytes_id) #define BYTES_POOL(static_pool) \ ((as_static_pool *)static_pool)->bytes_pool #define GET_BYTES_POOL(map_bytes, static_pool, err) \ if (AS_MAX_STORE_SIZE > BYTES_CNT(static_pool)) { \ map_bytes = &(BYTES_POOL(static_pool)[BYTES_CNT(static_pool)++]); \ } else { \ as_error_update(err, AEROSPIKE_ERR, "Cannot allocate as_bytes"); \ } #define POOL_DESTROY(static_pool) \ for (u_int32_t iter = 0; iter < BYTES_CNT(static_pool); iter++) { \ as_bytes_destroy(&BYTES_POOL(static_pool)[iter]); \ }
Fix build on alpine linux. u_int32_t => uint32_t
Fix build on alpine linux. u_int32_t => uint32_t
C
apache-2.0
aerospike/aerospike-client-python,aerospike/aerospike-client-python,aerospike/aerospike-client-python
2fa1c13c35e1ef5093ca734dae62d89572f06eaf
alura/c/forca.c
alura/c/forca.c
#include <stdio.h> int main() { char palavrasecreta[20]; sprintf(palavrasecreta, "MELANCIA"); int acertou = 0; int enforcou = 0; do { // comecar o nosso jogo!! } while(!acertou && !enforcou); }
#include <stdio.h> #include <string.h> int main() { char palavrasecreta[20]; sprintf(palavrasecreta, "MELANCIA"); int acertou = 0; int enforcou = 0; do { char chute; scanf("%c", &chute); for(int i = 0; i < strlen(palavrasecreta); i++) { if(palavrasecreta[i] == chute) { printf("A posição %d tem essa letra!\n", i); } } } while(!acertou && !enforcou); }
Update files, Alura, Introdução a C - Parte 2, Aula 2.4
Update files, Alura, Introdução a C - Parte 2, Aula 2.4
C
mit
fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs
86d5c7ee15199c2dc3300978a5393ca1492f8569
template_3/daemon3.c
template_3/daemon3.c
#include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <errno.h> #include <signal.h> #include "daemon.h" void daemon_exit_handler(int sig) { //Here we release resources #ifdef DAEMON_PID_FILE_NAME unlink(DAEMON_PID_FILE_NAME); #endif _exit(EXIT_FAILURE); } void init_signals(void) { struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = daemon_exit_handler; if( sigaction(SIGTERM, &sa, NULL) != 0) daemon_error_exit("Can't set daemon_exit_handler: %m\n"); signal(SIGCHLD, SIG_IGN); // ignore child signal(SIGTSTP, SIG_IGN); // ignore tty signals signal(SIGTTOU, SIG_IGN); signal(SIGTTIN, SIG_IGN); signal(SIGHUP, SIG_IGN); } int main(void) { daemonize(); init_signals(); while(1) { // Here а routine of daemon printf("%s: daemon is run\n", DAEMON_NAME); sleep(10); } return EXIT_SUCCESS; // good job (we interrupted (finished) main loop) }
#include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <signal.h> #include "daemon.h" void daemon_exit_handler(int sig) { //Here we release resources #ifdef DAEMON_PID_FILE_NAME unlink(DAEMON_PID_FILE_NAME); #endif _exit(EXIT_FAILURE); } void init_signals(void) { struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = daemon_exit_handler; if( sigaction(SIGTERM, &sa, NULL) != 0) daemon_error_exit("Can't set daemon_exit_handler: %m\n"); signal(SIGCHLD, SIG_IGN); // ignore child signal(SIGTSTP, SIG_IGN); // ignore tty signals signal(SIGTTOU, SIG_IGN); signal(SIGTTIN, SIG_IGN); signal(SIGHUP, SIG_IGN); } int main(void) { daemonize(); init_signals(); while(1) { // Here а routine of daemon printf("%s: daemon is run\n", DAEMON_NAME); sleep(10); } return EXIT_SUCCESS; // good job (we interrupted (finished) main loop) }
Fix warning: implicit declaration of function memset
template_3: Fix warning: implicit declaration of function memset
C
bsd-3-clause
KoynovStas/daemon_templates,KoynovStas/daemon_templates
1330c19065127dc9ed2ceb032568beee047c36fe
include/cpr/multipart.h
include/cpr/multipart.h
#ifndef CPR_MULTIPART_H #define CPR_MULTIPART_H #include <initializer_list> #include <string> #include <vector> #include "defines.h" namespace cpr { struct File { template <typename StringType> File(StringType&& filepath) : filepath{CPR_FWD(filepath)} {} std::string filepath; }; struct Part { Part(const std::string& name, const std::string& value, const std::string& content_type = {}) : name{name}, value{value}, content_type{content_type}, is_file{false} {} Part(const std::string& name, const int& value, const std::string& content_type = {}) : name{name}, value{std::to_string(value)}, content_type{content_type}, is_file{false} { } Part(const std::string& name, const File& file, const std::string& content_type = {}) : name{name}, value{file.filepath}, content_type{content_type}, is_file{true} {} std::string name; std::string value; std::string content_type; bool is_file; }; class Multipart { public: Multipart(const std::initializer_list<Part>& parts); std::vector<Part> parts; }; } // namespace cpr #endif
#ifndef CPR_MULTIPART_H #define CPR_MULTIPART_H #include <initializer_list> #include <string> #include <vector> #include "defines.h" namespace cpr { struct File { template <typename StringType> explicit File(StringType&& filepath) : filepath{CPR_FWD(filepath)} {} std::string filepath; }; struct Part { Part(const std::string& name, const std::string& value, const std::string& content_type = {}) : name{name}, value{value}, content_type{content_type}, is_file{false} {} Part(const std::string& name, const int& value, const std::string& content_type = {}) : name{name}, value{std::to_string(value)}, content_type{content_type}, is_file{false} { } Part(const std::string& name, const File& file, const std::string& content_type = {}) : name{name}, value{file.filepath}, content_type{content_type}, is_file{true} {} std::string name; std::string value; std::string content_type; bool is_file; }; class Multipart { public: Multipart(const std::initializer_list<Part>& parts); std::vector<Part> parts; }; } // namespace cpr #endif
Use explicit constructor for File to resolve template deductions
Use explicit constructor for File to resolve template deductions
C
mit
msuvajac/cpr,msuvajac/cpr,msuvajac/cpr,whoshuu/cpr,whoshuu/cpr,whoshuu/cpr
ceaae28b67ee521c6b0d8c04a7d8f989ff2598bb
src/server_tasks.h
src/server_tasks.h
#include "telit_HE910.h" namespace openxc { namespace server_task { void openxc::server_task::firmwareCheck(TelitDevice* device); void openxc::server_task::flushDataBuffer(TelitDevice* device); void openxc::server_task::commandCheck(TelitDevice* device); } }
#include "telit_he910.h" namespace openxc { namespace server_task { void openxc::server_task::firmwareCheck(TelitDevice* device); void openxc::server_task::flushDataBuffer(TelitDevice* device); void openxc::server_task::commandCheck(TelitDevice* device); } }
Fix case of an include to support crossplatform compilation.
Fix case of an include to support crossplatform compilation.
C
bsd-3-clause
ene-ilies/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware
aa960ff4ec71089b69be81ec1f6d3f86f10c61ee
NHL95DBEditor/src/player_key.c
NHL95DBEditor/src/player_key.c
#include <stdio.h> #include "player_key.h" bool_t key_is_goalie(player_key_t *key) { return key->position == 'G'; } void show_key_player(player_key_t *key, size_t ofs_key) { size_t i; printf("T: %2u NO: %2u POS: %c NAME: %-15s %-15s", key->team, key->jersey, key->position, key->first, key->last); printf(" OFS_KEY: %4x OFS_ATT: %4x OFS_CAR: %4x OFS_SEA: %4x", ofs_key, key->ofs_attributes, key->ofs_career_stats, key->ofs_season_stats); printf(" UNKNOWN: "); for (i = 0; i < sizeof(key->unknown); i++) { printf("%3u ", key->unknown[i]); } }
#include <stdio.h> #include "player_key.h" bool_t key_is_goalie(player_key_t *key) { return key->position == 'G'; } void show_key_player(player_key_t *key, size_t ofs_key) { size_t i; printf("T: %3u NO: %2u POS: %c NAME: %-15s %-15s", key->team, key->jersey, key->position, key->first, key->last); printf(" OFS_KEY: %4x OFS_ATT: %4x OFS_CAR: %4x OFS_SEA: %4x", ofs_key, key->ofs_attributes, key->ofs_career_stats, key->ofs_season_stats); printf(" UNKNOWN: "); for (i = 0; i < sizeof(key->unknown); i++) { printf("%3u ", key->unknown[i]); } }
Align free agents (team index 255) with the rest
Align free agents (team index 255) with the rest
C
mit
peruukki/NHL95DBEditor,peruukki/NHL95DBEditor
cf20ae24a70260c732b62f048bbcadfdee07be99
src/TimingHelpers.h
src/TimingHelpers.h
/* Copyright (C) 2015 George White <stonehippo@gmail.com>, All rights reserved. See https://raw.githubusercontent.com/stonehippo/sploder/master/LICENSE.txt for license details. */ // ******************* Timing helpers ******************* void startTimer(long &timer) { timer = millis(); } boolean isTimerExpired(long &timer, int expiration) { long current = millis() - timer; return current > expiration; } void clearTimer(long &timer) { timer = 0; }
/* Copyright (C) 2015 George White <stonehippo@gmail.com>, All rights reserved. See https://raw.githubusercontent.com/stonehippo/sploder/master/LICENSE.txt for license details. */ // ******************* Timing helpers ******************* void startTimer(long &timer) { timer = millis(); } boolean isTimerExpired(long &timer, long expiration) { long current = millis() - timer; return current > expiration; } void clearTimer(long &timer) { timer = 0; }
Fix bug in timer comparison
Fix bug in timer comparison The expiration time was being cast to an int, truncating longer timeouts.
C
mit
stonehippo/sploder,stonehippo/sploder
4545c54ecd4b9cbc13033008c78c403da996f990
CCKit/CCLoadingController.h
CCKit/CCLoadingController.h
// // CCLoadingController.h // CCKit // // Created by Leonardo Lobato on 3/15/13. // Copyright (c) 2013 Cliq Consulting. All rights reserved. // #import <UIKit/UIKit.h> @protocol CCLoadingControllerDelegate; @interface CCLoadingController : NSObject @property (nonatomic, readonly) UIView *loadingView; @property (nonatomic, weak) id<CCLoadingControllerDelegate> delegate; - (void)showLoadingView:(BOOL)show animated:(BOOL)animated; @end @protocol CCLoadingControllerDelegate <NSObject> - (UIView *)parentViewForLoadingController:(CCLoadingController *)controller; @optional; - (UIView *)loadingControllerShouldBeDisplayedBelowView:(CCLoadingController *)controller; - (NSString *)titleForLoadingViewOnLoadingController:(CCLoadingController *)controller; @end
// // CCLoadingController.h // CCKit // // Created by Leonardo Lobato on 3/15/13. // Copyright (c) 2013 Cliq Consulting. All rights reserved. // #import <UIKit/UIKit.h> @protocol CCLoadingControllerDelegate; @interface CCLoadingController : NSObject @property (nonatomic, readonly) UIView *loadingView; #if __has_feature(objc_arc) @property (nonatomic, weak) id<CCLoadingControllerDelegate> delegate; #else @property (nonatomic, assign) id<CCLoadingControllerDelegate> delegate; #endif - (void)showLoadingView:(BOOL)show animated:(BOOL)animated; @end @protocol CCLoadingControllerDelegate <NSObject> - (UIView *)parentViewForLoadingController:(CCLoadingController *)controller; @optional; - (UIView *)loadingControllerShouldBeDisplayedBelowView:(CCLoadingController *)controller; - (NSString *)titleForLoadingViewOnLoadingController:(CCLoadingController *)controller; @end
Fix build for non-arc projects
Fix build for non-arc projects Does **not** add no-arc support. Project will leak.
C
mit
cliq/CCKit
1c7cbfa6649a16fdeb37b489be5f3e63114ecab3
src/clientversion.h
src/clientversion.h
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 8 #define CLIENT_VERSION_REVISION 0 #define CLIENT_VERSION_BUILD 0 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! #define STRINGIZE(X) DO_STRINGIZE(X) #define DO_STRINGIZE(X) #X #endif // CLIENTVERSION_H
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 8 #define CLIENT_VERSION_REVISION 1 #define CLIENT_VERSION_BUILD 99 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE false // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! #define STRINGIZE(X) DO_STRINGIZE(X) #define DO_STRINGIZE(X) #X #endif // CLIENTVERSION_H
Switch version numbers to 0.8.1.99
Switch version numbers to 0.8.1.99
C
mit
domob1812/crowncoin,Infernoman/crowncoin,Crowndev/crowncoin,dobbscoin/dobbscoin-source,syscoin/syscoin,syscoin/syscoin,Earlz/dobbscoin-source,Infernoman/crowncoin,Earlz/dobbscoin-source,domob1812/crowncoin,Crowndev/crowncoin,Earlz/dobbscoin-source,Infernoman/crowncoin,dobbscoin/dobbscoin-source,syscoin/syscoin,dobbscoin/dobbscoin-source,Earlz/dobbscoin-source,dobbscoin/dobbscoin-source,syscoin/syscoin,Infernoman/crowncoin,syscoin/syscoin,domob1812/crowncoin,Infernoman/crowncoin,domob1812/crowncoin,Crowndev/crowncoin,Crowndev/crowncoin,Infernoman/crowncoin,domob1812/crowncoin,Crowndev/crowncoin,Crowndev/crowncoin,syscoin/syscoin,syscoin/syscoin,domob1812/crowncoin,syscoin/syscoin,dobbscoin/dobbscoin-source,Earlz/dobbscoin-source,dobbscoin/dobbscoin-source,Earlz/dobbscoin-source
0e1cacf1a4ced899e63d339591c9ed18556e840d
include/ccspec.h
include/ccspec.h
#ifndef CCSPEC_H_ #include "ccspec/expectation_target.h" #include "ccspec/matcher.h" #include "ccspec/matchers.h" #endif // CCSPEC_H_
#ifndef CCSPEC_H_ #define CCSPEC_H_ #include "ccspec/expectation_target.h" #include "ccspec/matcher.h" #include "ccspec/matchers.h" #endif // CCSPEC_H_
Add missing definition for include guard
Add missing definition for include guard
C
mit
michaelachrisco/ccspec,michaelachrisco/ccspec,tempbottle/ccspec,tempbottle/ccspec,tempbottle/ccspec,zhangsu/ccspec,michaelachrisco/ccspec,zhangsu/ccspec,zhangsu/ccspec
06c3836a83cf2a0e4bdedde721f29489f9523e56
src/main.c
src/main.c
// main.c // Main Program for HWP Media Center // // Author : Weipeng He <heweipeng@gmail.com> // Copyright (c) 2014, All rights reserved. #include "utils.h" #include <stdio.h> #include <curl/curl.h> size_t write_data(void *buffer, size_t size, size_t nmemb, void *dstr) { d_string* str = (d_string*) dstr; dstr_ncat(str, buffer, size * nmemb); return nmemb; } int main(int argc, char** argv) { CURL* curl; CURLcode res; curl = curl_easy_init(); if (curl) { curl_easy_setopt(curl, CURLOPT_URL, argv[1]); d_string* content = dstr_alloc(); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, content); res = curl_easy_perform(curl); if (res != CURLE_OK) { fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); } printf("size=%d, cap=%d\n%s", content->size, content->cap, content->str); dstr_free(content); curl_easy_cleanup(curl); } return 0; }
// main.c // Main Program for HWP Media Center // // Author : Weipeng He <heweipeng@gmail.com> // Copyright (c) 2014, All rights reserved. #include "utils.h" #include <stdio.h> #include <curl/curl.h> size_t write_data(void *buffer, size_t size, size_t nmemb, void *dstr) { d_string* str = (d_string*) dstr; dstr_ncat(str, buffer, size * nmemb); return nmemb; } int main(int argc, char** argv) { CURL* curl; CURLcode res; curl = curl_easy_init(); if (curl) { curl_easy_setopt(curl, CURLOPT_URL, argv[1]); curl_easy_setopt(curl, CURLOPT_USERAGENT, "hwp"); d_string* content = dstr_alloc(); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, content); res = curl_easy_perform(curl); if (res != CURLE_OK) { fprintf(stderr, "Failed to connect: %s\n", curl_easy_strerror(res)); } printf("size=%d, cap=%d\n%s", content->size, content->cap, content->str); dstr_free(content); curl_easy_cleanup(curl); } return 0; }
Add User-Agent to prevent from blocked by Douban.fm
Add User-Agent to prevent from blocked by Douban.fm
C
mit
hwp/hmc,hwp/hmc
9573b91c322511fdcd727057dc058ee8c0fdc19c
include/llvm/ModuleProvider.h
include/llvm/ModuleProvider.h
//===-- llvm/ModuleProvider.h - Interface for module providers --*- C++ -*-===// // // This file provides an abstract interface for loading a module from some // place. This interface allows incremental or random access loading of // functions from the file. This is useful for applications like JIT compilers // or interprocedural optimizers that do not need the entire program in memory // at the same time. // //===----------------------------------------------------------------------===// #ifndef MODULEPROVIDER_H #define MODULEPROVIDER_H class Function; class Module; class ModuleProvider { protected: Module *TheModule; ModuleProvider(); public: virtual ~ModuleProvider(); /// getModule - returns the module this provider is encapsulating. /// Module* getModule() { return TheModule; } /// materializeFunction - make sure the given function is fully read. /// virtual void materializeFunction(Function *F) = 0; /// materializeModule - make sure the entire Module has been completely read. /// void materializeModule(); /// releaseModule - no longer delete the Module* when provider is destroyed. /// virtual Module* releaseModule() { // Since we're losing control of this Module, we must hand it back complete materializeModule(); Module *tempM = TheModule; TheModule = 0; return tempM; } }; #endif
//===-- llvm/ModuleProvider.h - Interface for module providers --*- C++ -*-===// // // This file provides an abstract interface for loading a module from some // place. This interface allows incremental or random access loading of // functions from the file. This is useful for applications like JIT compilers // or interprocedural optimizers that do not need the entire program in memory // at the same time. // //===----------------------------------------------------------------------===// #ifndef MODULEPROVIDER_H #define MODULEPROVIDER_H class Function; class Module; class ModuleProvider { protected: Module *TheModule; ModuleProvider(); public: virtual ~ModuleProvider(); /// getModule - returns the module this provider is encapsulating. /// Module* getModule() { return TheModule; } /// materializeFunction - make sure the given function is fully read. /// virtual void materializeFunction(Function *F) = 0; /// materializeModule - make sure the entire Module has been completely read. /// Module* materializeModule(); /// releaseModule - no longer delete the Module* when provider is destroyed. /// virtual Module* releaseModule() { // Since we're losing control of this Module, we must hand it back complete materializeModule(); Module *tempM = TheModule; TheModule = 0; return tempM; } }; #endif
Return the Module being materialized to avoid always calling getModule().
Return the Module being materialized to avoid always calling getModule(). git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@9198 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap
b3180559b6960327f0fd843b6afc6c6cbaa1bf85
source/platform/min/window.h
source/platform/min/window.h
/* Copyright [2013-2018] [Aaron Springstroh, Minimal Graphics Library] 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 __WINDOW__ #define __WINDOW__ #if defined(_WIN32) #include <min/win32_window.h> namespace min { using window = min::win32_window; } #elif __linux__ #include <min/x_window.h> namespace min { using window = min::x_window; } #endif #endif
/* Copyright [2013-2018] [Aaron Springstroh, Minimal Graphics Library] 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 __WINDOW__ #define __WINDOW__ #if defined(_WIN32) #include <min/win32_window.h> namespace min { using window = min::win32_window; } #else #include <min/x_window.h> namespace min { using window = min::x_window; } #endif #endif
Allow other operating systems that use X11 to use it
MGL: Allow other operating systems that use X11 to use it
C
apache-2.0
Aaron-SP/mgl,Aaron-SP/mgl,Aaron-SP/mgl
12405f10d56dd4e0adb3c8e3d464abf1e8e74f00
android/cutils/properties.h
android/cutils/properties.h
/* * Copyright (C) 2006 The Android Open Source Project * * 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 __CUTILS_PROPERTIES_H #define __CUTILS_PROPERTIES_H #include <stdlib.h> #include <string.h> #ifdef __cplusplus extern "C" { #endif #define PROPERTY_KEY_MAX 32 #define PROPERTY_VALUE_MAX 92 /* property_get: returns the length of the value which will never be ** greater than PROPERTY_VALUE_MAX - 1 and will always be zero terminated. ** (the length does not include the terminating zero). ** ** If the property read fails or returns an empty value, the default ** value is used (if nonnull). */ static inline int property_get(const char *key, char *value, const char *default_value) { const char *env; env = getenv(key); if (!env) env = default_value; if (!value || !env) return 0; strncpy(value, env, PROPERTY_VALUE_MAX); return strlen(value); } /* property_set: returns 0 on success, < 0 on failure */ static inline int property_set(const char *key, const char *value) { return setenv(key, value, 0); } #ifdef __cplusplus } #endif #endif
/* * Copyright (C) 2006 The Android Open Source Project * * 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 __CUTILS_PROPERTIES_H #define __CUTILS_PROPERTIES_H #include <stdlib.h> #include <string.h> #ifdef __cplusplus extern "C" { #endif /* property_set: returns 0 on success, < 0 on failure */ static inline int property_set(const char *key, const char *value) { return setenv(key, value, 0); } #ifdef __cplusplus } #endif #endif
Remove not needed property_get function form cutils stubs
android: Remove not needed property_get function form cutils stubs This is no longer used as daemon indicates its presence by connecting socket.
C
lgpl-2.1
pstglia/external-bluetooth-bluez,mapfau/bluez,ComputeCycles/bluez,pstglia/external-bluetooth-bluez,pstglia/external-bluetooth-bluez,silent-snowman/bluez,pstglia/external-bluetooth-bluez,mapfau/bluez,silent-snowman/bluez,silent-snowman/bluez,ComputeCycles/bluez,mapfau/bluez,ComputeCycles/bluez,silent-snowman/bluez,pkarasev3/bluez,pkarasev3/bluez,pkarasev3/bluez,ComputeCycles/bluez,mapfau/bluez,pkarasev3/bluez
446d4341bb10ab6ba8da45498c8b7619d39249ca
examples/rot13_service/main.c
examples/rot13_service/main.c
#include "../../libtock/tock.h" #include <stdio.h> #define IPC_DRIVER 0x4c static void rot13_callback(int pid, int len, int arg2, void* ud) { char* buf = (char*)arg2; int length = buf[0]; if (length > len - 1) { length = len - 1; } buf++; for (int i = 0; i < len; ++i) { if (buf[i] >= 'a' && buf[i] <= 'z') { buf[i] = (((buf[i] - 'a') + 13) % 26) + 'a'; } else if (buf[i] >= 'A' && buf[i] <= 'Z') { buf[i] = (((buf[i] - 'A') + 13) % 26) + 'A'; } } command(IPC_DRIVER, pid, 0); } int main() { subscribe(IPC_DRIVER, 0, rot13_callback, 0); while (1) { yield(); } return 0; }
#include <tock.h> #define IPC_DRIVER 0x4c struct rot13_buf { int8_t length; char buf[31]; }; static void rot13_callback(int pid, int len, int buf, void* ud) { struct rot13_buf *rb = (struct rot13_buf*)buf; int length = rb->length; if (length > len - 1) { length = len - 1; } for (int i = 0; i < length; ++i) { if (rb->buf[i] >= 'a' && rb->buf[i] <= 'z') { rb->buf[i] = (((rb->buf[i] - 'a') + 13) % 26) + 'a'; } else if (rb->buf[i] >= 'A' && rb->buf[i] <= 'Z') { rb->buf[i] = (((rb->buf[i] - 'A') + 13) % 26) + 'A'; } } command(IPC_DRIVER, pid, 0); } int main() { subscribe(IPC_DRIVER, 0, rot13_callback, NULL); return 0; }
Enforce IPC data sharing with MPU
Enforce IPC data sharing with MPU Still pretty coarsely written but exposes only the shared buffer from a client when enqueuing the callback to a service.
C
apache-2.0
tock/libtock-c,tock/libtock-c,tock/libtock-c
295b4e944964658c86c810275dadf2c75cbbcf9f
src/all.h
src/all.h
#include <libsccmn.h> #include <openssl/rand.h> #include <sys/mman.h> #define FRAME_SIZE (3*4096) #define MEMPAGE_SIZE (4096) void _logging_init(void); void _frame_init(struct frame * this, uint8_t * data, size_t capacity, struct frame_pool_zone * zone);
#include <libsccmn.h> #include <openssl/rand.h> #include <sys/mman.h> // Frame size should be above 16kb, which is a maximum record size of 16kB for SSLv3/TLSv1 // See https://www.openssl.org/docs/manmaster/ssl/SSL_read.html #define FRAME_SIZE (5*4096) #define MEMPAGE_SIZE (4096) void _logging_init(void); void _frame_init(struct frame * this, uint8_t * data, size_t capacity, struct frame_pool_zone * zone);
Increase the size of the memory pool frame
Increase the size of the memory pool frame
C
bsd-3-clause
TeskaLabs/Frame_Transporter,TeskaLabs/SeaCat-Common-Library,TeskaLabs/Frame-Transporter,TeskaLabs/Frame-Transporter,TeskaLabs/Frame_Transporter
42d8167c3ac24b41e625063140bac8ac4ab31da0
include/scrappie.h
include/scrappie.h
#ifndef SCRAPPIE_H #define SCRAPPIE_H #ifdef __cplusplus extern "C" { #endif #include <immintrin.h> #include <stdbool.h> /* Structure definitions from fast5_interface.h */ typedef struct { double start; float length; float mean, stdv; int pos, state; } event_t; typedef struct { unsigned int n, start, end; event_t * event; } event_table; typedef struct { unsigned int n, start, end; float * raw; } raw_table; /* Matrix definitions from util.h */ typedef struct { unsigned int nr, nrq, nc; union { __m128 * v; float * f; } data; } _Mat; typedef _Mat * scrappie_matrix; scrappie_matrix nanonet_posterior(const event_table events, float min_prob, bool return_log); scrappie_matrix nanonet_raw_posterior(const raw_table signal, float min_prob, bool return_log); scrappie_matrix free_scrappie_matrix(scrappie_matrix mat); #ifdef __cplusplus } #endif #endif /* SCRAPPIE_H */
#ifndef SCRAPPIE_H #define SCRAPPIE_H #ifdef __cplusplus extern "C" { #endif #include <immintrin.h> #include <stdbool.h> /* Structure definitions from scrappie_structures.h */ typedef struct { double start; float length; float mean, stdv; int pos, state; } event_t; typedef struct { unsigned int n, start, end; event_t * event; } event_table; typedef struct { unsigned int n, start, end; float * raw; } raw_table; /* Matrix definitions from scrappie_matrix.h */ typedef struct { unsigned int nr, nrq, nc; union { __m128 * v; float * f; } data; } _Mat; typedef _Mat * scrappie_matrix; scrappie_matrix nanonet_posterior(const event_table events, float min_prob, bool return_log); scrappie_matrix nanonet_raw_posterior(const raw_table signal, float min_prob, bool return_log); scrappie_matrix free_scrappie_matrix(scrappie_matrix mat); #ifdef __cplusplus } #endif #endif /* SCRAPPIE_H */
Update where various definitions have come from
Update where various definitions have come from
C
mpl-2.0
nanoporetech/scrappie,nanoporetech/scrappie,nanoporetech/scrappie
f470ac421f6695e415da643e03b903a679ea828e
src/config.c
src/config.c
// vim: sw=4 ts=4 et : #include "config.h" // Parser for win_ section conf_t win_conf(char *key) { conf_t rc; rc.ival = 0; (void)key; return rc; } // Prefixes for config sections/subsections with parser pointers struct conf_prefix { char *prefix; conf_t (*parser)(char *); } pr_global[] = { { "win_", win_conf } }; // Entry point to get all config values conf_t conf(char *key) { conf_t rc; for (size_t i = 0; i < sizeof(pr_global); i++) { if (strstr(key, pr_global[i].prefix) == 0) { rc = win_conf(key + strlen(pr_global[i].prefix)); break; } } return rc; }
// vim: sw=4 ts=4 et : #include "config.h" #include "itmmorgue.h" // Parser for win_ section conf_t win_conf(char *key) { conf_t rc; // TODO implement real parser if (key == strstr(key, "area_y")) rc.ival = 3; if (key == strstr(key, "area_x")) rc.ival = 2; if (key == strstr(key, "area_max_y")) rc.ival = 10; if (key == strstr(key, "area_max_x")) rc.ival = 45; if (key == strstr(key, "area_state")) rc.ival = 2; return rc; } // Prefixes for config sections/subsections with parser pointers struct conf_prefix { char *prefix; conf_t (*parser)(char *); } pr_global[] = { { "win_", win_conf } }; // Entry point to get all config values conf_t conf(char *key) { conf_t rc; for (size_t i = 0; i < sizeof(pr_global) / sizeof(struct conf_prefix); i++) { if (key == strstr(key, pr_global[i].prefix)) { rc = win_conf(key + strlen(pr_global[i].prefix)); break; } } return rc; }
Fix the first (sic!) Segmentation fault
Fix the first (sic!) Segmentation fault
C
mit
zhmylove/itmmorgue,zhmylove/itmmorgue,zhmylove/itmmorgue,zhmylove/itmmorgue
9e724bbce19eee4f38256de15397c259000469f9
src/config.h
src/config.h
#ifndef _CONFIG_H #define _CONFIG_H #define ENABLE_FUTILITY_DEPTH 1 // TODO: switch to at least 2 #define ENABLE_HISTORY 1 #define ENABLE_KILLERS 1 #define ENABLE_LMR 1 #define ENABLE_NNUE 0 #define ENABLE_NULL_MOVE_PRUNING 1 #define ENABLE_REVERSE_FUTILITY_DEPTH 0 // TODO: switch to at least 2 #define ENABLE_TT_CUTOFFS 1 #define ENABLE_TT_MOVES 1 #endif
#ifndef _CONFIG_H #define _CONFIG_H #define ENABLE_FUTILITY_DEPTH 1 // TODO: switch to at least 2 #define ENABLE_HISTORY 1 #define ENABLE_KILLERS 1 #define ENABLE_LMR 1 #define ENABLE_NNUE 0 #define ENABLE_NULL_MOVE_PRUNING 1 #define ENABLE_REVERSE_FUTILITY_DEPTH 1 // TODO: switch to at least 2 #define ENABLE_TT_CUTOFFS 1 #define ENABLE_TT_MOVES 1 #endif
Enable reverse futility at depth 1
Enable reverse futility at depth 1
C
bsd-3-clause
jwatzman/nameless-chessbot,jwatzman/nameless-chessbot
855f14a819774f5417417e7a14938036c4115833
src/server.h
src/server.h
#ifndef XAPIAND_INCLUDED_SERVER_H #define XAPIAND_INCLUDED_SERVER_H #include <ev++.h> #include "threadpool.h" #include "database.h" const int XAPIAND_HTTP_PORT_DEFAULT = 8880; const int XAPIAND_BINARY_PORT_DEFAULT = 8890; class XapiandServer : public Task { private: ev::dynamic_loop loop; ev::sig sig; ev::async quit; ev::io http_io; int http_sock; ev::io binary_io; int binary_sock; DatabasePool database_pool; void bind_http(); void bind_binary(); void io_accept_http(ev::io &watcher, int revents); void io_accept_binary(ev::io &watcher, int revents); void signal_cb(ev::sig &signal, int revents); void quit_cb(ev::async &watcher, int revents); public: XapiandServer(int http_sock_, int binary_sock_); ~XapiandServer(); void run(); }; #endif /* XAPIAND_INCLUDED_SERVER_H */
#ifndef XAPIAND_INCLUDED_SERVER_H #define XAPIAND_INCLUDED_SERVER_H #include <ev++.h> #include "threadpool.h" #include "database.h" const int XAPIAND_HTTP_PORT_DEFAULT = 8880; const int XAPIAND_BINARY_PORT_DEFAULT = 8890; class XapiandServer : public Task { private: ev::dynamic_loop dynamic_loop; ev::loop_ref *loop; ev::sig sig; ev::async quit; ev::io http_io; int http_sock; ev::io binary_io; int binary_sock; DatabasePool database_pool; void bind_http(); void bind_binary(); void io_accept_http(ev::io &watcher, int revents); void io_accept_binary(ev::io &watcher, int revents); void signal_cb(ev::sig &signal, int revents); void quit_cb(ev::async &watcher, int revents); public: XapiandServer(int http_sock_, int binary_sock_, ev::loop_ref *loop_=NULL); ~XapiandServer(); void run(); }; #endif /* XAPIAND_INCLUDED_SERVER_H */
Allow passing an event loop to XapianServer
Allow passing an event loop to XapianServer
C
mit
Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand
eb8b1344df4fcf214879fcc5657c880aefd18228
include/core/SkMilestone.h
include/core/SkMilestone.h
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 90 #endif
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 91 #endif
Update Skia milestone to 91
Update Skia milestone to 91 TBR reed Change-Id: Ibfb76e9b08f5b427ff693f023419130107f857ec Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376138 Reviewed-by: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com> Commit-Queue: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>
C
bsd-3-clause
aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia
d0c3b3122833dae723639bdf1be8a0e97997c5f3
src/merge_vcf/Paramer.h
src/merge_vcf/Paramer.h
/* * Paramer.h * * Created on: Aug 20, 2015 * Author: fsedlaze */ #ifndef PARAMER_H_ #define PARAMER_H_ #include <string.h> #include <string> #include <vector> #include <stdlib.h> #include <iostream> #include <ctime> class Parameter { private: Parameter() { min_freq=-1; version ="1.0.4"; } ~Parameter() { } static Parameter* m_pInstance; public: std::string version; int max_dist; int max_caller; bool use_type; bool use_strand; bool dynamic_size; int min_length; float min_freq; int min_support; static Parameter* Instance() { if (!m_pInstance) { m_pInstance = new Parameter; } return m_pInstance; } double meassure_time(clock_t begin ,std::string msg){ return 0; clock_t end = clock(); double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC; std::cout << msg<<" " << elapsed_secs<<std::endl; return elapsed_secs; } }; #endif /* PARAMER_H_ */
/* * Paramer.h * * Created on: Aug 20, 2015 * Author: fsedlaze */ #ifndef PARAMER_H_ #define PARAMER_H_ #include <string.h> #include <string> #include <vector> #include <stdlib.h> #include <iostream> #include <ctime> class Parameter { private: Parameter() { min_freq=-1; version ="1.0.5"; } ~Parameter() { } static Parameter* m_pInstance; public: std::string version; int max_dist; int max_caller; bool use_type; bool use_strand; bool dynamic_size; int min_length; float min_freq; int min_support; static Parameter* Instance() { if (!m_pInstance) { m_pInstance = new Parameter; } return m_pInstance; } double meassure_time(clock_t begin ,std::string msg){ return 0; clock_t end = clock(); double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC; std::cout << msg<<" " << elapsed_secs<<std::endl; return elapsed_secs; } }; #endif /* PARAMER_H_ */
Increment version to clean things up
Increment version to clean things up
C
mit
fritzsedlazeck/SURVIVOR,fritzsedlazeck/SURVIVOR
bc9445a9173ec23196a3fdbfb3cfb5ea4bc1d084
src/library.c
src/library.c
/** * This file is part of the librailcan library. * * Copyright (C) 2015 Reinder Feenstra <reinderfeenstra@gmail.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA */ #include "librailcan.h" #include <string.h> int debug_level = LIBRAILCAN_DEBUGLEVEL_DEBUG;//LIBRAILCAN_DEBUGLEVEL_NONE; int librailcan_set_debug_level( int level ) { if( level < LIBRAILCAN_DEBUGLEVEL_NONE || level > LIBRAILCAN_DEBUGLEVEL_DEBUG ) return LIBRAILCAN_STATUS_INVALID_PARAM; debug_level = level; return LIBRAILCAN_STATUS_SUCCESS; }
/** * This file is part of the librailcan library. * * Copyright (C) 2015 Reinder Feenstra <reinderfeenstra@gmail.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA */ #include "librailcan.h" #include <string.h> int debug_level = LIBRAILCAN_DEBUGLEVEL_NONE; int librailcan_set_debug_level( int level ) { if( level < LIBRAILCAN_DEBUGLEVEL_NONE || level > LIBRAILCAN_DEBUGLEVEL_DEBUG ) return LIBRAILCAN_STATUS_INVALID_PARAM; debug_level = level; return LIBRAILCAN_STATUS_SUCCESS; }
Set default debug level to none.
Set default debug level to none.
C
lgpl-2.1
reinder/librailcan,reinder/librailcan,reinder/librailcan
328f45d5dcadced32eaeee1ea0a6f05f7cb2a969
wrapper.c
wrapper.c
#include <stdlib.h> #include <string.h> #include <stdint.h> #include "cc.h" static void out_of_memory(void) { /* TODO: deal with out of memory errors */ error("out of memory"); } void * xmalloc(size_t size) { register void *p = malloc(size); if (!p) out_of_memory(); return p; } void * xcalloc(size_t nmemb, size_t size) { register size_t nbytes = nmemb * size; register void *p = xmalloc(nbytes); return memset(p, nbytes, 0); } char * xstrdup(const char *s) { register size_t len = strlen(s); register char *p = xmalloc(len); return memcpy(p, s, len); } void * xrealloc(void *buff, register size_t size) { register void *p = realloc(buff, size); if (!p) out_of_memory(); return p; }
#include <stdlib.h> #include <string.h> #include <stdint.h> #include "cc.h" static void out_of_memory(void) { /* TODO: deal with out of memory errors */ error("out of memory"); } void * xmalloc(size_t size) { register void *p = malloc(size); if (!p) out_of_memory(); return p; } void * xcalloc(size_t nmemb, size_t size) { register size_t nbytes = nmemb * size; register void *p = xmalloc(nbytes); return memset(p, nbytes, 0); } char * xstrdup(const char *s) { register size_t len = strlen(s) + 1; register char *p = xmalloc(len); return memcpy(p, s, len); } void * xrealloc(void *buff, register size_t size) { register void *p = realloc(buff, size); if (!p) out_of_memory(); return p; }
Copy end of string in xstrdup
Copy end of string in xstrdup the size of a string is length of the string + 1 due to the end of string.
C
mit
8l/scc,k0gaMSX/kcc,k0gaMSX/scc,8l/scc,k0gaMSX/scc,k0gaMSX/kcc,k0gaMSX/scc,8l/scc
ef8d82cda10d56ecc64ec8342a6430e50a757d24
tests/break.c
tests/break.c
int main(void) { int i = 0; while (1) { if (i == 42) break; i += 1; } return i; }
int main(void) { int i = 0;;; while (1) { if (i == 42) break; i += 1; } return i; }
Test null statements. Just because.
Test null statements. Just because.
C
bsd-3-clause
gasman/bonsai-c,gasman/bonsai-c,gasman/bonsai-c,beni55/bonsai-c,beni55/bonsai-c,beni55/bonsai-c
2c37c9e86e3741421226a464eba36e56ba66823d
Source/GsCachedArea.h
Source/GsCachedArea.h
#pragma once #include <algorithm> #include "Types.h" class CGsCachedArea { public: typedef uint64 DirtyPageHolder; enum { MAX_DIRTYPAGES_SECTIONS = 8, MAX_DIRTYPAGES = sizeof(DirtyPageHolder) * 8 * MAX_DIRTYPAGES_SECTIONS }; CGsCachedArea(); void SetArea(uint32 psm, uint32 bufPtr, uint32 bufWidth, uint32 height); std::pair<uint32, uint32> GetPageRect() const; uint32 GetPageCount() const; uint32 GetSize() const; void Invalidate(uint32, uint32); bool IsPageDirty(uint32) const; void SetPageDirty(uint32); bool HasDirtyPages() const; void ClearDirtyPages(); private: uint32 m_psm = 0; uint32 m_bufPtr = 0; uint32 m_bufWidth = 0; uint32 m_height = 0; DirtyPageHolder m_dirtyPages[MAX_DIRTYPAGES_SECTIONS]; };
#pragma once #include <utility> #include "Types.h" class CGsCachedArea { public: typedef uint64 DirtyPageHolder; enum { MAX_DIRTYPAGES_SECTIONS = 8, MAX_DIRTYPAGES = sizeof(DirtyPageHolder) * 8 * MAX_DIRTYPAGES_SECTIONS }; CGsCachedArea(); void SetArea(uint32 psm, uint32 bufPtr, uint32 bufWidth, uint32 height); std::pair<uint32, uint32> GetPageRect() const; uint32 GetPageCount() const; uint32 GetSize() const; void Invalidate(uint32, uint32); bool IsPageDirty(uint32) const; void SetPageDirty(uint32); bool HasDirtyPages() const; void ClearDirtyPages(); private: uint32 m_psm = 0; uint32 m_bufPtr = 0; uint32 m_bufWidth = 0; uint32 m_height = 0; DirtyPageHolder m_dirtyPages[MAX_DIRTYPAGES_SECTIONS]; };
Use better header for std::pair.
Use better header for std::pair.
C
bsd-2-clause
dragon788/Play-,Alloyed/Play-,LinkofHyrule89/Play-,Flav900/Play-,LinkofHyrule89/Play-,Alloyed/Play-,AbandonedCart/Play-,LinkofHyrule89/Play-,Alloyed/Play-,Flav900/Play-,Alloyed/Play-,AbandonedCart/Play-,Flav900/Play-,Alloyed/Play-,dragon788/Play-,LinkofHyrule89/Play-,Flav900/Play-,AbandonedCart/Play-,AbandonedCart/Play-,dragon788/Play-,dragon788/Play-,dragon788/Play-,AbandonedCart/Play-,LinkofHyrule89/Play-,Flav900/Play-
c30f78e6593470906a3773d21ab2f265f1f95ddc
stingraykit/metaprogramming/TypeCompleteness.h
stingraykit/metaprogramming/TypeCompleteness.h
#ifndef STINGRAYKIT_METAPROGRAMMING_TYPECOMPLETENESS_H #define STINGRAYKIT_METAPROGRAMMING_TYPECOMPLETENESS_H // Copyright (c) 2011 - 2017, GS Group, https://github.com/GSGroup // Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, // provided that the above copyright notice and this permission notice appear in all copies. // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, // WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <stingraykit/metaprogramming/CompileTimeAssert.h> namespace stingray { template < typename T > struct StaticAssertCompleteType : CompileTimeAssert<sizeof(T)> { typedef T ValueT; }; } #endif
#ifndef STINGRAYKIT_METAPROGRAMMING_TYPECOMPLETENESS_H #define STINGRAYKIT_METAPROGRAMMING_TYPECOMPLETENESS_H // Copyright (c) 2011 - 2017, GS Group, https://github.com/GSGroup // Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, // provided that the above copyright notice and this permission notice appear in all copies. // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, // WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <stingraykit/metaprogramming/CompileTimeAssert.h> namespace stingray { template < typename T > struct StaticAssertCompleteType : CompileTimeAssert<sizeof(T) == sizeof(T)> { typedef T ValueT; }; } #endif
Fix compile ui.shell, fckng non-standard behaviour
Fix compile ui.shell, fckng non-standard behaviour Revert "metaprogramming: Get rid of excess check in IsComplete" This reverts commit dc328c6712e9d23b3a58f7dd14dbdfa8e5a196db.
C
isc
GSGroup/stingraykit,GSGroup/stingraykit
f3f3e2f854b8be30789538381d47e25f4a8590cc
board/dewatt/board_fw_config.c
board/dewatt/board_fw_config.c
/* Copyright 2021 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "base_fw_config.h" #include "board_fw_config.h" bool board_is_convertible(void) { return 1; } bool board_has_kblight(void) { return (get_fw_config_field(FW_CONFIG_KBLIGHT_OFFSET, FW_CONFIG_KBLIGHT_WIDTH) == FW_CONFIG_KBLIGHT_YES); } enum board_usb_c1_mux board_get_usb_c1_mux(void) { return USB_C1_MUX_PS8818; }; enum board_usb_a1_retimer board_get_usb_a1_retimer(void) { return USB_A1_RETIMER_PS8811; };
/* Copyright 2021 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "base_fw_config.h" #include "board_fw_config.h" bool board_is_convertible(void) { return 1; } bool board_has_kblight(void) { return (get_fw_config_field(FW_CONFIG_KBLIGHT_OFFSET, FW_CONFIG_KBLIGHT_WIDTH) == FW_CONFIG_KBLIGHT_YES); } enum board_usb_c1_mux board_get_usb_c1_mux(void) { return USB_C1_MUX_PS8818; }; enum board_usb_a1_retimer board_get_usb_a1_retimer(void) { return USB_A1_RETIMER_UNKNOWN; };
Set Type A1 retimer to unknown
Dewatt: Set Type A1 retimer to unknown Let board_get_usb_a1_retimer always return USB_A1_RETIMER_UNKNOWN for Dewatt doesn't have type A port 1. BUG=none BRANCH=none TEST=EC console won't show "A1: PS8811 retimer not detected!" Signed-off-by: Sue Chen <7d23cdcf270f71747b77aeecc793a9342f6d5c9e@quanta.corp-partner.google.com> Change-Id: I9a7c292ffc739e81fd1e553617f17abd25a67564 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3346760 Reviewed-by: Rob Barnes <3ced0940a2329ce70499686f01d3d60685ec66ed@google.com>
C
bsd-3-clause
coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec
f0898d02f76cbd77206b6ef278b1da9721b7cd3d
unix/sigtables.h
unix/sigtables.h
#ifndef __POSIX_SIGNAL_SIGTABLES_H typedef struct { int signal; char *name; } Signal; typedef struct { int len; int items[]; } SignalVector; extern const Signal signals[]; extern const int nsigs; extern int max_signum; #define SIGOFFSET(SIG) ((SIG) - 1) void InitSignalTables (void); SignalVector* CreateSignalVector (void); void FreeSignalVector( SignalVector *svPtr ); int GetSignalIdFromObj ( Tcl_Interp *interp, Tcl_Obj *nameObj ); #define __POSIX_SIGNAL_SIGTABLES_H #endif /* __POSIX_SIGNAL_SIGTABLES_H */ /* vim: set ts=8 sts=4 sw=4 sts=4 noet: */
#ifndef __POSIX_SIGNAL_SIGTABLES_H typedef struct { int signal; char *name; } Signal; typedef struct { int len; int items[]; } SignalVector; MODULE_SCOPE const Signal signals[]; MODULE_SCOPE const int nsigs; MODULE_SCOPE int max_signum; #define SIGOFFSET(SIG) ((SIG) - 1) void InitSignalTables (void); SignalVector* CreateSignalVector (void); void FreeSignalVector( SignalVector *svPtr ); int GetSignalIdFromObj ( Tcl_Interp *interp, Tcl_Obj *nameObj ); #define __POSIX_SIGNAL_SIGTABLES_H #endif /* __POSIX_SIGNAL_SIGTABLES_H */ /* vim: set ts=8 sts=4 sw=4 sts=4 noet: */
Hide global data symbols related to signal tables
Hide global data symbols related to signal tables 'extern' decls for "signals", "nsigs" and "max_signum" changed to 'MODULE_SCOPE' in unix/sigtables.h to remove it from the symbol table of the generated shared object file.
C
mit
kostix/posix-signal
fde7e007a24aef7bbac5c2522e5eb7adf87f6e62
origin_solution/2.2.1750.c
origin_solution/2.2.1750.c
// Submission #3365787 #include <stdio.h> #define MAXN 8 #define TRUE 1 #define FALSE 0 int len; unsigned char used[MAXN] = { FALSE }; char s[MAXN], generated[MAXN]; void dfs(int depth) { if (depth == len) puts(generated); else { int i; for (i = 0; i < len; ++i) if (!used[i]) { used[i] = TRUE; generated[depth] = s[i]; dfs(depth + 1); used[i] = FALSE; } } } int main() { gets(s); len = strlen(s); dfs(0); return 0; }
// Submission #3365787 #include <stdio.h> #include <string.h> #define MAXN 8 #define TRUE 1 #define FALSE 0 int len; unsigned char used[MAXN] = { FALSE }; char s[MAXN], generated[MAXN]; void dfs(int depth) { if (depth == len) puts(generated); else { int i; for (i = 0; i < len; ++i) if (!used[i]) { used[i] = TRUE; generated[depth] = s[i]; dfs(depth + 1); used[i] = FALSE; } } } int main() { gets(s); len = strlen(s); dfs(0); return 0; }
Fix a warning that causes compile error in G++
Fix a warning that causes compile error in G++
C
mit
magetron/NOIP-openjudge,magetron/NOIP-openjudge,magetron/NOIP-openjudge
f8f155e4a0234874f6828a3e5df7b80bfabd352c
OpenAL32/Include/alThunk.h
OpenAL32/Include/alThunk.h
#ifndef _AL_THUNK_H_ #define _AL_THUNK_H_ #include "config.h" #include "AL/al.h" #include "AL/alc.h" #ifdef __cplusplus extern "C" { #endif #if (SIZEOF_VOIDP > SIZEOF_UINT) void alThunkInit(void); void alThunkExit(void); ALuint alThunkAddEntry(ALvoid * ptr); void alThunkRemoveEntry(ALuint index); ALvoid *alThunkLookupEntry(ALuint index); #define ALTHUNK_INIT() alThunkInit() #define ALTHUNK_EXIT() alThunkExit() #define ALTHUNK_ADDENTRY(p) alThunkAddEntry(p) #define ALTHUNK_REMOVEENTRY(i) alThunkRemoveEntry(i) #define ALTHUNK_LOOKUPENTRY(i) alThunkLookupEntry(i) #else #define ALTHUNK_INIT() #define ALTHUNK_EXIT() #define ALTHUNK_ADDENTRY(p) ((ALuint)p) #define ALTHUNK_REMOVEENTRY(i) #define ALTHUNK_LOOKUPENTRY(i) ((ALvoid*)(i)) #endif // (SIZEOF_VOIDP > SIZEOF_INT) #ifdef __cplusplus } #endif #endif //_AL_THUNK_H_
#ifndef _AL_THUNK_H_ #define _AL_THUNK_H_ #include "config.h" #include "AL/al.h" #include "AL/alc.h" #ifdef __cplusplus extern "C" { #endif void alThunkInit(void); void alThunkExit(void); ALuint alThunkAddEntry(ALvoid * ptr); void alThunkRemoveEntry(ALuint index); ALvoid *alThunkLookupEntry(ALuint index); #if (SIZEOF_VOIDP > SIZEOF_UINT) #define ALTHUNK_INIT() alThunkInit() #define ALTHUNK_EXIT() alThunkExit() #define ALTHUNK_ADDENTRY(p) alThunkAddEntry(p) #define ALTHUNK_REMOVEENTRY(i) alThunkRemoveEntry(i) #define ALTHUNK_LOOKUPENTRY(i) alThunkLookupEntry(i) #else #define ALTHUNK_INIT() #define ALTHUNK_EXIT() #define ALTHUNK_ADDENTRY(p) ((ALuint)p) #define ALTHUNK_REMOVEENTRY(i) #define ALTHUNK_LOOKUPENTRY(i) ((ALvoid*)(i)) #endif // (SIZEOF_VOIDP > SIZEOF_INT) #ifdef __cplusplus } #endif #endif //_AL_THUNK_H_
Move function declarations outside of the if-block
Move function declarations outside of the if-block
C
lgpl-2.1
irungentoo/openal-soft-tox,mmozeiko/OpenAL-Soft,jims/openal-soft,BeamNG/openal-soft,franklixuefei/openal-soft,franklixuefei/openal-soft,irungentoo/openal-soft-tox,arkana-fts/openal-soft,mmozeiko/OpenAL-Soft,EddieRingle/openal-soft,arkana-fts/openal-soft,jims/openal-soft,soundsrc/openal-soft,Wemersive/openal-soft,BeamNG/openal-soft,rryan/openal-soft,soundsrc/openal-soft,dapetcu21/openal-soft,cambridgehackers/klaatu-openal-soft,cambridgehackers/klaatu-openal-soft,cambridgehackers/klaatu-openal-soft,Wemersive/openal-soft,alexxvk/openal-soft,rryan/openal-soft,EddieRingle/openal-soft,aaronmjacobs/openal-soft,alexxvk/openal-soft,AerialX/openal-soft-android,aaronmjacobs/openal-soft,zorbathut/opengal32
20b4571885e837eb121a5e51529f0159fb41dd84
include/abort.h
include/abort.h
// abort.h // hdpirun // // Utility header to abort the program on an unrecoverable error. Prints the message (printf format) and closes any open resources // // Author: Robbie Duncan // Copyright: Copyright (c) 2016 Robbie Duncan // License: See LICENSE // #import "log.h" #import <stdio.h> #ifndef ABORT_H #define ABORT_H #define __ABORT(message,...) __LOG(__LOG_CRITICAL,message,##__VA_ARGS__);if (__logFile!=stdout){fclose(__logFile);};exit(1); #endif
// abort.h // hdpirun // // Utility header to abort the program on an unrecoverable error. Prints the message (printf format) and closes any open resources // // Author: Robbie Duncan // Copyright: Copyright (c) 2016 Robbie Duncan // License: See LICENSE // #import "log.h" #import <stdio.h> #ifndef ABORT_H #define ABORT_H #define ABORT(message,...) __LOG(__LOG_CRITICAL,message,##__VA_ARGS__);if (__logFile!=stdout){fclose(__logFile);};exit(1); #endif
Remove leading underscores as part of style clean up
Remove leading underscores as part of style clean up
C
mit
robbieduncan/hdpirun,robbieduncan/hdpirun
19b628dfc60eda4459b65e4b6b7a748932d28929
drivers/scsi/qla4xxx/ql4_version.h
drivers/scsi/qla4xxx/ql4_version.h
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2010 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k11"
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2010 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k12"
Update driver version to 5.02.00-k12
[SCSI] qla4xxx: Update driver version to 5.02.00-k12 Signed-off-by: Vikas Chaudhary <c251871a64d7d31888eace0406cb3d4c419d5f73@qlogic.com> Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Parallels.com>
C
apache-2.0
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,KristFoundation/Programs
9c1035bc14a399b6bf5d45a8cce233d0fc340c53
src/file/keydb.h
src/file/keydb.h
/* encrypted keys */ static const uint32_t internal_device_number = 0; static const uint8_t internal_dk_list[][21] = { { }, }; static const uint8_t internal_pk_list[][16] = { { }, }; static const uint8_t internal_hc_list[][112] = { { }, }; /* customize this function to "hide" the keys in the binary */ static void decrypt_key(uint8_t *out, const uint8_t *in, size_t size) { memcpy(out, in, size); }
/* encrypted keys */ static const uint32_t internal_device_number = 0; static const uint8_t internal_dk_list[][21] = { { 0 }, }; static const uint8_t internal_pk_list[][16] = { { 0 }, }; static const uint8_t internal_hc_list[][112] = { { 0 }, }; /* customize this function to "hide" the keys in the binary */ static void decrypt_key(uint8_t *out, const uint8_t *in, size_t size) { memcpy(out, in, size); }
Fix MSVC error C2133 : unknown size of multi-dimensional static const arrays (despite supposed support of C99). Have not confirmed if this breaks anything yet.
Fix MSVC error C2133 : unknown size of multi-dimensional static const arrays (despite supposed support of C99). Have not confirmed if this breaks anything yet.
C
lgpl-2.1
mwgoldsmith/aacs,mwgoldsmith/aacs
a39391dbdd26b3c6aaa4ffa2a4a7f50e4982d175
src/command/command_version.c
src/command/command_version.c
#include "server/bedrock.h" #include "server/command.h" void command_version(struct bedrock_client *client, int bedrock_attribute_unused argc, const char bedrock_attribute_unused **argv) { command_reply(client, "Bedrock version %d.%d%s Compiled on %s %s.", BEDROCK_VERSION_MAJOR, BEDROCK_VERSION_MINOR, BEDROCK_VERSION_EXTRA, __DATE__, __TIME__); }
#include "server/bedrock.h" #include "server/command.h" void command_version(struct bedrock_client *client, int bedrock_attribute_unused argc, const char bedrock_attribute_unused **argv) { command_reply(client, "Bedrock version %d.%d%s, built on %s %s.", BEDROCK_VERSION_MAJOR, BEDROCK_VERSION_MINOR, BEDROCK_VERSION_EXTRA, __DATE__, __TIME__); }
Change /version output to be more like -version
Change /version output to be more like -version
C
bsd-2-clause
Adam-/bedrock,Adam-/bedrock
9767f98ff5b6486b06e7bc5af8a761f6e5d3f82a
static_ar_param.c
static_ar_param.c
int f(int x[static volatile /*const*/ 10]) { return *++x; } main() { int x[5]; x[1] = 2; f(x); //int y[1]; //int *y; //#define y (void *)0 //pipe(y); }
int f(int x[static /*const*/ 10]) { return *++x; } main() { int x[5]; x[1] = 2; f(x); //int y[1]; //int *y; //#define y (void *)0 //pipe(y); }
Remove volatile from test (decl_equal doesn't check properly for now)
Remove volatile from test (decl_equal doesn't check properly for now)
C
mit
8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler
a2259e17b7c657ddeb0c3a03a5ca291ca4e0dc7e
include/llvm/Support/SystemUtils.h
include/llvm/Support/SystemUtils.h
//===- SystemUtils.h - Utilities to do low-level system stuff ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains functions used to do a variety of low-level, often // system-specific, tasks. // //===----------------------------------------------------------------------===// #ifndef LLVM_SUPPORT_SYSTEMUTILS_H #define LLVM_SUPPORT_SYSTEMUTILS_H #include <string> namespace llvm { class raw_ostream; namespace sys { class Path; } /// Determine if the raw_ostream provided is connected to the outs() and /// displayed or not (to a console window). If so, generate a warning message /// advising against display of bitcode and return true. Otherwise just return /// false /// @brief Check for output written to a console bool CheckBitcodeOutputToConsole( raw_ostream &stream_to_check, ///< The stream to be checked bool print_warning = true ///< Control whether warnings are printed ); /// FindExecutable - Find a named executable, giving the argv[0] of program /// being executed. This allows us to find another LLVM tool if it is built in /// the same directory. If the executable cannot be found, return an /// empty string. /// @brief Find a named executable. sys::Path FindExecutable(const std::string &ExeName, const char *Argv0, void *MainAddr); } // End llvm namespace #endif
//===- SystemUtils.h - Utilities to do low-level system stuff ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains functions used to do a variety of low-level, often // system-specific, tasks. // //===----------------------------------------------------------------------===// #ifndef LLVM_SUPPORT_SYSTEMUTILS_H #define LLVM_SUPPORT_SYSTEMUTILS_H #include <string> namespace llvm { class raw_ostream; namespace sys { class Path; } /// Determine if the raw_ostream provided is connected to a terminal. If so, /// generate a warning message to errs() advising against display of bitcode /// and return true. Otherwise just return false. /// @brief Check for output written to a console bool CheckBitcodeOutputToConsole( raw_ostream &stream_to_check, ///< The stream to be checked bool print_warning = true ///< Control whether warnings are printed ); /// FindExecutable - Find a named executable, giving the argv[0] of program /// being executed. This allows us to find another LLVM tool if it is built in /// the same directory. If the executable cannot be found, return an /// empty string. /// @brief Find a named executable. sys::Path FindExecutable(const std::string &ExeName, const char *Argv0, void *MainAddr); } // End llvm namespace #endif
Reword this comment. Don't mention outs(), as that's not what this code is actually testing for.
Reword this comment. Don't mention outs(), as that's not what this code is actually testing for. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@112767 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap
9dbc3499ffe79aad16cb5d583a895ab045771814
src/qmapboxgl_p.h
src/qmapboxgl_p.h
#ifndef QMAPBOXGL_P_H #define QMAPBOXGL_P_H #include <mbgl/map/map.hpp> #include <mbgl/map/view.hpp> #include <mbgl/storage/default_file_source.hpp> namespace mbgl { class Map; class FileSource; } // namespace mbgl class QOpenGLContext; class QMapboxGLPrivate : public mbgl::View { public: explicit QMapboxGLPrivate(QMapboxGL *q); virtual ~QMapboxGLPrivate(); // mbgl::View implementation. void activate() override {} void deactivate() override; void notify() override {} void invalidate(std::function<void()> renderCallback) override; mbgl::DefaultFileSource fileSource; mbgl::Map map; int lastX = 0; int lastY = 0; QOpenGLContext *context = nullptr; QMapboxGL *q_ptr; }; #endif // QMAPBOXGL_P_H
#ifndef QMAPBOXGL_P_H #define QMAPBOXGL_P_H #include <mbgl/map/map.hpp> #include <mbgl/map/view.hpp> #include <mbgl/storage/default_file_source.hpp> namespace mbgl { class Map; class FileSource; } // namespace mbgl class QOpenGLContext; class QMapboxGLPrivate : public mbgl::View { public: explicit QMapboxGLPrivate(QMapboxGL *q); virtual ~QMapboxGLPrivate(); // mbgl::View implementation. void activate() final {} void deactivate() final; void notify() final {} void invalidate(std::function<void()> renderCallback) final; mbgl::DefaultFileSource fileSource; mbgl::Map map; int lastX = 0; int lastY = 0; QOpenGLContext *context = nullptr; QMapboxGL *q_ptr; }; #endif // QMAPBOXGL_P_H
Use final for virtual methods on private impl of mbgl::View
Use final for virtual methods on private impl of mbgl::View This is a private implementation, so we know that no one else will inherit from that.
C
bsd-2-clause
tmpsantos/qmapboxgl
207e799a003fc63548402e00f382046b1dbf9a17
src/tokenizers/strspn.h
src/tokenizers/strspn.h
#ifndef SIMHASH_TOKENIZERS__UTIL_H #define SIMHASH_TOKENIZERS__UTIL_H #include <string.h> namespace Simhash { struct Strspn { /* Return the length of the token starting at last */ const char* operator()(const char* last) { size_t s = strspn(last, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); return (*last != '\0') ? last + s : NULL; } }; } #endif
#ifndef SIMHASH_TOKENIZERS_STRSPN_H #define SIMHASH_TOKENIZERS_STRSPN_H #include <string.h> namespace Simhash { struct Strspn { /* Return the length of the token starting at last */ const char* operator()(const char* last) { size_t s = strspn(last, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); return (*last != '\0') ? last + s : NULL; } }; } #endif
Fix illegal (double underscore) include guard.
Fix illegal (double underscore) include guard.
C
mit
pombredanne/simhash-cpp,pombredanne/simhash-cpp,seomoz/simhash-cpp,seomoz/simhash-cpp
99140205fe727eda9ca88ecb93f954651d2d9fd3
src/unix_core.c
src/unix_core.c
/* * This file is covered by the Internet Software Consortium (ISC) License * Reference: ../License.txt * * __nohang_waitpid is linked directly into Synth but it's related to synthexec * so let's keep the C files together. * return: * 0 when process is still running * 1 when process exited normally * 2 when process exited with error * * __launch_process takes a pointer to an array of null-terminated string * pointers are returns the pid of the child process, or -1 upon failure */ #include <sys/types.h> #include <sys/wait.h> u_int8_t __nohang_waitpid (pid_t process_pid) { int status = 0; int pid = waitpid (process_pid, &status, WNOHANG); if (pid == 0) { return 0; } if (WIFEXITED (status) && (WEXITSTATUS (status) == 0)) { return 1; } else { return 2; } }
/* * This file is covered by the Internet Software Consortium (ISC) License * Reference: ../License.txt * * __nohang_waitpid is linked directly into Synth but it's related to synthexec * so let's keep the C files together. * return: * 0 when process is still running * 1 when process exited normally * 2 when process exited with error */ #include <sys/types.h> #include <sys/wait.h> u_int8_t __nohang_waitpid (pid_t process_pid) { int status = 0; int pid = waitpid (process_pid, &status, WNOHANG); if (pid == 0) { return 0; } if (WIFEXITED (status) && (WEXITSTATUS (status) == 0)) { return 1; } else { return 2; } }
Remove comment that is no longer applicable
Remove comment that is no longer applicable
C
isc
jrmarino/synth,jrmarino/synth,jrmarino/synth,jrmarino/synth
193366492715a171a398c68b874b5a4d9264718a
UIforETW/Version.h
UIforETW/Version.h
#pragma once // const float in a header file can lead to duplication of the storage // but I don't really care in this case. Just don't do it with a header // that is included hundreds of times. const float kCurrentVersion = 1.40f;
#pragma once // const float in a header file can lead to duplication of the storage // but I don't really care in this case. Just don't do it with a header // that is included hundreds of times. const float kCurrentVersion = 1.41f;
Increment version number to 1.41
Increment version number to 1.41
C
apache-2.0
ariccio/UIforETW,ariccio/UIforETW,ariccio/UIforETW,mwinterb/UIforETW,mwinterb/UIforETW,google/UIforETW,google/UIforETW,MikeMarcin/UIforETW,mwinterb/UIforETW,google/UIforETW,MikeMarcin/UIforETW,MikeMarcin/UIforETW,ariccio/UIforETW,google/UIforETW
49b8e80371bfa380dd34168a92d98b639ca1202a
src/test.c
src/test.c
#include "redislite.h" #include <string.h> static void test_add_key(redislite *db) { int rnd = arc4random(); char key[14]; sprintf(key, "%d", rnd); int size = strlen(key); redislite_insert_key(db, key, size, 0); } int main() { redislite *db = redislite_open_database("test.db"); int i; for (i=0; i < 100; i++) test_add_key(db); redislite_close_database(db); return 0; }
#include "redislite.h" #include <string.h> static void test_add_key(redislite *db) { int rnd = rand(); char key[14]; sprintf(key, "%d", rnd); int size = strlen(key); redislite_insert_key(db, key, size, 0); } int main() { redislite *db = redislite_open_database("test.db"); int i; for (i=0; i < 100; i++) test_add_key(db); redislite_close_database(db); return 0; }
Use rand instead of arc4random (linux doesn't support it)
Use rand instead of arc4random (linux doesn't support it)
C
bsd-2-clause
seppo0010/redislite,seppo0010/redislite,pombredanne/redislite,pombredanne/redislite
d5c5dedbd8284dc6e20d1c86f370a025ad5c3d25
fq/indexed_array_queue.h
fq/indexed_array_queue.h
/* * 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
/* * 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
Remove unused members in fqindexedarray structure
Remove unused members in fqindexedarray structure
C
apache-2.0
byannoni/qthreads
df538417a40cde965fa2d16ceab38322b17a8097
iOS/PlayPlan/Profile/ProfileViewController.h
iOS/PlayPlan/Profile/ProfileViewController.h
// // ProfileViewController.h // PlayPlan // // Created by Zeacone on 15/11/8. // Copyright © 2015年 Zeacone. All rights reserved. // #import <UIKit/UIKit.h> #import "PlayPlan.h" @class ProfileViewController; @protocol MainDelegate <NSObject> - (void)dismissViewController:(MainViewController *)mainViewController; @end @interface ProfileViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> @end
// // ProfileViewController.h // PlayPlan // // Created by Zeacone on 15/11/8. // Copyright © 2015年 Zeacone. All rights reserved. // #import <UIKit/UIKit.h> #import "PlayPlan.h" @class ProfileViewController; @protocol MainDelegate <NSObject> - (void)dismissViewController:(ProfileViewController *)mainViewController; @end @interface ProfileViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> @end
Add delegate for profile view controller.
Add delegate for profile view controller.
C
mit
Zeacone/PlayPlan,Zeacone/PlayPlan
ee2ec81c8667f117fdbd4e3c02dce9170eefd221
VYNFCKit/VYNFCNDEFPayloadParser.h
VYNFCKit/VYNFCNDEFPayloadParser.h
// // VYNFCNDEFPayloadParser.h // VYNFCKit // // Created by Vince Yuan on 7/8/17. // Copyright © 2017 Vince Yuan. All rights reserved. // // This source code is licensed under the MIT-style license found in the // LICENSE file in the root directory of this source tree. // #import <Foundation/Foundation.h> @class NFCNDEFPayload, VYNFCNDEFMessageHeader; @interface VYNFCNDEFPayloadParser : NSObject + (nullable id)parse:(nullable NFCNDEFPayload *)payload; + (nullable VYNFCNDEFMessageHeader *)parseMessageHeader:(nullable unsigned char*)payloadBytes length:(NSUInteger)length; @end
// // VYNFCNDEFPayloadParser.h // VYNFCKit // // Created by Vince Yuan on 7/8/17. // Copyright © 2017 Vince Yuan. All rights reserved. // // This source code is licensed under the MIT-style license found in the // LICENSE file in the root directory of this source tree. // #import <Foundation/Foundation.h> @class NFCNDEFPayload, VYNFCNDEFMessageHeader; API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(watchos, macos, tvos) @interface VYNFCNDEFPayloadParser : NSObject + (nullable id)parse:(nullable NFCNDEFPayload *)payload; + (nullable VYNFCNDEFMessageHeader *)parseMessageHeader:(nullable unsigned char*)payloadBytes length:(NSUInteger)length; @end
Remove partial availability warning by adding API_AVAILABLE.
Remove partial availability warning by adding API_AVAILABLE.
C
mit
vinceyuan/VYNFCKit,vinceyuan/VYNFCKit
9075cf1aa531252ffd4b97bddcbc4ca702da5436
utils.c
utils.c
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; }
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; }
Implement dirty unallocatable memory mapped alloc.
Implement dirty unallocatable memory mapped alloc.
C
mit
frostburn/tinytsumego,frostburn/tinytsumego
1585507cfb362f92a5dd711a91dc69b6b0314e18
include/lldb/Host/Config.h
include/lldb/Host/Config.h
//===-- Config.h ------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLDB_HOST_CONFIG_H #define LLDB_HOST_CONFIG_H #if defined(__APPLE__) // This block of code only exists to keep the Xcode project working in the // absence of a configuration step. #define LLDB_CONFIG_TERMIOS_SUPPORTED 1 #define HAVE_SYS_EVENT_H 1 #define HAVE_PPOLL 0 #else #error This file is only used by the Xcode build. #endif #endif // #ifndef LLDB_HOST_CONFIG_H
//===-- Config.h ------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLDB_HOST_CONFIG_H #define LLDB_HOST_CONFIG_H #if defined(__APPLE__) // This block of code only exists to keep the Xcode project working in the // absence of a configuration step. #define LLDB_CONFIG_TERMIOS_SUPPORTED 1 #define HAVE_SYS_EVENT_H 1 #define HAVE_PPOLL 0 #define HAVE_SIGACTION 1 #else #error This file is only used by the Xcode build. #endif #endif // #ifndef LLDB_HOST_CONFIG_H
Define HAVE_SIGACTION to 1 in Xcode build
Define HAVE_SIGACTION to 1 in Xcode build This is needed to make the Xcode project build since it doesn't have auto-generated Config header. git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@300618 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb
749d1b8b2b92a439056026d3a2490f14db6ce688
Ray/Ray/Material.h
Ray/Ray/Material.h
#pragma once #include "Vector3.h" typedef Vector3 Color; class Material { public: Material(); virtual ~Material(); void setColor(Color& color); Color getColor(void) const; void setDiffuse(double diffuse); double getDiffuse(void) const; void setReflection(double refl); double GetReflection(void) const; double getSpecular(void) const; protected: Color color; float refl; float diff; };
#pragma once #include "Vector3.h" typedef Vector3 Color; class Material { public: Material(); virtual ~Material(); void setColor(Color& color); Color getColor(void) const; void setDiffuse(double diffuse); double getDiffuse(void) const; void setReflection(double refl); double GetReflection(void) const; double getSpecular(void) const; protected: Color color; double refl; double diff; };
Fix double / float mismatch
Fix double / float mismatch
C
mit
vsiles/RayEngine,vsiles/RayEngine
bcc37130a7535a1ebea95afcf67a323b17683f4d
IAAI.c
IAAI.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #define STTY "/bin/stty " const char RAW[] = STTY "raw"; const char COOKED[] = STTY "cooked"; const char default_str[] = "I AM AN IDIOT "; int main(int argc, char **argv) { system(RAW); const char *str; if ( argc == 2 ) str = argv[1]; else str = default_str; size_t len = strlen(str); while ( 1 ) { for ( size_t i = 0 ; i < len ; i++ ) { getchar(); printf("\r"); for ( size_t j = 0 ; j <= i ; j++ ) { printf("%c", str[j]); } } system(COOKED); printf("\n"); system(RAW); } return 0; }
#include <stdio.h> #include <stdlib.h> #include <string.h> #define STTY "/bin/stty " const char RAW[] = STTY "raw"; const char COOKED[] = STTY "cooked"; const char default_str[] = "I AM AN IDIOT "; int main(int argc, char **argv) { system(RAW); const char *str; if ( argc == 2 ) str = argv[1]; else str = default_str; size_t len = strlen(str); while ( 1 ) { for ( size_t i = 0 ; i < len ; i++ ) { getchar(); printf("\x1b[2K\r"); for ( size_t j = 0 ; j <= i ; j++ ) { printf("%c", str[j]); } } system(COOKED); printf("\n"); system(RAW); } return 0; }
Use ANSI sequences to ensure line clearing
Use ANSI sequences to ensure line clearing
C
mit
vinamarora8/IAAI
3227e32b40e6c3749cb869f925e2b194a409dfa3
sql/backends/monet5/sql_readline.h
sql/backends/monet5/sql_readline.h
/* * The contents of this file are subject to the MonetDB Public License * Version 1.1 (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.monetdb.org/Legal/MonetDBLicense * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Original Code is the MonetDB Database System. * * The Initial Developer of the Original Code is CWI. * Portions created by CWI are Copyright (C) 1997-July 2008 CWI. * Copyright August 2008-2012 MonetDB B.V. * All Rights Reserved. */ #ifndef SQL_READLINETOOLS_H_INCLUDED #define SQL_READLINETOOLS_H_INCLUDED #include "mal_client.h" sql5_export int SQLreadConsole(Client cntxt); #endif /* SQL_READLINETOOLS_H_INCLUDED */
/* * The contents of this file are subject to the MonetDB Public License * Version 1.1 (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.monetdb.org/Legal/MonetDBLicense * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Original Code is the MonetDB Database System. * * The Initial Developer of the Original Code is CWI. * Portions created by CWI are Copyright (C) 1997-July 2008 CWI. * Copyright August 2008-2012 MonetDB B.V. * All Rights Reserved. */ #ifndef SQL_READLINETOOLS_H_INCLUDED #define SQL_READLINETOOLS_H_INCLUDED #ifdef WIN32 #ifndef LIBSQL #define sql5_export extern __declspec(dllimport) #else #define sql5_export extern __declspec(dllexport) #endif #else #define sql5_export extern #endif #include "mal_client.h" sql5_export int SQLreadConsole(Client cntxt); #endif /* SQL_READLINETOOLS_H_INCLUDED */
Define sql5_export so that things compile.
Define sql5_export so that things compile.
C
mpl-2.0
zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb
a0770fe0570e07eadb02a84fa8f14ea4399805b7
You-DataStore/internal/operation.h
You-DataStore/internal/operation.h
#pragma once #ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_ #define YOU_DATASTORE_INTERNAL_OPERATION_H_ #include <unordered_map> #include "../task_typedefs.h" namespace You { namespace DataStore { /// A pure virtual class of operations to be put into transaction stack class IOperation { public: /// The constructor /// \param stask the serialized task the operation need to work with explicit IOperation(SerializedTask& stask); virtual ~IOperation(); /// Executes the operation virtual bool run() = 0; protected: TaskId taskId; SerializedTask task; }; } // namespace DataStore } // namespace You #endif // YOU_DATASTORE_INTERNAL_OPERATION_H_
#pragma once #ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_ #define YOU_DATASTORE_INTERNAL_OPERATION_H_ #include <unordered_map> #include "../task_typedefs.h" namespace You { namespace DataStore { /// A pure virtual class of operations to be put into transaction stack class IOperation { public: /// Executes the operation virtual bool run() = 0; protected: TaskId taskId; SerializedTask task; }; } // namespace DataStore } // namespace You #endif // YOU_DATASTORE_INTERNAL_OPERATION_H_
Remove ctor and dtor of IOperation to make it a pure virtual class
Remove ctor and dtor of IOperation to make it a pure virtual class
C
mit
cs2103aug2014-w10-1c/main,cs2103aug2014-w10-1c/main
85d3e8a4eb0d0e9670ae66c699f39c4d5380d246
OpenROV/AConfig.h
OpenROV/AConfig.h
#ifndef __ACONFIG_H_ #define __ACONFIG_H_ /* This must be before alphabetically before all other files that reference these settings for the compiler to work * or you may get vtable errors. */ /* This section is for devices and their configuration. IF you have not setup you pins with the * standard configuration of the OpenROV kits, you should probably clone the cape or controlboard * and change the pin definitions there. Things not wired to specific pins but on the I2C bus will * have the address defined in this file. */ //Kit: #define HAS_STD_CAPE (0) #define HAS_STD_PILOT (1) #define HAS_OROV_CONTROLLERBOARD_25 (0) #define HAS_STD_LIGHTS (1) #define HAS_STD_CALIBRATIONLASERS (0) #define HAS_STD_2X1_THRUSTERS (1) #define HAS_STD_CAMERAMOUNT (1) //After Market: #define HAS_POLOLU_MINIMUV (0) #define HAS_MS5803_14BA (0) #define MS5803_14BA_I2C_ADDRESS 0x76 #define HAS_MPU9150 (0) #define MPU9150_EEPROM_START 2 #endif
#ifndef __ACONFIG_H_ #define __ACONFIG_H_ /* This must be before alphabetically before all other files that reference these settings for the compiler to work * or you may get vtable errors. */ /* This section is for devices and their configuration. IF you have not setup you pins with the * standard configuration of the OpenROV kits, you should probably clone the cape or controlboard * and change the pin definitions there. Things not wired to specific pins but on the I2C bus will * have the address defined in this file. */ //Kit: #define HAS_STD_PILOT (1) /* The definitions are done in th #define HAS_STD_CAPE (0) #define HAS_OROV_CONTROLLERBOARD_25 (0) */ #include "BoardConfig.h" #define HAS_STD_LIGHTS (1) #define HAS_STD_CALIBRATIONLASERS (1) #define HAS_STD_2X1_THRUSTERS (1) #define HAS_STD_CAMERAMOUNT (1) //After Market: #define HAS_POLOLU_MINIMUV (0) #define HAS_MS5803_14BA (0) #define MS5803_14BA_I2C_ADDRESS 0x76 #define HAS_MPU9150 (0) #define MPU9150_EEPROM_START 2 #endif
Add automation for arduino board selection for compilation
Add automation for arduino board selection for compilation
C
mit
LeeCheongAh/openrov-software-arduino,OpenROV/openrov-software-arduino,LeeCheongAh/openrov-software-arduino,spiderkeys/openrov-software-arduino,dieface/openrov-software-arduino,dieface/openrov-software-arduino,spiderkeys/openrov-software-arduino,OpenROV/openrov-software-arduino,johan--/openrov-software-arduino,BrianAdams/openrov-software-arduino,BrianAdams/openrov-software-arduino,johan--/openrov-software-arduino,binary42/openrov-software-arduino,OpenROV/openrov-software-arduino,binary42/openrov-software-arduino
e90c7729467108ffd6f813ade011c7ec5ced9680
crypto/opensslv.h
crypto/opensslv.h
#ifndef HEADER_OPENSSLV_H #define HEADER_OPENSSLV_H #define OPENSSL_VERSION_NUMBER 0x0923 /* Version 0.9.1c is 0913 */ #define OPENSSL_VERSION_TEXT "OpenSSL 0.9.2c 01 Apr 1999" #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT #endif /* HEADER_OPENSSLV_H */
#ifndef HEADER_OPENSSLV_H #define HEADER_OPENSSLV_H /* Numeric release version identifier: * MMNNFFRBB: major minor fix final beta/patch * For example: * 0.9.3-dev 0x00903000 * 0.9.3beta1 0x00903001 * 0.9.3 0x00903100 * 0.9.3a 0x00903101 * 1.2.3z 0x1020311a */ #define OPENSSL_VERSION_NUMBER 0x00903000L #define OPENSSL_VERSION_TEXT "OpenSSL 0.9.3-dev 19 May 1999" #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT #endif /* HEADER_OPENSSLV_H */
Switch to new version numbering scheme.
Switch to new version numbering scheme.
C
apache-2.0
openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl
b0ce1a387ce1c86b8b0008518a99d786006d1f32
include/llvm/Config/dlfcn.h
include/llvm/Config/dlfcn.h
/* * The LLVM Compiler Infrastructure * * This file was developed by the LLVM research group and is distributed under * the University of Illinois Open Source License. See LICENSE.TXT for details. * ****************************************************************************** * * Description: * This header file is the autoconf replacement for dlfcn.h (if it lives * on the system). */ #ifndef _CONFIG_DLFCN_H #define _CONFIG_DLFCN_H #include "llvm/Config/config.h" #ifdef HAVE_DLFCN_H #include <dlfcn.h> #endif #endif
/* * The LLVM Compiler Infrastructure * * This file was developed by the LLVM research group and is distributed under * the University of Illinois Open Source License. See LICENSE.TXT for details. * ****************************************************************************** * * Description: * This header file is the autoconf replacement for dlfcn.h (if it lives * on the system). */ #ifndef _CONFIG_DLFCN_H #define _CONFIG_DLFCN_H #include "llvm/Config/config.h" #ifdef HAVE_LTDL_H #include <ltdl.h> #endif #ifdef HAVE_DLFCN_H #include <dlfcn.h> #endif #endif
Include ltdl.h if we have it.
Include ltdl.h if we have it. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@17952 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap
422ff0407a087d851e93a5ff93b1461bcdd49068
include/socketcan/can/raw.h
include/socketcan/can/raw.h
/* * socketcan/can/raw.h * * Definitions for raw CAN sockets * * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> * Urs Thuermann <urs.thuermann@volkswagen.de> * Copyright (c) 2002-2007 Volkswagen Group Electronic Research * All rights reserved. * */ #ifndef CAN_RAW_H #define CAN_RAW_H #include <socketcan/can.h> #define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW) /* for socket options affecting the socket (not the global system) */ enum { CAN_RAW_FILTER = 1, /* set 0 .. n can_filter(s) */ CAN_RAW_ERR_FILTER, /* set filter for error frames */ CAN_RAW_LOOPBACK, /* local loopback (default:on) */ CAN_RAW_RECV_OWN_MSGS, /* receive my own msgs (default:off) */ CAN_RAW_FD_FRAMES, /* allow CAN FD frames (default:off) */ }; #endif
/* * socketcan/can/raw.h * * Definitions for raw CAN sockets * * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> * Urs Thuermann <urs.thuermann@volkswagen.de> * Copyright (c) 2002-2007 Volkswagen Group Electronic Research * All rights reserved. * */ #ifndef CAN_RAW_H #define CAN_RAW_H #include <socketcan/can.h> #define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW) /* for socket options affecting the socket (not the global system) */ enum { CAN_RAW_FILTER = 1, /* set 0 .. n can_filter(s) */ CAN_RAW_ERR_FILTER, /* set filter for error frames */ CAN_RAW_LOOPBACK, /* local loopback (default:on) */ CAN_RAW_RECV_OWN_MSGS, /* receive my own msgs (default:off) */ CAN_RAW_FD_FRAMES /* allow CAN FD frames (default:off) */ }; #endif
Fix compiler warning about redundant comma
Fix compiler warning about redundant comma
C
mit
entropia/libsocket-can-java,entropia/libsocket-can-java,entropia/libsocket-can-java
a2bde6cb8af902bdeef1fec4677f7fd48bab1c10
src/apricosterm.h
src/apricosterm.h
#ifndef APRTERM_H #define APRTERM_H #include <SDL2/SDL.h> #ifndef VERSION #define VERSION "UNKNOWN" #endif /* VERSION */ #ifndef RESOURCE_DIR #define RESOURCE_DIR "." #endif /* RESOURCE_DIR */ /* Font info */ #define FONT_FILE "vga8x16.png" #define CHAR_WIDTH 8 #define CHAR_HEIGHT 16 #define FONT_COLS 32 #define FONT_LINES 8 /* Screen info */ #define SCREEN_WIDTH 640 #define SCREEN_HEIGHT 480 #define SCREEN_ROWS (SCREEN_HEIGHT / CHAR_HEIGHT) #define SCREEN_COLS (SCREEN_WIDTH / CHAR_WIDTH) /* Terminal settings */ #define BACKGROUND_COLOR {0, 0, 0, 255} #define FOREGROUND_COLOR EGA_GRAY #endif /* APRTERM_H */
#ifndef APRTERM_H #define APRTERM_H #include <SDL2/SDL.h> #ifndef VERSION #define VERSION "UNKNOWN" #endif /* VERSION */ #ifndef RESOURCE_DIR #define RESOURCE_DIR "." #endif /* RESOURCE_DIR */ /* Font info */ #define FONT_FILE "vga8x16.png" #define CHAR_WIDTH 8 #define CHAR_HEIGHT 16 #define FONT_COLS 32 #define FONT_LINES 8 /* Screen info */ #define SCREEN_WIDTH 640 #define SCREEN_HEIGHT 480 #define SCREEN_ROWS (SCREEN_HEIGHT / CHAR_HEIGHT) #define SCREEN_COLS (SCREEN_WIDTH / CHAR_WIDTH) /* Terminal settings */ #define BACKGROUND_COLOR EGA_BLACK #define FOREGROUND_COLOR EGA_GRAY #endif /* APRTERM_H */
Use EGA color constant for background
Use EGA color constant for background
C
mit
drdanick/apricosterm
bcaf6d41b80ac74122a9b5daa87e329348dbf094
src/core/lib/gprpp/optional.h
src/core/lib/gprpp/optional.h
/* * * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #ifndef GRPC_CORE_LIB_GPRPP_OPTIONAL_H #define GRPC_CORE_LIB_GPRPP_OPTIONAL_H namespace grpc_core { /* A make-shift alternative for absl::Optional. This can be removed in favor of * that once absl dependencies can be introduced. */ template <typename T> class Optional { public: Optional() : value_() {} void set(const T& val) { value_ = val; set_ = true; } bool has_value() const { return set_; } void reset() { set_ = false; } T value() const { return value_; } private: T value_; bool set_ = false; }; } /* namespace grpc_core */ #endif /* GRPC_CORE_LIB_GPRPP_OPTIONAL_H */
/* * * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #ifndef GRPC_CORE_LIB_GPRPP_OPTIONAL_H #define GRPC_CORE_LIB_GPRPP_OPTIONAL_H #include <grpc/support/port_platform.h> #include <utility> namespace grpc_core { /* A make-shift alternative for absl::Optional. This can be removed in favor of * that once absl dependencies can be introduced. */ template <typename T> class Optional { public: Optional() : value_() {} void set(const T& val) { value_ = val; set_ = true; } void set(T&& val) { value_ = std::move(val); set_ = true; } bool has_value() const { return set_; } void reset() { set_ = false; } T value() const { return value_; } private: T value_; bool set_ = false; }; } /* namespace grpc_core */ #endif /* GRPC_CORE_LIB_GPRPP_OPTIONAL_H */
Add move assignment method to Optional<>
Add move assignment method to Optional<>
C
apache-2.0
jtattermusch/grpc,stanley-cheung/grpc,firebase/grpc,jboeuf/grpc,grpc/grpc,ejona86/grpc,ctiller/grpc,donnadionne/grpc,stanley-cheung/grpc,nicolasnoble/grpc,donnadionne/grpc,vjpai/grpc,jboeuf/grpc,ejona86/grpc,stanley-cheung/grpc,vjpai/grpc,firebase/grpc,ejona86/grpc,ejona86/grpc,vjpai/grpc,muxi/grpc,jtattermusch/grpc,jboeuf/grpc,jtattermusch/grpc,muxi/grpc,donnadionne/grpc,grpc/grpc,nicolasnoble/grpc,donnadionne/grpc,firebase/grpc,stanley-cheung/grpc,ctiller/grpc,jtattermusch/grpc,stanley-cheung/grpc,donnadionne/grpc,stanley-cheung/grpc,muxi/grpc,jboeuf/grpc,muxi/grpc,grpc/grpc,firebase/grpc,firebase/grpc,donnadionne/grpc,jtattermusch/grpc,ctiller/grpc,ejona86/grpc,jtattermusch/grpc,jboeuf/grpc,donnadionne/grpc,donnadionne/grpc,vjpai/grpc,ctiller/grpc,nicolasnoble/grpc,ctiller/grpc,ctiller/grpc,jtattermusch/grpc,grpc/grpc,ejona86/grpc,stanley-cheung/grpc,stanley-cheung/grpc,nicolasnoble/grpc,jtattermusch/grpc,nicolasnoble/grpc,jboeuf/grpc,muxi/grpc,jtattermusch/grpc,firebase/grpc,muxi/grpc,jtattermusch/grpc,jboeuf/grpc,firebase/grpc,nicolasnoble/grpc,nicolasnoble/grpc,ejona86/grpc,ejona86/grpc,jboeuf/grpc,ejona86/grpc,nicolasnoble/grpc,donnadionne/grpc,stanley-cheung/grpc,muxi/grpc,ctiller/grpc,ctiller/grpc,stanley-cheung/grpc,firebase/grpc,nicolasnoble/grpc,ejona86/grpc,grpc/grpc,jboeuf/grpc,ctiller/grpc,firebase/grpc,muxi/grpc,vjpai/grpc,stanley-cheung/grpc,jboeuf/grpc,jtattermusch/grpc,ctiller/grpc,nicolasnoble/grpc,firebase/grpc,donnadionne/grpc,ctiller/grpc,muxi/grpc,grpc/grpc,grpc/grpc,vjpai/grpc,firebase/grpc,grpc/grpc,vjpai/grpc,vjpai/grpc,jboeuf/grpc,muxi/grpc,nicolasnoble/grpc,jboeuf/grpc,grpc/grpc,vjpai/grpc,ejona86/grpc,nicolasnoble/grpc,muxi/grpc,firebase/grpc,vjpai/grpc,donnadionne/grpc,muxi/grpc,grpc/grpc,vjpai/grpc,ctiller/grpc,grpc/grpc,stanley-cheung/grpc,donnadionne/grpc,ejona86/grpc,grpc/grpc,jtattermusch/grpc,vjpai/grpc
0c70c6e5ea5541a613d39c5e052ed2b3feb0ca6d
src/kernel/thread/sched_none.c
src/kernel/thread/sched_none.c
/** * @file * * @date Mar 21, 2013 * @author: Anton Bondarev */ struct sleepq; struct event; void sched_wake_all(struct sleepq *sq) { } int sched_sleep_ms(struct sleepq *sq, unsigned long timeout) { return 0; } int sched_sleep_locked_ms(struct sleepq *sq, unsigned long timeout) { return 0; } int sched_sleep_ns(struct sleepq *sq, unsigned long timeout) { return 0; } int sched_sleep_us(struct sleepq *sq, unsigned long timeout) { return 0; } int sched_sleep_locked_us(struct sleepq *sq, unsigned long timeout) { return 0; } int sched_sleep_locked_ns(struct sleepq *sq, unsigned long timeout) { return 0; }
/** * @file * * @date Mar 21, 2013 * @author: Anton Bondarev */ struct sleepq; struct event; void sched_wake_all(struct sleepq *sq) { } int sched_sleep(struct sleepq *sq, unsigned long timeout) { return 0; } int sched_sleep_locked(struct sleepq *sq, unsigned long timeout) { return 0; }
Fix MIPS template in master
Fix MIPS template in master
C
bsd-2-clause
embox/embox,Kefir0192/embox,vrxfile/embox-trik,abusalimov/embox,mike2390/embox,gzoom13/embox,gzoom13/embox,vrxfile/embox-trik,Kakadu/embox,Kakadu/embox,Kefir0192/embox,Kefir0192/embox,Kakadu/embox,mike2390/embox,embox/embox,mike2390/embox,vrxfile/embox-trik,Kakadu/embox,vrxfile/embox-trik,embox/embox,Kefir0192/embox,mike2390/embox,gzoom13/embox,abusalimov/embox,embox/embox,gzoom13/embox,Kakadu/embox,vrxfile/embox-trik,embox/embox,mike2390/embox,Kefir0192/embox,Kakadu/embox,vrxfile/embox-trik,abusalimov/embox,Kefir0192/embox,Kakadu/embox,mike2390/embox,abusalimov/embox,vrxfile/embox-trik,Kefir0192/embox,gzoom13/embox,gzoom13/embox,gzoom13/embox,embox/embox,abusalimov/embox,abusalimov/embox,mike2390/embox
03529c297cdf9e273ee8541b7a0021d4fe2f621e
list.h
list.h
#include <stdlib.h> #ifndef __LIST_H__ #define __LIST_H__ struct ListNode; struct List; typedef struct ListNode ListNode; typedef struct List List; List* List_Create(void); void List_Destroy(List* l); #endif
#include <stdlib.h> #ifndef __LIST_H__ #define __LIST_H__ struct ListNode; struct List; typedef struct ListNode ListNode; typedef struct List List; List* List_Create(void); void List_Destroy(List* l); ListNode* ListNode_Create(void *); #endif
Add List Node creation function declaration
Add List Node creation function declaration
C
mit
MaxLikelihood/CADT
01a10a317285f66f5343aa894388f425168c869b
clutter-cairo/cluttercairomodule.c
clutter-cairo/cluttercairomodule.c
#ifdef HAVE_CONFIG_H # include "config.h" #endif #include <Python.h> #include <pygobject.h> #include <pango/pangocairo.h> #include <pycairo.h> void pycluttercairo_register_classes (PyObject *d); void pycluttercairo_add_constants (PyObject *module, const gchar *strip_prefix); extern PyMethodDef pycluttercairo_functions[]; extern PyTypeObject PyClutterCairoContext_Type; Pycairo_CAPI_t *Pycairo_CAPI; DL_EXPORT(void) initcluttercairo (void) { PyObject *m, *d; /* perform any initialisation required by the library here */ m = Py_InitModule ("cluttercairo", pycluttercairo_functions); d = PyModule_GetDict (m); Pycairo_IMPORT; if (Pycairo_CAPI == NULL) return; #if 0 PyClutterCairoContext_Type.tp_base = &PycairoContext_Type; if (PyType_Ready(&PyClutterCairoContext_Type) < 0) { g_return_if_reached (); } #endif init_pygobject (); pycluttercairo_register_classes (d); Py_INCREF (&PyClutterCairoContext_Type); PyModule_AddObject (m, "CairoContext", (PyObject *) &PyClutterCairoContext_Type) ; }
#ifdef HAVE_CONFIG_H # include "config.h" #endif #include <Python.h> #include <pygobject.h> #include <pango/pangocairo.h> #include <pycairo.h> void pycluttercairo_register_classes (PyObject *d); void pycluttercairo_add_constants (PyObject *module, const gchar *strip_prefix); extern PyMethodDef pycluttercairo_functions[]; #if 0 extern PyTypeObject PyClutterCairoContext_Type; #endif Pycairo_CAPI_t *Pycairo_CAPI; DL_EXPORT(void) initcluttercairo (void) { PyObject *m, *d; /* perform any initialisation required by the library here */ m = Py_InitModule ("cluttercairo", pycluttercairo_functions); d = PyModule_GetDict (m); Pycairo_IMPORT; if (Pycairo_CAPI == NULL) return; #if 0 PyClutterCairoContext_Type.tp_base = &PycairoContext_Type; if (PyType_Ready(&PyClutterCairoContext_Type) < 0) { g_return_if_reached (); } #endif init_pygobject (); pycluttercairo_register_classes (d); #if 0 Py_INCREF (&PyClutterCairoContext_Type); PyModule_AddObject (m, "CairoContext", (PyObject *) &PyClutterCairoContext_Type) ; #endif if (PyErr_Occurred ()) { Py_FatalError ("unable to initialise cluttercairo module"); } }
Comment out the code to subclass CairoContext
Comment out the code to subclass CairoContext We don't have any method on the cairo_t returned by ClutterCairo::create() at the moment, so we don't need the machinery to register it as our own subclass type. I prefer to leave it in place, so that we can use it later.
C
lgpl-2.1
GNOME/pyclutter,pmarti/pyclutter,pmarti/pyclutter,pmarti/pyclutter,GNOME/pyclutter,pmarti/pyclutter
987d3eec5024073a2e72b04d4f1e097e11a95f42
dayperiod.h
dayperiod.h
// Copyright 2015 Malcolm Inglis <http://minglis.id.au> // // This file is part of Libtime. // // Libtime 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. // // Libtime 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 Libtime. If not, see <https://gnu.org/licenses/>. #ifndef LIBTIME_DAYPERIOD_H #define LIBTIME_DAYPERIOD_H #include <time.h> #include <libtypes/types.h> #include "daytime.h" typedef struct dayperiod { DayTime start; ulong duration; } DayPeriod; DayTime dayperiod__end( DayPeriod ); bool dayperiod__contains( DayPeriod, DayTime ); #endif // ifndef LIBTIME_DAYPERIOD_H
// Copyright 2015 Malcolm Inglis <http://minglis.id.au> // // This file is part of Libtime. // // Libtime 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. // // Libtime 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 Libtime. If not, see <https://gnu.org/licenses/>. #ifndef LIBTIME_DAYPERIOD_H #define LIBTIME_DAYPERIOD_H #include <time.h> #include <libtypes/types.h> #include "daytime.h" typedef struct dayperiod { ulong duration; DayTime start; } DayPeriod; DayTime dayperiod__end( DayPeriod ); bool dayperiod__contains( DayPeriod, DayTime ); #endif // ifndef LIBTIME_DAYPERIOD_H
Change ordering of fields in DayPeriod
Change ordering of fields in DayPeriod
C
agpl-3.0
mcinglis/libtime,mcinglis/libtime
4be46defc30b9f98c4b9df409fdf4b39915fd6f6
apple/RNSVGUIKit.h
apple/RNSVGUIKit.h
// Most (if not all) of this file could probably go away once react-native-macos's version of RCTUIKit.h makes its way upstream. // https://github.com/microsoft/react-native-macos/issues/242 #if !TARGET_OS_OSX #import <UIKit/UIKit.h> #define RNSVGColor UIColor #define RNSVGPlatformView UIView #define RNSVGTextView UILabel #define RNSVGView UIView #else // TARGET_OS_OSX [ #import <React/RCTUIKit.h> #define RNSVGColor NSColor #define RNSVGPlatformView NSView #define RNSVGTextView NSTextView @interface RNSVGView : RCTUIView @property CGPoint center; @property (nonatomic, strong) RNSVGColor *tintColor; @end // TODO: These could probably be a part of react-native-macos @interface NSImage (RNSVGMacOSExtensions) @property (readonly) CGImageRef CGImage; @end @interface NSValue (RNSVGMacOSExtensions) + (NSValue *)valueWithCGAffineTransform:(CGAffineTransform)transform; + (NSValue *)valueWithCGPoint:(CGPoint)point; @property (readonly) CGAffineTransform CGAffineTransformValue; @property (readonly) CGPoint CGPointValue; @end #endif // ] TARGET_OS_OSX
// Most (if not all) of this file could probably go away once react-native-macos's version of RCTUIKit.h makes its way upstream. // https://github.com/microsoft/react-native-macos/issues/242 #if !TARGET_OS_OSX #import <UIKit/UIKit.h> #define RNSVGColor UIColor #define RNSVGPlatformView UIView #define RNSVGTextView UILabel #define RNSVGView UIView #else // TARGET_OS_OSX [ #import <React/RCTUIKit.h> #define RNSVGColor NSColor #define RNSVGPlatformView NSView #define RNSVGTextView NSTextView @interface RNSVGView : RCTUIView @property CGPoint center; @property (nonatomic, strong) RNSVGColor *tintColor; @end // TODO: These could probably be a part of react-native-macos // See https://github.com/microsoft/react-native-macos/issues/658 and https://github.com/microsoft/react-native-macos/issues/659 @interface NSImage (RNSVGMacOSExtensions) @property (readonly) CGImageRef CGImage; @end @interface NSValue (RNSVGMacOSExtensions) + (NSValue *)valueWithCGAffineTransform:(CGAffineTransform)transform; + (NSValue *)valueWithCGPoint:(CGPoint)point; @property (readonly) CGAffineTransform CGAffineTransformValue; @property (readonly) CGPoint CGPointValue; @end #endif // ] TARGET_OS_OSX
Add links to related react-native-macos issues
Add links to related react-native-macos issues
C
mit
react-native-community/react-native-svg,react-native-community/react-native-svg,react-native-community/react-native-svg,react-native-community/react-native-svg,react-native-community/react-native-svg
f276f056c0d95ad78343a1f50f08e38cd3b77a3e
bluetooth/bdroid_buildcfg.h
bluetooth/bdroid_buildcfg.h
/* * Copyright 2013 The Android Open Source Project * * 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 _BDROID_BUILDCFG_H #define _BDROID_BUILDCFG_H #define BTM_DEF_LOCAL_NAME "hammerhead" #define BTA_DISABLE_DELAY 100 /* in milliseconds */ #endif
/* * Copyright 2013 The Android Open Source Project * * 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 _BDROID_BUILDCFG_H #define _BDROID_BUILDCFG_H #define BTA_DISABLE_DELAY 100 /* in milliseconds */ #endif
Remove BTM_DEF_LOCAL_NAME define. product model name is used as default
Remove BTM_DEF_LOCAL_NAME define. product model name is used as default bug 7441329 Change-Id: I650828b3f6a6bedd87ae9e44b057a3c3353d1250
C
apache-2.0
maruos/android_device_lge_hammerhead,maruos/android_device_lge_hammerhead,maruos/android_device_lge_hammerhead,maruos/android_device_lge_hammerhead
3f75051b71f0187e6045ecd2c4e84a6e4424dc04
kmsuriendpointstate.h
kmsuriendpointstate.h
#ifndef __KMS_URI_END_POINT_STATE_H__ #define __KMS_URI_END_POINT_STATE_H__ G_BEGIN_DECLS typedef enum { KMS_URI_END_POINT_STATE_STOP, KMS_URI_END_POINT_STATE_START, KMS_URI_END_POINT_STATE_PLAY } KmsUriEndPointState; G_END_DECLS #endif /* __KMS_URI_END_POINT_STATE__ */
#ifndef __KMS_URI_END_POINT_STATE_H__ #define __KMS_URI_END_POINT_STATE_H__ G_BEGIN_DECLS typedef enum { KMS_URI_END_POINT_STATE_STOP, KMS_URI_END_POINT_STATE_START, KMS_URI_END_POINT_STATE_PAUSE } KmsUriEndPointState; G_END_DECLS #endif /* __KMS_URI_END_POINT_STATE__ */
Fix state definition for UriEndPointElement
Fix state definition for UriEndPointElement Change-Id: I72aff01136f3f13536e409040e42ad1a6dffcd4d
C
apache-2.0
Kurento/kms-elements,shelsonjava/kms-elements,TribeMedia/kms-elements,Kurento/kms-elements,shelsonjava/kms-elements,shelsonjava/kms-elements,TribeMedia/kms-elements,TribeMedia/kms-elements,Kurento/kms-elements
79771029736b935605a13df181f9780bd967ecb2
test2/typedef/init_and_func.c
test2/typedef/init_and_func.c
// RUN: %check -e %s typedef int f(void) // CHECK: error: typedef storage on function { return 3; } typedef char c = 3; // CHECK: error: initialised typedef main() { int *p = (__typeof(*p))0; // CHECK: !/warn/ for(int _Alignas(long) x = 0; x; x++); // CHECK: !/warn/ return f(); // CHECK: !/warn/ }
// RUN: %check -e %s typedef int f(void) // CHECK: error: typedef storage on function { return 3; } typedef char c = 3; // CHECK: error: initialised typedef main() { int *p = (__typeof(*p))0; // can't check here - we think p is used uninit for(int _Alignas(long) x = 0; x; x++); // CHECK: !/warn/ return f(); // CHECK: !/warn/ }
Remove extra warning in typedef/init/func test
Remove extra warning in typedef/init/func test
C
mit
8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler
06a3c0baea19e5ff295b34943fcec9609a686952
test/shadowcallstack/init.c
test/shadowcallstack/init.c
// 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; }
// 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; }
Disable negative test in shadowcallstack.
[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
C
apache-2.0
llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt
25d6fa93be985030dd8febba97419e27a01141ae
src/SimpleAmqpClient/Version.h
src/SimpleAmqpClient/Version.h
#ifndef SIMPLEAMQPCLIENT_VERSION_H #define SIMPLEAMQPCLIENT_VERSION_H /* * ***** BEGIN LICENSE BLOCK ***** * Version: MIT * * Copyright (c) 2013 Alan Antonuk * * 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. * ***** END LICENSE BLOCK ***** */ #define SIMPLEAMQPCLIENT_VERSION_MAJOR 2 #define SIMPLEAMQPCLIENT_VERSION_MINOR 5 #define SIMPLEAMQPCLIENT_VERSION_PATCH 0 #endif // SIMPLEAMQPCLIENT_VERSION_H
#ifndef SIMPLEAMQPCLIENT_VERSION_H #define SIMPLEAMQPCLIENT_VERSION_H /* * ***** BEGIN LICENSE BLOCK ***** * Version: MIT * * Copyright (c) 2013 Alan Antonuk * * 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. * ***** END LICENSE BLOCK ***** */ #define SIMPLEAMQPCLIENT_VERSION_MAJOR 2 #define SIMPLEAMQPCLIENT_VERSION_MINOR 6 #define SIMPLEAMQPCLIENT_VERSION_PATCH 0 #endif // SIMPLEAMQPCLIENT_VERSION_H
Increment version to v2.6 for development
Increment version to v2.6 for development
C
mit
alanxz/SimpleAmqpClient,alanxz/SimpleAmqpClient
f5838918d743fc0c161c279930ac5f373061fdd7
CommuteStream/CSCustomBanner.h
CommuteStream/CSCustomBanner.h
// // CSCustomBanner.h // CommuteStream // // Created by David Rogers on 5/3/14. // Copyright (c) 2014 CommuteStream. All rights reserved. // #import <Foundation/Foundation.h> #import "GADCustomEventBanner.h" #import "GADCustomEventBannerDelegate.h" #import "GADBannerView.h" #import "GADBannerViewDelegate.h" #import "CSNetworkEngine.h" @interface CSCustomBanner : NSObject <GADCustomEventBanner, GADBannerViewDelegate, UIGestureRecognizerDelegate> { GADBannerView *bannerView_; } @property (nonatomic, strong) CSNetworkEngine *csNetworkEngine; -(void)buildWebView:(NSMutableDictionary*)dict; + (NSString *)getIdfa; + (NSString *)getMacSha:(NSString *)deviceAddress; @end
#import <Foundation/Foundation.h> #import "GADCustomEventBanner.h" #import "GADCustomEventBannerDelegate.h" #import "GADBannerView.h" #import "GADBannerViewDelegate.h" #import "CSNetworkEngine.h" @interface CSCustomBanner : NSObject <GADCustomEventBanner, GADBannerViewDelegate, UIGestureRecognizerDelegate> { GADBannerView *bannerView_; } @property (nonatomic, strong) CSNetworkEngine *csNetworkEngine; -(void)buildWebView:(NSMutableDictionary*)dict; + (NSString *)getIdfa; + (NSString *)getMacSha:(NSString *)deviceAddress; @end
Remove extraneous header file comment
Remove extraneous header file comment
C
apache-2.0
CommuteStream/cs-ios-sdk,CommuteStream/ios-sdk,CommuteStream/ios-sdk,CommuteStream/ios-sdk,CommuteStream/cs-ios-sdk,CommuteStream/cs-ios-sdk,CommuteStream/cs-ios-sdk
e6fb1fb433f3c4dfde024695c3b5cf593a3dd9c8
tests/unit/test-unit-main.c
tests/unit/test-unit-main.c
#include <config.h> #include <dlfcn.h> #include <test-fixtures/test-unit.h> int main (int argc, char **argv) { const CoglUnitTest *unit_test; int i; if (argc != 2) { g_printerr ("usage %s UNIT_TEST\n", argv[0]); exit (1); } /* Just for convenience in case people try passing the wrapper * filenames for the UNIT_TEST argument we normalize '-' characters * to '_' characters... */ for (i = 0; argv[1][i]; i++) { if (argv[1][i] == '-') argv[1][i] = '_'; } unit_test = dlsym (RTLD_DEFAULT, argv[1]); if (!unit_test) { g_printerr ("Unknown test name \"%s\"\n", argv[1]); return 1; } test_utils_init (unit_test->requirement_flags, unit_test->known_failure_flags); unit_test->run (); test_utils_fini (); return 0; }
#include <config.h> #include <gmodule.h> #include <test-fixtures/test-unit.h> int main (int argc, char **argv) { GModule *main_module; const CoglUnitTest *unit_test; int i; if (argc != 2) { g_printerr ("usage %s UNIT_TEST\n", argv[0]); exit (1); } /* Just for convenience in case people try passing the wrapper * filenames for the UNIT_TEST argument we normalize '-' characters * to '_' characters... */ for (i = 0; argv[1][i]; i++) { if (argv[1][i] == '-') argv[1][i] = '_'; } main_module = g_module_open (NULL, /* use main module */ 0 /* flags */); if (!g_module_symbol (main_module, argv[1], (void **) &unit_test)) { g_printerr ("Unknown test name \"%s\"\n", argv[1]); return 1; } test_utils_init (unit_test->requirement_flags, unit_test->known_failure_flags); unit_test->run (); test_utils_fini (); return 0; }
Use GModule instead of libdl to load unit test symbols
Use GModule instead of libdl to load unit test symbols Previously the unit tests were using libdl without directly linking to it. It looks like this ends up working because one of Cogl's dependencies ends up pulling adding -ldl via libtool. However in some configurations it looks like this wasn't happening. To avoid this problem we can just use GModule to resolve the symbols. g_module_open is documented to return a handle to the ‘main program’ when NULL is passed as the filename and looking at the code it seems that this ends up using RTLD_DEFAULT so it will have the same effect. The in-tree copy of glib already has the code for gmodule so this shouldn't cause problems for --disable-glib. Reviewed-by: Robert Bragg <robert@linux.intel.com> (cherry picked from commit b14ece116ed3e4b18d59b645e77b3449fac51137)
C
lgpl-2.1
Distrotech/cogl,Distrotech/cogl,Distrotech/cogl,Distrotech/cogl
311c25085bd88d500450794547ad4cead98f4737
bcl/stm/src/main.c
bcl/stm/src/main.c
#include <bc_scheduler.h> #include <bc_module_core.h> #include <stm32l0xx.h> void application_init(void); void application_task(void *param); int main(void) { bc_module_core_init(); bc_scheduler_init(); bc_scheduler_register(application_task, NULL, 0); application_init(); bc_scheduler_run(); } __attribute__((weak)) void application_init(void) { } __attribute__((weak)) void application_task(void *param) { (void) param; }
#include <bc_scheduler.h> #include <bc_module_core.h> #include <stm32l0xx.h> void application_init(void); void application_task(void *param); int main(void) { bc_module_core_init(); while (bc_tick_get() < 500) { continue; } bc_scheduler_init(); bc_scheduler_register(application_task, NULL, 0); application_init(); bc_scheduler_run(); } __attribute__((weak)) void application_init(void) { } __attribute__((weak)) void application_task(void *param) { (void) param; }
Add 500ms wait at startup
Add 500ms wait at startup
C
mit
bigclownlabs/bc-core-module-sdk,bigclownlabs/bc-core-module-sdk,bigclownlabs/bc-core-module-sdk
e4faf7ca0dad2d66b21425546ec3e9eec5b9352a
cpp/util/StringTesting.h
cpp/util/StringTesting.h
#include<stdint.h> #include<string> #include<stdexcept> #include<vector> // styled according to the Google C++ Style guide // https://google.github.io/styleguide/cppguide.html struct TestString { std::string s; uint8_t key; uint32_t score; }; TestString CreateTestString(std::string input_string, uint8_t input_key); std::vector<TestString> FilterNonPrintable(std::vector<TestString> input_strings); std::vector<TestString> FilterExcessivePunctuation(std::vector<TestString> input_strings, uint16_t punc_threshold);
#include<stdint.h> #include<string> #include<stdexcept> #include<vector> // styled according to the Google C++ Style guide // https://google.github.io/styleguide/cppguide.html struct TestString { std::string s; uint8_t key; int32_t score; }; TestString CreateTestString(std::string input_string, uint8_t input_key); std::vector<TestString> FilterNonPrintable(std::vector<TestString> input_strings); std::vector<TestString> FilterExcessivePunctuation(std::vector<TestString> input_strings, uint16_t punc_threshold);
Change TestString score to signed int
Change TestString score to signed int
C
mit
TheLunchtimeAttack/matasano-challenges,TheLunchtimeAttack/matasano-challenges
df934456592ccd64dbe9ba4a394f6a9b62effa57
stdafx.h
stdafx.h
// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once #include "targetver.h" #include <stdio.h> #include <tchar.h> // TODO: reference additional headers your program requires here #include <io.h> #include <fcntl.h> // import ADODB #import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF", "EndOfFile")
// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once #include "targetver.h" #include <stdio.h> #include <tchar.h> // TODO: reference additional headers your program requires here #include <io.h> #include <fcntl.h> // import ADODB #import "C:\Program Files (x86)\Common Files\System\ado\msado15.dll" no_namespace rename("EOF", "EndOfFile")
Correct locaiton of msado15 for x64 dev platform
Correct locaiton of msado15 for x64 dev platform
C
bsd-2-clause
duncansmart/sqlpipe,duncansmart/sqlpipe
b6bca94cd4fe8096cf9c22c31c1cc4a988b51c70
src/dsmcc-ts.h
src/dsmcc-ts.h
#ifndef DSMCC_TS_H #define DSMCC_TS_H #include <stdint.h> #define DSMCC_TSPARSER_BUFFER_SIZE (4096 + 188) struct dsmcc_tsparser_buffer { uint16_t pid; int si_seen; int in_section; int cont; uint8_t data[DSMCC_TSPARSER_BUFFER_SIZE]; struct dsmcc_tsparser_buffer *next; }; #endif
#ifndef DSMCC_TS_H #define DSMCC_TS_H #include <stdint.h> #define DSMCC_TSPARSER_BUFFER_SIZE 8192 struct dsmcc_tsparser_buffer { uint16_t pid; int si_seen; int in_section; int cont; uint8_t data[DSMCC_TSPARSER_BUFFER_SIZE]; struct dsmcc_tsparser_buffer *next; }; #endif
Increase size of section buffer
Increase size of section buffer
C
lgpl-2.1
frogbywyplay/media_libdsmcc,frogbywyplay/media_libdsmcc