commit
stringlengths
40
40
old_file
stringlengths
4
112
new_file
stringlengths
4
112
old_contents
stringlengths
0
2.05k
new_contents
stringlengths
28
3.9k
subject
stringlengths
17
736
message
stringlengths
18
4.78k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
7
111k
8b00f90e146db2f555897d7aa66bc7a403883f74
src/diskusage.h
src/diskusage.h
#pragma once #include <cstdint> #include <string> class SystemError { public: SystemError(int errorno, const std::string& syscall, const std::string& message, const std::string& path) : m_errorno(errorno), m_syscall(syscall), m_message(message), m_path(path) {} int errorno() const { return m_errorno; } const char* syscall() const { return m_syscall.c_str(); } const char* message() const { return m_message.c_str(); } const char* path() const { return m_path.c_str(); } private: int m_errorno; std::string m_syscall; std::string m_message; std::string m_path; }; struct DiskUsage { uint64_t available; uint64_t free; uint64_t total; }; DiskUsage GetDiskUsage(const char* path);
#pragma once #include <stdint.h> #include <string> class SystemError { public: SystemError(int errorno, const std::string& syscall, const std::string& message, const std::string& path) : m_errorno(errorno), m_syscall(syscall), m_message(message), m_path(path) {} int errorno() const { return m_errorno; } const char* syscall() const { return m_syscall.c_str(); } const char* message() const { return m_message.c_str(); } const char* path() const { return m_path.c_str(); } private: int m_errorno; std::string m_syscall; std::string m_message; std::string m_path; }; struct DiskUsage { uint64_t available; uint64_t free; uint64_t total; }; DiskUsage GetDiskUsage(const char* path);
Use stdint.h instead of cstdint
Use stdint.h instead of cstdint Fixes #16.
C
mit
jduncanator/node-diskusage,jduncanator/node-diskusage,jduncanator/node-diskusage
b5ae6109ae7151d1fb91009a205bd3d470323f24
src/hpctoolkit/csprof/unwind/x86-family/x86-unwind-support.c
src/hpctoolkit/csprof/unwind/x86-family/x86-unwind-support.c
#include <ucontext.h> #include "x86-decoder.h" #include "unwind.h" void unw_init_arch(void) { x86_family_decoder_init(); } void unw_init_cursor_arch(ucontext_t* context, unw_cursor_t *cursor) { mcontext_t * mctxt = &(context->uc_mcontext); #ifdef __CRAYXT_CATAMOUNT_TARGET cursor->pc = (void *) mctxt->sc_rip; cursor->bp = (void **) mctxt->sc_rbp; cursor->sp = (void **) mctxt->sc_rsp; #else cursor->pc = (void *) mctxt->gregs[REG_RIP]; cursor->bp = (void **) mctxt->gregs[REG_RBP]; cursor->sp = (void **) mctxt->gregs[REG_RSP]; #endif } int unw_get_reg_arch(unw_cursor_t *cursor, int reg_id, void **reg_value) { assert(reg_id == UNW_REG_IP); *reg_value = cursor->pc; return 0; }
#include <ucontext.h> #include <assert.h> #include "x86-decoder.h" #include "unwind.h" void unw_init_arch(void) { x86_family_decoder_init(); } void unw_init_cursor_arch(ucontext_t* context, unw_cursor_t *cursor) { mcontext_t * mctxt = &(context->uc_mcontext); #ifdef __CRAYXT_CATAMOUNT_TARGET cursor->pc = (void *) mctxt->sc_rip; cursor->bp = (void **) mctxt->sc_rbp; cursor->sp = (void **) mctxt->sc_rsp; #else cursor->pc = (void *) mctxt->gregs[REG_RIP]; cursor->bp = (void **) mctxt->gregs[REG_RBP]; cursor->sp = (void **) mctxt->gregs[REG_RSP]; #endif } int unw_get_reg_arch(unw_cursor_t *cursor, int reg_id, void **reg_value) { assert(reg_id == UNW_REG_IP); *reg_value = cursor->pc; return 0; }
Include <assert.h> to prevent linking error (unknown symbol 'assert').
Include <assert.h> to prevent linking error (unknown symbol 'assert').
C
bsd-3-clause
zcth428/hpctoolkit111,HPCToolkit/hpctoolkit,zcth428/hpctoolkit,HPCToolkit/hpctoolkit,zcth428/hpctoolkit,HPCToolkit/hpctoolkit,zcth428/hpctoolkit111,HPCToolkit/hpctoolkit,zcth428/hpctoolkit111,HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit,zcth428/hpctoolkit,zcth428/hpctoolkit,zcth428/hpctoolkit111,zcth428/hpctoolkit111,zcth428/hpctoolkit
c12e2945e24c544883ce43c49803e5f16b66a96b
Sample/SampleApp/ViewController.h
Sample/SampleApp/ViewController.h
#import <UIKit/UIKit.h> @interface ViewController : UIViewController <UIAlertViewDelegate, UIActionSheetDelegate> @property (nonatomic, strong) Class alertControllerClass; @property (nonatomic, strong) IBOutlet UIButton *showAlertButton; @property (nonatomic, strong) IBOutlet UIButton *showActionSheetButton; @property (nonatomic, assign) BOOL alertDefaultActionExecuted; @property (nonatomic, assign) BOOL alertCancelActionExecuted; @property (nonatomic, assign) BOOL alertDestroyActionExecuted; - (IBAction)showAlert:(id)sender; - (IBAction)showActionSheet:(id)sender; @end
#import <UIKit/UIKit.h> @interface ViewController : UIViewController @property (nonatomic, strong) Class alertControllerClass; @property (nonatomic, strong) IBOutlet UIButton *showAlertButton; @property (nonatomic, strong) IBOutlet UIButton *showActionSheetButton; @property (nonatomic, assign) BOOL alertDefaultActionExecuted; @property (nonatomic, assign) BOOL alertCancelActionExecuted; @property (nonatomic, assign) BOOL alertDestroyActionExecuted; - (IBAction)showAlert:(id)sender; - (IBAction)showActionSheet:(id)sender; @end
Remove unused protocol conformance from sample
Remove unused protocol conformance from sample
C
mit
foulkesjohn/MockUIAlertController,yas375/MockUIAlertController,carabina/MockUIAlertController
9d4a59f2cab4179f3ff5b73477044f2f9289d5b8
thread/future.h
thread/future.h
#ifndef FUTURE_H_INCLUDED #define FUTURE_H_INCLUDED #include <boost/thread/thread.hpp> #include <boost/thread/future.hpp> #include <boost/shared_ptr.hpp> #include <boost/utility/result_of.hpp> namespace thread { template<typename Func> boost::shared_future<typename boost::result_of<Func()>::type> submit_task(Func f) { typedef typename boost::result_of<Func()>::type ResultType; typedef boost::packaged_task<ResultType> PackagedTaskType; PackagedTaskType task(f); boost::shared_future<ResultType> res(task.get_future()); boost::thread task_thread(std::move(task)); return res; } } #endif // FUTURE_H_INCLUDED
#ifndef FUTURE_H_INCLUDED #define FUTURE_H_INCLUDED #include <boost/thread/thread.hpp> #include <boost/thread/future.hpp> #include <boost/shared_ptr.hpp> #include <boost/utility/result_of.hpp> namespace thread { template<typename Func> boost::shared_future<typename boost::result_of<Func()>::type> submit_task(Func f) { typedef typename boost::result_of<Func()>::type ResultType; typedef boost::packaged_task<ResultType> PackagedTaskType; PackagedTaskType task(f); boost::shared_future<ResultType> res(task.get_future()); boost::thread task_thread(boost::move(task)); return res; } } #endif // FUTURE_H_INCLUDED
Use boost::move rather than std::move which seems to hate some versions ofr G++
Use boost::move rather than std::move which seems to hate some versions ofr G++
C
bsd-2-clause
Kazade/kazbase,Kazade/kazbase
b7d35893186564bf8c4e706e5d05df06b23d2dc7
test/CodeGen/functions.c
test/CodeGen/functions.c
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s int g(); int foo(int i) { return g(i); } int g(int i) { return g(i); } // rdar://6110827 typedef void T(void); void test3(T f) { f(); } int a(int); int a() {return 1;} // RUN: grep 'define void @f0()' %t void f0() {} void f1(); // RUN: grep 'call void @f1()' %t void f2(void) { f1(1, 2, 3); } // RUN: grep 'define void @f1()' %t void f1() {} // RUN: grep 'define .* @f3' %t | not grep -F '...' struct foo { int X, Y, Z; } f3() { while (1) {} } // PR4423 - This shouldn't crash in codegen void f4() {} void f5() { f4(42); } // Qualifiers on parameter types shouldn't make a difference. static void f6(const float f, const float g) { } void f7(float f, float g) { f6(f, g); // CHECK: define void @f7(float{{.*}}, float{{.*}}) // CHECK: call void @f6(float{{.*}}, float{{.*}}) }
// RUN: %clang_cc1 %s -emit-llvm -o - -verify | FileCheck %s int g(); int foo(int i) { return g(i); } int g(int i) { return g(i); } // rdar://6110827 typedef void T(void); void test3(T f) { f(); } int a(int); int a() {return 1;} void f0() {} // CHECK: define void @f0() void f1(); void f2(void) { // CHECK: call void @f1() f1(1, 2, 3); } // CHECK: define void @f1() void f1() {} // CHECK: define {{.*}} @f3() struct foo { int X, Y, Z; } f3() { while (1) {} } // PR4423 - This shouldn't crash in codegen void f4() {} void f5() { f4(42); } //expected-warning {{too many arguments}} // Qualifiers on parameter types shouldn't make a difference. static void f6(const float f, const float g) { } void f7(float f, float g) { f6(f, g); // CHECK: define void @f7(float{{.*}}, float{{.*}}) // CHECK: call void @f6(float{{.*}}, float{{.*}}) }
Fix test case and convert fully to FileCheck.
Fix test case and convert fully to FileCheck. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@97032 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
fcc92cf5633589068313897d39036686ec32e875
src/driver/utility.h
src/driver/utility.h
#pragma once #include <fstream> #include <llvm/ADT/StringRef.h> inline std::ostream& operator<<(std::ostream& stream, llvm::StringRef string) { return stream.write(string.data(), string.size()); } template<typename... Args> [[noreturn]] inline void error(SrcLoc srcLoc, Args&&... args) { std::cout << srcLoc.file << ':'; if (srcLoc.isValid()) std::cout << srcLoc.line << ':' << srcLoc.column << ':'; std::cout << " error: "; using expander = int[]; (void)expander{0, (void(std::cout << std::forward<Args>(args)), 0)...}; // Output caret. std::ifstream file(srcLoc.file); while (--srcLoc.line) file.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); std::string line; std::getline(file, line); std::cout << '\n' << line << '\n'; while (--srcLoc.column) std::cout << ' '; std::cout << "^\n"; exit(1); }
#pragma once #include <fstream> #include <llvm/ADT/StringRef.h> inline std::ostream& operator<<(std::ostream& stream, llvm::StringRef string) { return stream.write(string.data(), string.size()); } template<typename... Args> [[noreturn]] inline void error(SrcLoc srcLoc, Args&&... args) { if (srcLoc.file) { std::cout << srcLoc.file << ':'; if (srcLoc.isValid()) std::cout << srcLoc.line << ':' << srcLoc.column << ':'; } else { std::cout << "<unknown file>:"; } std::cout << " error: "; using expander = int[]; (void)expander{0, (void(std::cout << std::forward<Args>(args)), 0)...}; if (srcLoc.file && srcLoc.isValid()) { // Output caret. std::ifstream file(srcLoc.file); while (--srcLoc.line) file.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); std::string line; std::getline(file, line); std::cout << '\n' << line << '\n'; while (--srcLoc.column) std::cout << ' '; std::cout << "^\n"; } exit(1); }
Fix error() if srcLoc.file is null or !srcLoc.isValid()
Fix error() if srcLoc.file is null or !srcLoc.isValid()
C
mit
emlai/delta,emlai/delta,emlai/delta,emlai/delta,delta-lang/delta,delta-lang/delta,delta-lang/delta,delta-lang/delta
0e8f41582505e156243a37100568f94f158ec978
modules/electromagnetics/test/include/functions/MMSTestFunc.h
modules/electromagnetics/test/include/functions/MMSTestFunc.h
#ifndef MMSTESTFUNC_H #define MMSTESTFUNC_H #include "Function.h" #include "FunctionInterface.h" class MMSTestFunc; template <> InputParameters validParams<MMSTestFunc>(); /** * Function of RHS for manufactured solution in spatial_constant_helmholtz test */ class MMSTestFunc : public Function, public FunctionInterface { public: MMSTestFunc(const InputParameters & parameters); virtual Real value(Real t, const Point & p) const override; protected: Real _length; const Function & _a; const Function & _b; Real _d; Real _h; Real _g_0_real; Real _g_0_imag; Real _g_l_real; Real _g_l_imag; MooseEnum _component; }; #endif // MMSTESTFUNC_H
#pragma once #include "Function.h" #include "FunctionInterface.h" class MMSTestFunc; template <> InputParameters validParams<MMSTestFunc>(); /** * Function of RHS for manufactured solution in spatial_constant_helmholtz test */ class MMSTestFunc : public Function, public FunctionInterface { public: MMSTestFunc(const InputParameters & parameters); virtual Real value(Real t, const Point & p) const override; protected: Real _length; const Function & _a; const Function & _b; Real _d; Real _h; Real _g_0_real; Real _g_0_imag; Real _g_l_real; Real _g_l_imag; MooseEnum _component; };
Convert to pragma once in test functions
Convert to pragma once in test functions refs #21085
C
lgpl-2.1
laagesen/moose,harterj/moose,andrsd/moose,sapitts/moose,milljm/moose,milljm/moose,idaholab/moose,lindsayad/moose,harterj/moose,idaholab/moose,andrsd/moose,sapitts/moose,harterj/moose,sapitts/moose,dschwen/moose,andrsd/moose,dschwen/moose,milljm/moose,sapitts/moose,dschwen/moose,laagesen/moose,lindsayad/moose,andrsd/moose,idaholab/moose,idaholab/moose,milljm/moose,harterj/moose,sapitts/moose,laagesen/moose,lindsayad/moose,milljm/moose,laagesen/moose,lindsayad/moose,lindsayad/moose,dschwen/moose,idaholab/moose,andrsd/moose,dschwen/moose,laagesen/moose,harterj/moose
2ec53d6f185a4a3e91ea6a2b879089eeac7896dd
storage/src/vespa/storage/bucketdb/minimumusedbitstracker.h
storage/src/vespa/storage/bucketdb/minimumusedbitstracker.h
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <algorithm> #include <vespa/document/bucket/bucketid.h> namespace storage { /** * Utility class for keeping track of the lowest used bits count seen * across a set of buckets. * * Not threadsafe by itself. */ class MinimumUsedBitsTracker { uint32_t _minUsedBits; public: MinimumUsedBitsTracker() : _minUsedBits(58) {} /** * Returns true if new bucket led to a decrease in the used bits count. */ bool update(const document::BucketId& bucket) { if (bucket.getUsedBits() < _minUsedBits) { _minUsedBits = bucket.getUsedBits(); return true; } return false; } uint32_t getMinUsedBits() const { return _minUsedBits; } void setMinUsedBits(uint32_t minUsedBits) { _minUsedBits = minUsedBits; } }; }
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/document/bucket/bucketid.h> #include <atomic> namespace storage { /** * Utility class for keeping track of the lowest used bits count seen * across a set of buckets. * * Thread safe for reads and writes. */ class MinimumUsedBitsTracker { std::atomic<uint32_t> _min_used_bits; public: constexpr MinimumUsedBitsTracker() noexcept : _min_used_bits(58) {} /** * Returns true iff new bucket led to a decrease in the used bits count. */ bool update(const document::BucketId& bucket) noexcept { const uint32_t bucket_bits = bucket.getUsedBits(); uint32_t current_bits = _min_used_bits.load(std::memory_order_relaxed); if (bucket_bits < current_bits) { while (!_min_used_bits.compare_exchange_strong(current_bits, bucket_bits, std::memory_order_relaxed, std::memory_order_relaxed)) { if (bucket_bits >= current_bits) { return false; // We've raced with another writer that had lower or equal bits to our own bucket. } } return true; } return false; } [[nodiscard]] uint32_t getMinUsedBits() const noexcept { return _min_used_bits.load(std::memory_order_relaxed); } void setMinUsedBits(uint32_t minUsedBits) noexcept { _min_used_bits.store(minUsedBits, std::memory_order_relaxed); } }; }
Make MinimumUsedBitsTracker thread safe for both reads and writes
Make MinimumUsedBitsTracker thread safe for both reads and writes
C
apache-2.0
vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa
03cb0d30b60c3702edc0752fe535abb1ae41a32d
src/controllers/chooseyourcat.c
src/controllers/chooseyourcat.c
#include "debug.h" #include "input.h" #include "scene.h" #include "sound.h" #include "controller.h" #include "controllers/chooseyourcat.h" #include <stdio.h> #include <stdlib.h> #include <stdbool.h> NEW_CONTROLLER(ChooseYourCat); static void p1_confirm() { Sound_playSE(FX_SELECT); Scene_close(); Scene_load(SCENE_PRESSSTART); } static void p2_confirm() { Sound_playSE(FX_SELECT); Scene_close(); Scene_load(SCENE_PRESSSTART); } static void ChooseYourCatController_init() { EVENT_ASSOCIATE(press, P1_MARU, p1_confirm); EVENT_ASSOCIATE(press, P2_MARU, p2_confirm); logprint(success_msg); }
#include "debug.h" #include "input.h" #include "scene.h" #include "sound.h" #include "controller.h" #include "scenes/chooseyourcat.h" #include "controllers/chooseyourcat.h" #include <stdio.h> #include <stdlib.h> #include <stdbool.h> static int P1_HAS_CHOSEN = false; /* false -> P1 escolhe o gato; true -> P2 escolhe o gato. */ NEW_CONTROLLER(ChooseYourCat); static void p1_confirm() { if (!P1_HAS_CHOSEN) { Sound_playSE(FX_SELECT); P1_HAS_CHOSEN = true; } } static void p2_confirm() { if (P1_HAS_CHOSEN) { /* code */ Sound_playSE(FX_SELECT); Scene_close(); Scene_load(SCENE_PRESSSTART); } } static void ChooseYourCatController_init() { EVENT_ASSOCIATE(press, P1_MARU, p1_confirm); EVENT_ASSOCIATE(press, P2_MARU, p2_confirm); logprint(success_msg); }
Add step for each player on choose your cat scene
Add step for each player on choose your cat scene
C
mit
OrenjiAkira/spacegame,OrenjiAkira/spacegame,OrenjiAkira/spacegame
2240e7ad952671f460d73f1edcb3052d6cd84b5a
chrome/browser/extensions/convert_web_app.h
chrome/browser/extensions/convert_web_app.h
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_EXTENSIONS_CONVERT_WEB_APP_H_ #define CHROME_BROWSER_EXTENSIONS_CONVERT_WEB_APP_H_ #pragma once #include <string> #include "base/ref_counted.h" class Extension; namespace base { class Time; } namespace webkit_glue { struct WebApplicationInfo; } // Generates a version number for an extension from a time. The goal is to make // use of the version number to communicate some useful information. The // returned version has the format: // <year>.<month><day>.<upper 16 bits of unix timestamp>.<lower 16 bits> std::string ConvertTimeToExtensionVersion(const base::Time& time); // Wraps the specified web app in an extension. The extension is created // unpacked in the system temp dir. Returns a valid extension that the caller // should take ownership on success, or NULL and |error| on failure. // // NOTE: This function does file IO and should not be called on the UI thread. // NOTE: The caller takes ownership of the directory at extension->path() on the // returned object. scoped_refptr<Extension> ConvertWebAppToExtension( const webkit_glue::WebApplicationInfo& web_app_info, const base::Time& create_time); #endif // CHROME_BROWSER_EXTENSIONS_CONVERT_WEB_APP_H_
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_EXTENSIONS_CONVERT_WEB_APP_H_ #define CHROME_BROWSER_EXTENSIONS_CONVERT_WEB_APP_H_ #pragma once #include <string> #include "base/ref_counted.h" class Extension; namespace base { class Time; } namespace webkit_glue { class WebApplicationInfo; } // Generates a version number for an extension from a time. The goal is to make // use of the version number to communicate some useful information. The // returned version has the format: // <year>.<month><day>.<upper 16 bits of unix timestamp>.<lower 16 bits> std::string ConvertTimeToExtensionVersion(const base::Time& time); // Wraps the specified web app in an extension. The extension is created // unpacked in the system temp dir. Returns a valid extension that the caller // should take ownership on success, or NULL and |error| on failure. // // NOTE: This function does file IO and should not be called on the UI thread. // NOTE: The caller takes ownership of the directory at extension->path() on the // returned object. scoped_refptr<Extension> ConvertWebAppToExtension( const webkit_glue::WebApplicationInfo& web_app_info, const base::Time& create_time); #endif // CHROME_BROWSER_EXTENSIONS_CONVERT_WEB_APP_H_
Revert 64847 - Clang fix.
Revert 64847 - Clang fix. [email protected] Review URL: http://codereview.chromium.org/4300003 git-svn-id: http://src.chromium.org/svn/trunk/src@64850 4ff67af0-8c30-449e-8e8b-ad334ec8d88c Former-commit-id: 61481afd2d1e81e91b533a55dc544a62738ba663
C
bsd-3-clause
meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser
ba9708cea07eea6ea71d4ae97f417b2ad11a68f4
examples/clients/TrackerState.c
examples/clients/TrackerState.c
/** @file @brief Implementation @date 2014 @author Ryan Pavlik <[email protected]> <http://sensics.com> */ /* // Copyright 2014 Sensics, Inc. // // All rights reserved. // // (Final version intended to be licensed under // the Apache License, Version 2.0) */ /* Internal Includes */ #include <osvr/ClientKit/ContextC.h> #include <osvr/ClientKit/InterfaceC.h> #include <osvr/ClientKit/InterfaceStateC.h> /* Library/third-party includes */ /* - none */ // Standard includes #include <stdio.h> int main() { OSVR_ClientContext ctx = osvrClientInit("org.opengoggles.exampleclients.TrackerState"); OSVR_ClientInterface lefthand = NULL; /* This is just one of the paths. You can also use: * /me/hands/right * /me/head */ osvrClientGetInterface(ctx, "/me/hands/left", &lefthand); // Pretend that this is your application's mainloop. int i; for (i = 0; i < 1000000; ++i) { osvrClientUpdate(ctx); if (i % 100) { // Every so often let's read the tracker state. // Similar methods exist for all other stock report types. OSVR_PoseState state; OSVR_TimeValue timestamp; OSVR_ReturnCode ret = osvrGetPoseState(lefthand, &timestamp, &state); if (ret != OSVR_RETURN_SUCCESS) { printf("No pose state!\n"); } else { printf("Got POSE state: Position = (%f, %f, %f), orientation = " "(%f, %f, " "%f, %f)\n", report->pose.translation.data[0], report->pose.translation.data[1], report->pose.translation.data[2], osvrQuatGetW(&(report->pose.rotation)), osvrQuatGetX(&(report->pose.rotation)), osvrQuatGetY(&(report->pose.rotation)), osvrQuatGetZ(&(report->pose.rotation))); } } } osvrClientShutdown(ctx); printf("Library shut down, exiting.\n"); return 0; }
Add c version of trackerstate example
Add c version of trackerstate example
C
apache-2.0
feilen/OSVR-Core,leemichaelRazer/OSVR-Core,Armada651/OSVR-Core,leemichaelRazer/OSVR-Core,OSVR/OSVR-Core,leemichaelRazer/OSVR-Core,OSVR/OSVR-Core,feilen/OSVR-Core,d235j/OSVR-Core,Armada651/OSVR-Core,d235j/OSVR-Core,leemichaelRazer/OSVR-Core,godbyk/OSVR-Core,godbyk/OSVR-Core,OSVR/OSVR-Core,Armada651/OSVR-Core,Armada651/OSVR-Core,OSVR/OSVR-Core,d235j/OSVR-Core,d235j/OSVR-Core,d235j/OSVR-Core,OSVR/OSVR-Core,feilen/OSVR-Core,feilen/OSVR-Core,leemichaelRazer/OSVR-Core,godbyk/OSVR-Core,godbyk/OSVR-Core,godbyk/OSVR-Core,Armada651/OSVR-Core,OSVR/OSVR-Core,godbyk/OSVR-Core,feilen/OSVR-Core
c216edbcc760e7b2dc7cb652f179f96b0bcde17c
test/CodeGen/parameter-passing.c
test/CodeGen/parameter-passing.c
// Check the various ways in which the three classes of values // (scalar, complex, aggregate) interact with parameter passing // (function entry, function return, call argument, call result). // RUN: clang %s -triple i386-unknown-unknown -O3 -emit-llvm -o %t && // RUN: not grep '@g0' %t && // FIXME: Enable once PR3489 is fixed. // RUNX: clang %s -triple x86_64-unknown-unknown -O3 -emit-llvm -o %t && // RUNX: not grep '@g0' %t && // RUN: clang %s -triple ppc-unknown-unknown -O3 -emit-llvm -o %t && // RUN: not grep '@g0' %t && // RUN: true typedef int ScalarTy; typedef _Complex int ComplexTy; typedef struct { int a, b, c; } AggrTy; static int result; static AggrTy aggr_id(AggrTy a) { return a; } static ScalarTy scalar_id(ScalarTy a) { return a; } static ComplexTy complex_id(ComplexTy a) { return a; } static void aggr_mul(AggrTy a) { result *= a.a * a.b * a.c; } static void scalar_mul(ScalarTy a) { result *= a; } static void complex_mul(ComplexTy a) { result *= __real a * __imag a; } extern void g0(void); void f0(void) { result = 1; aggr_mul(aggr_id((AggrTy) { 2, 3, 5})); scalar_mul(scalar_id(7)); complex_mul(complex_id(11 + 13i)); // This call should be eliminated. if (result != 30030) g0(); }
Add bare bones test that parameter passing is consistent for scalar/complex/aggregate cases. - Currently disabled for x86_64, triggering a misoptimization (PR3489).
Add bare bones test that parameter passing is consistent for scalar/complex/aggregate cases. - Currently disabled for x86_64, triggering a misoptimization (PR3489). git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@63864 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
97fb6f33f7ff850c2ce8a52e1f2ad9eb520d71e0
test/CodeGen/arm-vector-align.c
test/CodeGen/arm-vector-align.c
// RUN: %clang_cc1 -triple thumbv7-apple-darwin \ // RUN: -target-abi apcs-gnu \ // RUN: -target-cpu cortex-a8 \ // RUN: -mfloat-abi soft \ // RUN: -target-feature +soft-float-abi \ // RUN: -ffreestanding \ // RUN: -emit-llvm -w -o - %s | FileCheck %s #include <arm_neon.h> // Radar 9311427: Check that alignment specifier is used in Neon load/store // intrinsics. typedef float AlignedAddr __attribute__ ((aligned (16))); void t1(AlignedAddr *addr1, AlignedAddr *addr2) { // CHECK: call <4 x float> @llvm.arm.neon.vld1.v4f32(i8* %{{.*}}, i32 16) float32x4_t a = vld1q_f32(addr1); // CHECK: call void @llvm.arm.neon.vst1.v4f32(i8* %{{.*}}, <4 x float> %{{.*}}, i32 16) vst1q_f32(addr2, a); }
Add a testcase for svn r129964 (Neon load/store intrinsic alignments).
Add a testcase for svn r129964 (Neon load/store intrinsic alignments). git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@129979 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
f8c16eb52a703986b5448c23fd02838af152978a
ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_core.h
ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_core.h
// Copyright 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_CORE_H_ #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_CORE_H_ #include "native_client/src/include/nacl_macros.h" class PPB_Core; namespace ppapi_proxy { // Implements the untrusted side of the PPB_Core interface. // We will also need an rpc service to implement the trusted side, which is a // very thin wrapper around the PPB_Core interface returned from the browser. class PluginCore { public: // Return an interface pointer usable by PPAPI plugins. static const PPB_Core* GetInterface(); // Mark the calling thread as the main thread for IsMainThread. static void MarkMainThread(); private: NACL_DISALLOW_COPY_AND_ASSIGN(PluginCore); }; } // namespace ppapi_proxy #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_CORE_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_CORE_H_ #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_CORE_H_ #include "native_client/src/include/nacl_macros.h" struct PPB_Core; namespace ppapi_proxy { // Implements the untrusted side of the PPB_Core interface. // We will also need an rpc service to implement the trusted side, which is a // very thin wrapper around the PPB_Core interface returned from the browser. class PluginCore { public: // Return an interface pointer usable by PPAPI plugins. static const PPB_Core* GetInterface(); // Mark the calling thread as the main thread for IsMainThread. static void MarkMainThread(); private: NACL_DISALLOW_COPY_AND_ASSIGN(PluginCore); }; } // namespace ppapi_proxy #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_CORE_H_
Declare PPB_Core as a struct, not a class. (Prevents Clang warning)
Declare PPB_Core as a struct, not a class. (Prevents Clang warning) Review URL: http://codereview.chromium.org/8002017 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@102565 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
robclark/chromium,hujiajie/pa-chromium,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,robclark/chromium,anirudhSK/chromium,littlstar/chromium.src,dednal/chromium.src,Chilledheart/chromium,dednal/chromium.src,dednal/chromium.src,keishi/chromium,patrickm/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,hujiajie/pa-chromium,Pluto-tv/chromium-crosswalk,keishi/chromium,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,robclark/chromium,PeterWangIntel/chromium-crosswalk,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,krieger-od/nwjs_chromium.src,anirudhSK/chromium,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,zcbenz/cefode-chromium,dushu1203/chromium.src,fujunwei/chromium-crosswalk,patrickm/chromium.src,littlstar/chromium.src,pozdnyakov/chromium-crosswalk,axinging/chromium-crosswalk,robclark/chromium,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,M4sse/chromium.src,Just-D/chromium-1,krieger-od/nwjs_chromium.src,keishi/chromium,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,zcbenz/cefode-chromium,pozdnyakov/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,Chilledheart/chromium,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,ltilve/chromium,mogoweb/chromium-crosswalk,dushu1203/chromium.src,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,dushu1203/chromium.src,zcbenz/cefode-chromium,littlstar/chromium.src,PeterWangIntel/chromium-crosswalk,keishi/chromium,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,keishi/chromium,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,M4sse/chromium.src,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,jaruba/chromium.src,fujunwei/chromium-crosswalk,fujunwei/chromium-crosswalk,mogoweb/chromium-crosswalk,rogerwang/chromium,zcbenz/cefode-chromium,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,markYoungH/chromium.src,mogoweb/chromium-crosswalk,junmin-zhu/chromium-rivertrail,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,junmin-zhu/chromium-rivertrail,ltilve/chromium,hgl888/chromium-crosswalk-efl,zcbenz/cefode-chromium,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,hujiajie/pa-chromium,crosswalk-project/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,M4sse/chromium.src,dednal/chromium.src,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,timopulkkinen/BubbleFish,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,jaruba/chromium.src,keishi/chromium,ondra-novak/chromium.src,crosswalk-project/chromium-crosswalk-efl,rogerwang/chromium,ondra-novak/chromium.src,hujiajie/pa-chromium,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,ltilve/chromium,ChromiumWebApps/chromium,junmin-zhu/chromium-rivertrail,Just-D/chromium-1,Jonekee/chromium.src,Jonekee/chromium.src,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ondra-novak/chromium.src,pozdnyakov/chromium-crosswalk,dednal/chromium.src,chuan9/chromium-crosswalk,hujiajie/pa-chromium,hujiajie/pa-chromium,TheTypoMaster/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,dednal/chromium.src,fujunwei/chromium-crosswalk,anirudhSK/chromium,fujunwei/chromium-crosswalk,keishi/chromium,junmin-zhu/chromium-rivertrail,hujiajie/pa-chromium,pozdnyakov/chromium-crosswalk,junmin-zhu/chromium-rivertrail,rogerwang/chromium,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,zcbenz/cefode-chromium,Jonekee/chromium.src,rogerwang/chromium,Just-D/chromium-1,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,dednal/chromium.src,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,markYoungH/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,nacl-webkit/chrome_deps,anirudhSK/chromium,ltilve/chromium,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,rogerwang/chromium,Chilledheart/chromium,chuan9/chromium-crosswalk,markYoungH/chromium.src,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,littlstar/chromium.src,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,littlstar/chromium.src,bright-sparks/chromium-spacewalk,ondra-novak/chromium.src,Jonekee/chromium.src,keishi/chromium,junmin-zhu/chromium-rivertrail,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,Just-D/chromium-1,crosswalk-project/chromium-crosswalk-efl,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,Jonekee/chromium.src,Jonekee/chromium.src,rogerwang/chromium,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,M4sse/chromium.src,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,Just-D/chromium-1,dednal/chromium.src,dushu1203/chromium.src,ondra-novak/chromium.src,PeterWangIntel/chromium-crosswalk,littlstar/chromium.src,axinging/chromium-crosswalk,rogerwang/chromium,Just-D/chromium-1,rogerwang/chromium,mogoweb/chromium-crosswalk,jaruba/chromium.src,Jonekee/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk,zcbenz/cefode-chromium,littlstar/chromium.src,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,junmin-zhu/chromium-rivertrail,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,markYoungH/chromium.src,timopulkkinen/BubbleFish,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,keishi/chromium,Fireblend/chromium-crosswalk,nacl-webkit/chrome_deps,Jonekee/chromium.src,rogerwang/chromium,patrickm/chromium.src,jaruba/chromium.src,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk,rogerwang/chromium,keishi/chromium,pozdnyakov/chromium-crosswalk,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,keishi/chromium,dushu1203/chromium.src,hujiajie/pa-chromium,pozdnyakov/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,robclark/chromium,hgl888/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,ChromiumWebApps/chromium,Just-D/chromium-1,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,ltilve/chromium,bright-sparks/chromium-spacewalk,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,markYoungH/chromium.src,M4sse/chromium.src,axinging/chromium-crosswalk,markYoungH/chromium.src,robclark/chromium,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,timopulkkinen/BubbleFish,jaruba/chromium.src,krieger-od/nwjs_chromium.src,dednal/chromium.src,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk,Chilledheart/chromium,dushu1203/chromium.src,patrickm/chromium.src,axinging/chromium-crosswalk,nacl-webkit/chrome_deps,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,anirudhSK/chromium,ondra-novak/chromium.src,hujiajie/pa-chromium,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk,Jonekee/chromium.src,zcbenz/cefode-chromium,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,robclark/chromium,Pluto-tv/chromium-crosswalk,timopulkkinen/BubbleFish,patrickm/chromium.src,axinging/chromium-crosswalk,ltilve/chromium,mogoweb/chromium-crosswalk,anirudhSK/chromium,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,robclark/chromium,hujiajie/pa-chromium,patrickm/chromium.src,anirudhSK/chromium,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,ltilve/chromium,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,ondra-novak/chromium.src,nacl-webkit/chrome_deps,patrickm/chromium.src,patrickm/chromium.src,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,Jonekee/chromium.src,jaruba/chromium.src,markYoungH/chromium.src,anirudhSK/chromium,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,robclark/chromium,robclark/chromium,ltilve/chromium,anirudhSK/chromium,dednal/chromium.src,anirudhSK/chromium,zcbenz/cefode-chromium,chuan9/chromium-crosswalk,Chilledheart/chromium,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,patrickm/chromium.src
dbb4fc6fb1f9967305f5490969a2b05c659d4b51
Problem039/C/solution_1.c
Problem039/C/solution_1.c
#include <stdio.h> #define MAX 1000 int main() { int i, j, k, maxP; int ps[1001]; for(i = 1; i <= MAX; i++) { for(j = i;j <= MAX; j++) { for(k = j; (k * k) < (i * i + j * j); k++); if((i * i + j * j) == (k * k) && (i + j + k) <= MAX) { ps[i+j+k]++; } } } for(i = 1; i <= MAX; i++) { if(ps[maxP] < ps[i]) maxP = i; } printf("%d\n",maxP); return 0; }
#include <stdio.h> #define MAX 1000 int main() { int i, j , k, maxP = 1; int ps[1001]; for (i=0; i <= MAX; ps[++i] =0); for(i = 1; i <= MAX; i++) { for(j = i;j <= MAX; j++) { for(k = j; (k * k) < (i * i + j * j); k++); if((i * i + j * j) == (k * k) && (i + j + k) <= MAX) { ps[i+j+k] += 1; } } } for(i = 1; i <= MAX; i++) { if(ps[maxP] < ps[i]) maxP = i; } printf("%d\n",maxP); return 0; }
Fix C solution for Problem039
Fix C solution for Problem039 The Author forgot to explicitily initialize the vector elements with zeros. On my computer, without this, I get the wrong answer. BTW, if maxP is not defined before, I don't even get a wrong answer. A beatiful segmentation fault is raised.
C
mit
DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler
a6b6814f07cfb18f2203584c015a5a93da8ad9d5
LYCategory/Classes/_Foundation/_Work/NSString+Convert.h
LYCategory/Classes/_Foundation/_Work/NSString+Convert.h
// // NSString+Convert.h // LYCATEGORY // // CREATED BY LUO YU ON 2016-11-04. // COPYRIGHT (C) 2016 LUO YU. ALL RIGHTS RESERVED. // #import <Foundation/Foundation.h> @interface NSString (Convert) - (NSString *)encodingURL; @end
// // NSString+Convert.h // LYCATEGORY // // CREATED BY LUO YU ON 2016-11-04. // COPYRIGHT (C) 2016 LUO YU. ALL RIGHTS RESERVED. // #import <Foundation/Foundation.h> @interface NSString (Convert) - (NSString *)encodingURL; - (NSString *)pinyin; @end
Add : string convert to pinyin
Add : string convert to pinyin
C
mit
blodely/LYCategory,blodely/LYCategory,blodely/LYCategory,blodely/LYCategory
b0411affebefe3ed78dbeb60637d9730159a5d99
tools/cncframework/templates/unified_c_api/common/StepFunc.c
tools/cncframework/templates/unified_c_api/common/StepFunc.c
{% import "common_macros.inc.c" as util with context -%} {% set stepfun = g.stepFunctions[targetStep] -%} #include "{{g.name}}.h" /** * Step function defintion for "{{stepfun.collName}}" */ void {{util.qualified_step_name(stepfun)}}({{ util.print_tag(stepfun.tag, typed=True) }}{{ util.print_bindings(stepfun.inputItems, typed=True) }}{{util.g_ctx_param()}}) { {% if stepfun.rangedInputItems %} // // INPUTS // {% call util.render_indented(1) -%} {{ util.render_step_inputs(stepfun.rangedInputItems) }} {% endcall -%} {% endif %} // // OUTPUTS // {% call util.render_indented(1) -%} {{ util.render_step_outputs(stepfun.outputs) }} {%- endcall %} }
{% import "common_macros.inc.c" as util with context -%} {% set stepfun = g.stepFunctions[targetStep] -%} #include "{{g.name}}.h" /** * Step function definition for "{{stepfun.collName}}" */ void {{util.qualified_step_name(stepfun)}}({{ util.print_tag(stepfun.tag, typed=True) }}{{ util.print_bindings(stepfun.inputItems, typed=True) }}{{util.g_ctx_param()}}) { {% if stepfun.rangedInputItems %} // // INPUTS // {% call util.render_indented(1) -%} {{ util.render_step_inputs(stepfun.rangedInputItems) }} {% endcall -%} {% endif %} // // OUTPUTS // {% call util.render_indented(1) -%} {{ util.render_step_outputs(stepfun.outputs) }} {%- endcall %} }
Fix typo in step function comment
Fix typo in step function comment
C
bsd-3-clause
habanero-rice/cnc-framework,habanero-rice/cnc-framework,chamibuddhika/cnc-framework,habanero-rice/cnc-framework,habanero-rice/cnc-framework,chamibuddhika/cnc-framework,habanero-rice/cnc-framework,habanero-rice/cnc-framework
fc512aaf3562cf8434e63b64c0555e0e6e8d2888
src/exercise118.c
src/exercise118.c
/* Exercise 2-18: Write a program to remove trailing blanks and tabs from each * line of input, and to delete entirely blank lines. */ #include <stdint.h> #include <stdio.h> #include <stdlib.h> struct buffer_node { int32_t data; struct buffer_node *next_node; }; void deleteBuffer(struct buffer_node **buffer_head); int main(int argc, char **argv) { int32_t character = 0; int32_t previous_character = 0; struct buffer_node *buffer_head = NULL; while ((character = getchar()) != EOF) { switch (character) { case ' ': case '\t': { struct buffer_node *new_node = malloc(sizeof(struct buffer_node)); new_node->data = character; new_node->next_node = buffer_head; buffer_head = new_node; break; } case '\n': deleteBuffer(&buffer_head); if (previous_character != character) { putchar(character); } previous_character = character; break; default: { struct buffer_node *current_node = buffer_head; while (current_node != NULL) { putchar(current_node->data); current_node = current_node->next_node; } deleteBuffer(&buffer_head); putchar(character); previous_character = character; break; } } } return EXIT_SUCCESS; } void deleteBuffer(struct buffer_node **buffer_head) { while (*buffer_head != NULL) { struct buffer_node *temp_node = *buffer_head; *buffer_head = (*buffer_head)->next_node; free(temp_node); } }
Add solution to Exercise 1-18.
Add solution to Exercise 1-18.
C
unlicense
damiendart/knr-solutions,damiendart/knr-solutions,damiendart/knr-solutions
7208a32b3dfb6cdd73c509add8378a20b31bb5a7
libyaul/scu/bus/cpu/cpu_slave.c
libyaul/scu/bus/cpu/cpu_slave.c
/* * Copyright (c) 2012-2016 * See LICENSE for details. * * Israel Jacquez <[email protected] */ #include <sys/cdefs.h> #include <smpc/smc.h> #include <cpu/instructions.h> #include <cpu/frt.h> #include <cpu/intc.h> #include <cpu/map.h> #include <cpu/slave.h> static void _slave_entry(void); static void _default_entry(void); static void (*_entry)(void) = _default_entry; void cpu_slave_init(void) { smpc_smc_sshoff_call(); cpu_slave_entry_clear(); cpu_intc_ihr_set(INTC_INTERRUPT_SLAVE_ENTRY, _slave_entry); smpc_smc_sshon_call(); } void cpu_slave_entry_set(void (*entry)(void)) { _entry = (entry != NULL) ? entry : _default_entry; } static void _slave_entry(void) { while (true) { while (((cpu_frt_status_get()) & FRTCS_ICF) == 0x00); cpu_frt_control_chg((uint8_t)~FRTCS_ICF); _entry(); } } static void _default_entry(void) { }
/* * Copyright (c) 2012-2016 * See LICENSE for details. * * Israel Jacquez <[email protected] */ #include <sys/cdefs.h> #include <smpc/smc.h> #include <cpu/instructions.h> #include <cpu/frt.h> #include <cpu/intc.h> #include <cpu/map.h> #include <cpu/slave.h> static void _slave_entry(void); static void _default_entry(void); static void (*_entry)(void) = _default_entry; void cpu_slave_init(void) { smpc_smc_sshoff_call(); cpu_slave_entry_clear(); cpu_intc_ihr_set(INTC_INTERRUPT_SLAVE_ENTRY, _slave_entry); smpc_smc_sshon_call(); } void cpu_slave_entry_set(void (*entry)(void)) { _entry = (entry != NULL) ? entry : _default_entry; } static void __noreturn _slave_entry(void) { while (true) { while (((cpu_frt_status_get()) & FRTCS_ICF) == 0x00); cpu_frt_control_chg((uint8_t)~FRTCS_ICF); _entry(); } } static void _default_entry(void) { }
Mark _slave_entry to never return
Mark _slave_entry to never return
C
mit
ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul
94212f6fdc2b9f135f69e42392485adce8b04cc7
util/metadata.h
util/metadata.h
#include <stdio.h> #include <stdlib.h> #ifndef METADATA_H #define METADATA_H typedef struct Metadata { /** * File's name. */ char md_name[255]; /** * File's extension. */ char md_extension[10]; /** * List of keywords to describe the file. */ char md_keywords[255]; /** * Hash of the content. We use SHA-1 which generates a * 160-bit hash value rendered as 40 digits long in * hexadecimal. */ char md_hash[41]; } Metadata; Metadata *new_metadata(char name[], char extension[], char keywords[], char hash[]); void free_metadata(Metadata *md); Metadata *create_metadata_from_path(char pathFile[1000]); #endif /* METADATA_H */
#include <stdio.h> #include <stdlib.h> #ifndef METADATA_H #define METADATA_H typedef struct Metadata { /** * File's name. */ char md_name[255]; /** * File's extension. */ char md_extension[10]; /** * List of keywords to describe the file. */ char md_keywords[255]; /** * Hash of the content. We use SHA-1 which generates a * 160-bit hash value rendered as 40 digits long in * hexadecimal. */ char md_hash[41]; } Metadata; Metadata *new_metadata(char name[], char extension[], char keywords[], char hash[]); void free_metadata(Metadata *md); Metadata *create_metadata_from_path(char pathFile[1000]); #endif /* METADATA_H */
Indent better than Videl :)
Indent better than Videl :)
C
mit
Videl/FrogidelTorrent,Videl/FrogidelTorrent
e8a66aeb8e09270662bbd58cdd4cebc8537df31c
MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.h
MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.h
// // NSManagedObject+JSONHelpers.h // // Created by Saul Mora on 6/28/11. // Copyright 2011 Magical Panda Software LLC. All rights reserved. // #import <CoreData/CoreData.h> extern NSString * const kMagicalRecordImportCustomDateFormatKey; extern NSString * const kMagicalRecordImportDefaultDateFormatString; extern NSString * const kMagicalRecordImportUnixTimeString; extern NSString * const kMagicalRecordImportAttributeKeyMapKey; extern NSString * const kMagicalRecordImportAttributeValueClassNameKey; extern NSString * const kMagicalRecordImportRelationshipMapKey; extern NSString * const kMagicalRecordImportRelationshipLinkedByKey; extern NSString * const kMagicalRecordImportRelationshipTypeKey; @interface NSManagedObject (MagicalRecord_DataImport) + (instancetype) MR_importFromObject:(id)data; + (instancetype) MR_importFromObject:(id)data inContext:(NSManagedObjectContext *)context; + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData; + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData inContext:(NSManagedObjectContext *)context; @end @interface NSManagedObject (MagicalRecord_DataImportControls) - (BOOL) shouldImport:(id)data; - (void) willImport:(id)data; - (void) didImport:(id)data; @end
// // NSManagedObject+JSONHelpers.h // // Created by Saul Mora on 6/28/11. // Copyright 2011 Magical Panda Software LLC. All rights reserved. // #import <CoreData/CoreData.h> extern NSString * const kMagicalRecordImportCustomDateFormatKey; extern NSString * const kMagicalRecordImportDefaultDateFormatString; extern NSString * const kMagicalRecordImportUnixTimeString; extern NSString * const kMagicalRecordImportAttributeKeyMapKey; extern NSString * const kMagicalRecordImportAttributeValueClassNameKey; extern NSString * const kMagicalRecordImportRelationshipMapKey; extern NSString * const kMagicalRecordImportRelationshipLinkedByKey; extern NSString * const kMagicalRecordImportRelationshipTypeKey; @protocol MagicalRecordDataImportProtocol <NSObject> @optional - (BOOL) shouldImport:(id)data; - (void) willImport:(id)data; - (void) didImport:(id)data; @end @interface NSManagedObject (MagicalRecord_DataImport) <MagicalRecordDataImportProtocol> + (instancetype) MR_importFromObject:(id)data; + (instancetype) MR_importFromObject:(id)data inContext:(NSManagedObjectContext *)context; + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData; + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData inContext:(NSManagedObjectContext *)context; @end
Move the import controls into a formal protocol
Move the import controls into a formal protocol
C
mit
naqi/MagicalRecord,naqi/MagicalRecord
1c27f926c130284b022501596399205b8c8e4b23
UefiCpuPkg/Include/AcpiCpuData.h
UefiCpuPkg/Include/AcpiCpuData.h
/** @file Definitions for CPU S3 data. Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #ifndef _ACPI_CPU_DATA_H_ #define _ACPI_CPU_DATA_H_ // // Register types in register table // typedef enum _REGISTER_TYPE { Msr, ControlRegister, MemoryMapped, CacheControl } REGISTER_TYPE; // // Element of register table entry // typedef struct { REGISTER_TYPE RegisterType; UINT32 Index; UINT8 ValidBitStart; UINT8 ValidBitLength; UINT64 Value; } CPU_REGISTER_TABLE_ENTRY; // // Register table definition, including current table length, // allocated size of this table, and pointer to the list of table entries. // typedef struct { UINT32 TableLength; UINT32 NumberBeforeReset; UINT32 AllocatedSize; UINT32 InitialApicId; CPU_REGISTER_TABLE_ENTRY *RegisterTableEntry; } CPU_REGISTER_TABLE; typedef struct { EFI_PHYSICAL_ADDRESS StartupVector; EFI_PHYSICAL_ADDRESS GdtrProfile; EFI_PHYSICAL_ADDRESS IdtrProfile; EFI_PHYSICAL_ADDRESS StackAddress; UINT32 StackSize; UINT32 NumberOfCpus; EFI_PHYSICAL_ADDRESS MtrrTable; // // Physical address of a CPU_REGISTER_TABLE structure // EFI_PHYSICAL_ADDRESS PreSmmInitRegisterTable; // // Physical address of a CPU_REGISTER_TABLE structure // EFI_PHYSICAL_ADDRESS RegisterTable; EFI_PHYSICAL_ADDRESS ApMachineCheckHandlerBase; UINT32 ApMachineCheckHandlerSize; } ACPI_CPU_DATA; #endif
Add ACPI CPU Data include file
UefiCpuPkg: Add ACPI CPU Data include file Add AcpuCpuData.h that defines a data structure that is shared between modules and is required for ACPI S3 support. APState field removed between V1 and V2 patch. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <[email protected]> Cc: Laszlo Ersek <[email protected]> Reviewed-by: Laszlo Ersek <[email protected]> Reviewed-by: Jeff Fan <[email protected]> git-svn-id: 3158a46dfd52e07d1fda3e32e1ab2e353a00b20f@18642 6f19259b-4bc3-4df7-8a09-765794883524
C
bsd-2-clause
MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2
669cbb41fab72b377fffd64f9ef0171fe13c5834
cleanup.h
cleanup.h
/// /// \file cleanup.h /// \brief Functions to clean up memory /// \defgroup cleanup Memory Cleanup /// \brief Frees memory before loading /// @{ /// #ifndef UVL_CLEANUP #define UVL_CLEANUP #include "types.h" int uvl_cleanup_memory (); int uvl_unload_all_modules (); #endif /// @}
/// /// \file cleanup.h /// \brief Functions to clean up memory /// \defgroup cleanup Memory Cleanup /// \brief Frees memory before loading /// @{ /// #ifndef UVL_CLEANUP #define UVL_CLEANUP #include "types.h" int uvl_cleanup_memory (); int uvl_unload_all_modules(); void uvl_pre_clean(); #endif /// @}
Fix a warning about implicit function declaration.
Fix a warning about implicit function declaration.
C
apache-2.0
MrNetrix/UVLoader,yifanlu/UVLoader,yifanlu/UVLoader,MrNetrix/UVLoader
0602fcde6e03bc08b0a333b291d8fe45cb4f56e3
libevmjit/Utils.h
libevmjit/Utils.h
#pragma once #include <iostream> // The same as assert, but expression is always evaluated and result returned #define CHECK(expr) (assert(expr), expr) #if !defined(NDEBUG) // Debug namespace dev { namespace evmjit { std::ostream& getLogStream(char const* _channel); } } #define DLOG(CHANNEL) ::dev::evmjit::getLogStream(#CHANNEL) #else // Release #define DLOG(CHANNEL) true ? std::cerr : std::cerr #endif
#pragma once #include <iostream> // The same as assert, but expression is always evaluated and result returned #define CHECK(expr) (assert(expr), expr) #if !defined(NDEBUG) // Debug namespace dev { namespace evmjit { std::ostream& getLogStream(char const* _channel); } } #define DLOG(CHANNEL) ::dev::evmjit::getLogStream(#CHANNEL) #else // Release namespace dev { namespace evmjit { struct Voider { void operator=(std::ostream const&) {} }; } } #define DLOG(CHANNEL) true ? (void)0 : ::dev::evmjit::Voider{} = std::cerr #endif
Reimplement no-op version of DLOG to avoid C++ compiler warning
Reimplement no-op version of DLOG to avoid C++ compiler warning
C
mit
LefterisJP/webthree-umbrella,LefterisJP/webthree-umbrella,smartbitcoin/cpp-ethereum,vaporry/cpp-ethereum,johnpeter66/ethminer,expanse-project/cpp-expanse,karek314/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,gluk256/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,arkpar/webthree-umbrella,expanse-project/cpp-expanse,yann300/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,anthony-cros/cpp-ethereum,d-das/cpp-ethereum,xeddmc/cpp-ethereum,vaporry/evmjit,vaporry/cpp-ethereum,smartbitcoin/cpp-ethereum,gluk256/cpp-ethereum,karek314/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,LefterisJP/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,vaporry/webthree-umbrella,yann300/cpp-ethereum,joeldo/cpp-ethereum,d-das/cpp-ethereum,joeldo/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,subtly/cpp-ethereum-micro,d-das/cpp-ethereum,joeldo/cpp-ethereum,programonauta/webthree-umbrella,xeddmc/cpp-ethereum,ethers/cpp-ethereum,anthony-cros/cpp-ethereum,xeddmc/cpp-ethereum,yann300/cpp-ethereum,anthony-cros/cpp-ethereum,chfast/webthree-umbrella,vaporry/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,smartbitcoin/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,ethers/cpp-ethereum,johnpeter66/ethminer,PaulGrey30/go-get--u-github.com-tools-godep,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,yann300/cpp-ethereum,expanse-org/cpp-expanse,smartbitcoin/cpp-ethereum,ethers/cpp-ethereum,LefterisJP/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,programonauta/webthree-umbrella,d-das/cpp-ethereum,vaporry/cpp-ethereum,vaporry/evmjit,joeldo/cpp-ethereum,expanse-project/cpp-expanse,d-das/cpp-ethereum,subtly/cpp-ethereum-micro,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,eco/cpp-ethereum,expanse-org/cpp-expanse,anthony-cros/cpp-ethereum,expanse-org/cpp-expanse,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,joeldo/cpp-ethereum,LefterisJP/cpp-ethereum,yann300/cpp-ethereum,karek314/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,expanse-org/cpp-expanse,karek314/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,ethers/cpp-ethereum,xeddmc/cpp-ethereum,subtly/cpp-ethereum-micro,expanse-project/cpp-expanse,d-das/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,eco/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,LefterisJP/cpp-ethereum,anthony-cros/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,expanse-project/cpp-expanse,eco/cpp-ethereum,eco/cpp-ethereum,vaporry/cpp-ethereum,subtly/cpp-ethereum-micro,subtly/cpp-ethereum-micro,gluk256/cpp-ethereum,LefterisJP/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,eco/cpp-ethereum,karek314/cpp-ethereum,johnpeter66/ethminer,smartbitcoin/cpp-ethereum,karek314/cpp-ethereum,yann300/cpp-ethereum,expanse-org/cpp-expanse,subtly/cpp-ethereum-micro,gluk256/cpp-ethereum,expanse-project/cpp-expanse,ethers/cpp-ethereum,gluk256/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,vaporry/cpp-ethereum,gluk256/cpp-ethereum,joeldo/cpp-ethereum,ethers/cpp-ethereum,xeddmc/cpp-ethereum,LefterisJP/cpp-ethereum,smartbitcoin/cpp-ethereum,eco/cpp-ethereum,expanse-org/cpp-expanse,Sorceror32/go-get--u-github.com-tools-godep,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,xeddmc/cpp-ethereum,anthony-cros/cpp-ethereum
4f78441af442507e2496e40d7f150934bc984d8b
linkedLists/linked_lists_test.c
linkedLists/linked_lists_test.c
//tests for linked lists tasks from the "Cracking The Coding Interview". #include <assert.h> #include <stdbool.h> int main() { assert(false && "First unit test"); return 0; }
//tests for linked lists tasks from the "Cracking The Coding Interview". #include <assert.h> #include <stdbool.h> #include "../../c_double_linked_list/double_linked_list.h" int main() { struct Node* h = initHeadNode(0); printList(h); clear(h); return 0; }
Add simple test (proof of working) for double linked list api.
Add simple test (proof of working) for double linked list api.
C
bsd-3-clause
MikhSol/crackingTheCodingInterviewC
91f7575783f81b3f4816ff06f0755f77c7870309
src/functionals/pbec_eps.h
src/functionals/pbec_eps.h
#ifndef PBEC_EPS_H #define PBEC_EPS_H #include "functional.h" #include "constants.h" #include "pw92eps.h" #include "vwn.h" namespace pbec_eps { template<class num, class T> static num A(const num &eps, const T &u3) { using xc_constants::param_beta_gamma; using xc_constants::param_gamma; return param_beta_gamma/expm1(-eps/(param_gamma*u3)); } template<class num, class T> static num H(const num &d2, const num &eps, const T &u3) { num d2A = d2*A(eps,u3); using xc_constants::param_gamma; using xc_constants::param_beta_gamma; return param_gamma*u3* log(1+param_beta_gamma*d2*(1 + d2A)/(1+d2A*(1+d2A))); } // This is [(1+zeta)^(2/3) + (1-zeta)^(2/3)]/2, reorganized. template<class num> static num phi(const densvars<num> &d) { return pow(2.0,-1.0/3.0)*d.n_m13*d.n_m13*(sqrt(d.a_43)+sqrt(d.b_43)); } template<class num> static num pbec_eps(const densvars<num> &d) { num eps = pw92eps::pw92eps(d); num u = phi(d); // Avoiding the square root of d.gnn here num d2 = pow(1.0/12*pow(3,5.0/6.0)/pow(M_PI,-1.0/6),2)* d.gnn/(u*u*pow(d.n,7.0/3.0)); return (eps + H(d2,eps,pow3(u))); } template<class num> static num pbec_eps_polarized(const num &a, const num &gaa) { num eps = pw92eps::pw92eps_polarized(a); parameter u = pow(2.0,-1.0/3.0); //phi(d) for alpha or beta density =0 // Avoiding the square root of d.gnn here num d2 = pow(1.0/12*pow(3,5.0/6.0)/pow(M_PI,-1.0/6),2)* gaa/(u*u*pow(a,7.0/3.0)); return (eps + H(d2,eps,pow3(u))); } } #endif
Add forgotten PBE epsilon header.
Add forgotten PBE epsilon header.
C
mpl-2.0
bast/xcfun,robertodr/xcfun,bast/xcfun,bast/xcfun,robertodr/xcfun,robertodr/xcfun,robertodr/xcfun,dftlibs/xcfun,bast/xcfun,dftlibs/xcfun,dftlibs/xcfun,dftlibs/xcfun
15f9ff29c88bec7fd0488013ed0168a091ed139a
src/win32/jet_endian_win.c
src/win32/jet_endian_win.c
/* *The MIT License (MIT) * * Copyright (c) <2017> <Stephan Gatzka> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include <stdint.h> #include <winsock2.h> #include "jet_endian.h" uint16_t jet_be16toh(uint16_t big_endian_16bits) { return ntohs(big_endian_16bits); } uint32_t jet_be32toh(uint32_t big_endian_32bits) { return ntohl(big_endian_32bits); } uint64_t jet_be64toh(uint64_t big_endian_64bits) { return ntohll(big_endian_64bits); } uint16_t jet_htobe16(uint16_t host_endian_16bits) { return htons(host_endian_16bits); } uint32_t jet_htobe32(uint32_t host_endian_32bits) { return htonl(host_endian_32bits); } uint64_t jet_htobe64(uint64_t host_endian_64bits) { return htonll(host_endian_64bits); }
Add endianess conversion functions for windows.
Add endianess conversion functions for windows.
C
mit
gatzka/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet
10ca149c4add37f104200e33271d826460f8964b
drivers/scsi/qla4xxx/ql4_version.h
drivers/scsi/qla4xxx/ql4_version.h
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.04.00-k3"
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.04.00-k4"
Update driver version to 5.04.00-k4
[SCSI] qla4xxx: Update driver version to 5.04.00-k4 Signed-off-by: Vikas Chaudhary <[email protected]> Signed-off-by: James Bottomley <[email protected]>
C
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
7d4c665aff3750a072ca2cf3e36b862f7668e3c8
Glitter/Sources/Engine/Base/Common/Common.h
Glitter/Sources/Engine/Base/Common/Common.h
#pragma once // Branch prediction hints #define LIKELY(condition) __builtin_expect(static_cast<bool>(condition), 1) #define UNLIKELY(condition) __builtin_expect(static_cast<bool>(condition), 0)
Add common header - just has branch prediction hint macros for now
Add common header - just has branch prediction hint macros for now
C
mit
minimumcut/UnnamedEngine,minimumcut/UnnamedEngine
1cb1819cbae564c8a3bda066c73987368e921ac9
src/api/add.h
src/api/add.h
#ifndef CTF_ADD_H #define CTF_ADD_H #include <sys/queue.h> #include <sys/stddef.h> #include "file/errors.h" #define _CTF_ADD_PROTO(FUNCTION_NAME, OBJECT_TYPE, VALUE_TYPE) \ int \ FUNCTION_NAME (OBJECT_TYPE object, VALUE_TYPE value); #define _CTF_ADD_IMPL(FUNCTION_NAME, OBJECT_TYPE, VALUE_TYPE, LIST_NAME, \ LIST_ENTRY_NAME) \ int \ FUNCTION_NAME (OBJECT_TYPE object, VALUE_TYPE value) \ { \ if (object != NULL) \ { \ if (object->LIST_NAME != NULL) \ { \ TAILQ_INSERT_TAIL(object->LIST_NAME, value, LIST_ENTRY_NAME); \ return CTF_OK; \ } \ else \ return CTF_E_NULL; \ } \ else \ return CTF_E_NULL; \ } #endif
#ifndef CTF_ADD_H #define CTF_ADD_H #include <sys/queue.h> #include <sys/stddef.h> #include "file/errors.h" #define _CTF_ADD_PROTO(FUNCTION_NAME, OBJECT_TYPE, VALUE_TYPE) \ int \ FUNCTION_NAME (OBJECT_TYPE object, VALUE_TYPE value); #define _CTF_ADD_IMPL(FUNCTION_NAME, OBJECT_TYPE, VALUE_TYPE, LIST_NAME, \ LIST_ENTRY_NAME, LIST_COUNTER) \ int \ FUNCTION_NAME (OBJECT_TYPE object, VALUE_TYPE value) \ { \ if (object != NULL) \ { \ if (object->LIST_NAME != NULL) \ { \ TAILQ_INSERT_TAIL(object->LIST_NAME, value, LIST_ENTRY_NAME); \ object->LIST_COUNTER++; \ return CTF_OK; \ } \ else \ return CTF_E_NULL; \ } \ else \ return CTF_E_NULL; \ } #endif
Add API increments count variable
Add API increments count variable
C
bsd-2-clause
lovasko/libctf,lovasko/libctf
f37546c433f29d3f0b7d1dd0461729df18597cee
solutions/uri/1017/1017.c
solutions/uri/1017/1017.c
#include <math.h> #include <stdio.h> int main() { float h, s; scanf("%f", &h); scanf("%f", &s); printf("%.3f\n", h * s / 12.0); }
Solve Fuel Spent in c
Solve Fuel Spent in c
C
mit
deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground
becd309739fcd9e9f6fecdeb0ccf5cac3523caee
adapters/Mintegral/MintegralAdapter/GADMediationAdapterMintegralConstants.h
adapters/Mintegral/MintegralAdapter/GADMediationAdapterMintegralConstants.h
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // 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/Foundation.h> /// Mintegral mediation adapter version. static NSString *const GADMAdapterMintegralVersion = @"7.2.1.0"; /// Mintegral mediation adapter Mintegral App ID parameter key. static NSString *const GADMAdapterMintegralAppID = @"app_id"; /// Mintegral mediation adapter Mintegral App Key parameter key. static NSString *const GADMAdapterMintegralAppKey = @"app_key"; /// Mintegral mediation adapter Ad Unit ID parameter key. static NSString *const GADMAdapterMintegralAdUnitID = @"ad_unit_id"; /// Mintegral mediation adapter Ad Placement ID parameter key. static NSString *const GADMAdapterMintegralPlacementID = @"placement_id"; /// Mintegral adapter error domain. static NSString *const GADMAdapterMintegralErrorDomain = @"com.google.mediation.mintegral";
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // 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/Foundation.h> /// Mintegral mediation adapter version. static NSString *const GADMAdapterMintegralVersion = @"7.2.4.0"; /// Mintegral mediation adapter Mintegral App ID parameter key. static NSString *const GADMAdapterMintegralAppID = @"app_id"; /// Mintegral mediation adapter Mintegral App Key parameter key. static NSString *const GADMAdapterMintegralAppKey = @"app_key"; /// Mintegral mediation adapter Ad Unit ID parameter key. static NSString *const GADMAdapterMintegralAdUnitID = @"ad_unit_id"; /// Mintegral mediation adapter Ad Placement ID parameter key. static NSString *const GADMAdapterMintegralPlacementID = @"placement_id"; /// Mintegral adapter error domain. static NSString *const GADMAdapterMintegralErrorDomain = @"com.google.mediation.mintegral";
Modify the adapter version number.
Modify the adapter version number.
C
apache-2.0
googleads/googleads-mobile-ios-mediation,googleads/googleads-mobile-ios-mediation,googleads/googleads-mobile-ios-mediation,googleads/googleads-mobile-ios-mediation
bc65ee3b42944d7f36645334ca083a6d82eda6f9
src/lib/ldm.h
src/lib/ldm.h
/* * This file is part of linux-driver-management. * * Copyright © 2016-2017 Ikey Doherty * * linux-driver-management is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 * of the License, or (at your option) any later version. */ #pragma once #include <manager.h> /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=8 tabstop=8 expandtab: * :indentSize=8:tabSize=8:noTabs=true: */
/* * This file is part of linux-driver-management. * * Copyright © 2016-2017 Ikey Doherty * * linux-driver-management is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 * of the License, or (at your option) any later version. */ #pragma once #include <device.h> #include <manager.h> /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=8 tabstop=8 expandtab: * :indentSize=8:tabSize=8:noTabs=true: */
Include device in the LDM headers
Include device in the LDM headers Signed-off-by: Ikey Doherty <[email protected]>
C
lgpl-2.1
solus-project/linux-driver-management,solus-project/linux-driver-management
8d873ed8fa874802c30983001bb10366c7f13401
lib/node_modules/@stdlib/strided/common/include/stdlib/strided_macros.h
lib/node_modules/@stdlib/strided/common/include/stdlib/strided_macros.h
/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib 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. */ /** * Header file containing strided array macros. */ #ifndef STDLIB_STRIDED_MACROS_H #define STDLIB_STRIDED_MACROS_H #include "strided_nullary_macros.h" #include "strided_unary_macros.h" #include "strided_binary_macros.h" #include "strided_ternary_macros.h" #include "strided_quaternary_macros.h" #include "strided_quinary_macros.h" #endif // !STDLIB_STRIDED_MACROS_H
/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib 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. */ /** * Header file containing strided array macros. */ #ifndef STDLIB_STRIDED_MACROS_H #define STDLIB_STRIDED_MACROS_H // Note: keep in alphabetical order... #include "strided_binary_macros.h" #include "strided_nullary_macros.h" #include "strided_quaternary_macros.h" #include "strided_quinary_macros.h" #include "strided_ternary_macros.h" #include "strided_unary_macros.h" #endif // !STDLIB_STRIDED_MACROS_H
Sort headers in alphabetical order
Sort headers in alphabetical order
C
apache-2.0
stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib
2b1c7246a6be5f0b57ee0cfea70b6a2613163b7e
src/modules/sdl/consumer_sdl_osx.h
src/modules/sdl/consumer_sdl_osx.h
/* * consumer_sdl_osx.m -- An OS X compatibility shim for SDL * Copyright (C) 2010 Ushodaya Enterprises Limited * Author: Dan Dennedy * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _CONSUMER_SDL_OSX_H_ #define _CONSUMER_SDL_OSX_H_ #ifdef __DARWIN__ void* mlt_cocoa_autorelease_init(); void mlt_cocoa_autorelease_close( void* ); #else static inline void *mlt_cocoa_autorelease_init() { return NULL; } static inline void mlt_cocoa_autorelease_close(void*) { } #endif #endif
/* * consumer_sdl_osx.m -- An OS X compatibility shim for SDL * Copyright (C) 2010 Ushodaya Enterprises Limited * Author: Dan Dennedy * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _CONSUMER_SDL_OSX_H_ #define _CONSUMER_SDL_OSX_H_ #ifdef __DARWIN__ void* mlt_cocoa_autorelease_init(); void mlt_cocoa_autorelease_close( void* ); #else static inline void *mlt_cocoa_autorelease_init() { return NULL; } static inline void mlt_cocoa_autorelease_close(void* p) { } #endif #endif
Fix build on non-OSX due to missing parameter name.
Fix build on non-OSX due to missing parameter name.
C
lgpl-2.1
ttill/MLT,ttill/MLT-roto,siddharudh/mlt,xzhavilla/mlt,anba8005/mlt,zzhhui/mlt,ttill/MLT-roto-tracking,mltframework/mlt,siddharudh/mlt,j-b-m/mlt,mltframework/mlt,wideioltd/mlt,zzhhui/mlt,xzhavilla/mlt,j-b-m/mlt,zzhhui/mlt,siddharudh/mlt,anba8005/mlt,j-b-m/mlt,ttill/MLT-roto,ttill/MLT-roto-tracking,mltframework/mlt,gmarco/mlt-orig,wideioltd/mlt,xzhavilla/mlt,ttill/MLT,j-b-m/mlt,j-b-m/mlt,j-b-m/mlt,mltframework/mlt,xzhavilla/mlt,siddharudh/mlt,ttill/MLT-roto-tracking,xzhavilla/mlt,wideioltd/mlt,zzhhui/mlt,ttill/MLT,zzhhui/mlt,j-b-m/mlt,ttill/MLT-roto,ttill/MLT-roto,gmarco/mlt-orig,ttill/MLT-roto-tracking,siddharudh/mlt,wideioltd/mlt,ttill/MLT-roto,anba8005/mlt,gmarco/mlt-orig,ttill/MLT,anba8005/mlt,zzhhui/mlt,ttill/MLT-roto,anba8005/mlt,j-b-m/mlt,mltframework/mlt,gmarco/mlt-orig,wideioltd/mlt,ttill/MLT-roto-tracking,anba8005/mlt,gmarco/mlt-orig,wideioltd/mlt,xzhavilla/mlt,ttill/MLT-roto,gmarco/mlt-orig,ttill/MLT,mltframework/mlt,zzhhui/mlt,mltframework/mlt,ttill/MLT,gmarco/mlt-orig,j-b-m/mlt,gmarco/mlt-orig,gmarco/mlt-orig,mltframework/mlt,mltframework/mlt,wideioltd/mlt,xzhavilla/mlt,ttill/MLT,ttill/MLT-roto-tracking,j-b-m/mlt,siddharudh/mlt,siddharudh/mlt,ttill/MLT-roto-tracking,wideioltd/mlt,zzhhui/mlt,ttill/MLT-roto-tracking,ttill/MLT-roto-tracking,ttill/MLT-roto,anba8005/mlt,anba8005/mlt,anba8005/mlt,zzhhui/mlt,ttill/MLT-roto,xzhavilla/mlt,mltframework/mlt,wideioltd/mlt,siddharudh/mlt,ttill/MLT,siddharudh/mlt,xzhavilla/mlt,ttill/MLT
f32bb0311860f453a1b1f4d8c5755c26894e8b41
src/platform/governance.h
src/platform/governance.h
#ifndef CROWN_PLATFORM_GOVERNANCE_H #define CROWN_PLATFORM_GOVERNANCE_H #include "primitives/transaction.h" #include "uint256.h" #include <boost/function.hpp> #include <vector> namespace Platform { class Vote { public: enum Value { abstain = 0, yes, no }; CTxIn voterId; int64_t electionCode; uint256 candidate; Value value; std::vector<unsigned char> signature; }; class VotingRound { public: virtual void RegisterCandidate(uint256 id) = 0; virtual void AcceptVote(const Vote& vote) = 0; virtual std::vector<uint256> CalculateResult() const = 0; virtual void NotifyResultChange( boost::function<void(uint256)> onElected, boost::function<void(uint256)> onDismissed ) = 0; }; VotingRound& AgentsVoting(); } #endif //CROWN_PLATFORM_GOVERNANCE_H
#ifndef CROWN_PLATFORM_GOVERNANCE_H #define CROWN_PLATFORM_GOVERNANCE_H #include "primitives/transaction.h" #include "uint256.h" #include <boost/function.hpp> #include <vector> namespace Platform { class Vote { public: enum Value { abstain = 0, yes, no }; CTxIn voterId; int64_t electionCode; uint256 candidate; Value value; std::vector<unsigned char> signature; }; class VotingRound { public: virtual ~VotingRound() = default; virtual void RegisterCandidate(uint256 id) = 0; virtual void AcceptVote(const Vote& vote) = 0; virtual std::vector<uint256> CalculateResult() const = 0; virtual void NotifyResultChange( boost::function<void(uint256)> onElected, boost::function<void(uint256)> onDismissed ) = 0; }; VotingRound& AgentsVoting(); } #endif //CROWN_PLATFORM_GOVERNANCE_H
Fix issues pointed out in review
Fix issues pointed out in review
C
mit
Crowndev/crowncoin,Crowndev/crowncoin,Crowndev/crowncoin,Crowndev/crowncoin,Crowndev/crowncoin,Crowndev/crowncoin
f95dd734687945f12b708f2659ac8198b640d959
test/CodeGen/2009-10-20-GlobalDebug.c
test/CodeGen/2009-10-20-GlobalDebug.c
// RUN: %clang -ccc-host-triple i386-apple-darwin10 -S -g -dA %s -o - | FileCheck %s int global; // CHECK: asciz "global" ## DW_AT_name int main() { return 0;}
// RUN: %clang -ccc-host-triple i386-apple-darwin10 -S -g -dA %s -o - | FileCheck %s int global; // CHECK: asciz "global" ## External Name int main() { return 0;}
Adjust testcase for recent DWARF printer changes.
Adjust testcase for recent DWARF printer changes. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@94306 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
2ca2eb5bd6ca7bf2c886384a30b82750b2927822
tests/regression/09-regions/28-list2alloc.c
tests/regression/09-regions/28-list2alloc.c
// PARAM: --set ana.activated[+] "'region'" #include<pthread.h> #include<stdlib.h> #include<stdio.h> struct s { int datum; struct s *next; } *A, *B; struct s *new(int x) { struct s *p = malloc(sizeof(struct s)); p->datum = x; p->next = NULL; return p; } pthread_mutex_t A_mutex = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t B_mutex = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&A_mutex); A->datum++; // RACE <-- this line is also relevant. pthread_mutex_unlock(&A_mutex); pthread_mutex_lock(&B_mutex); B->datum++; // <-- this is not relevant at all. pthread_mutex_unlock(&B_mutex); return NULL; } int main () { pthread_t t1; A = new(3); B = new(5); pthread_create(&t1, NULL, t_fun, NULL); int *data; pthread_mutex_lock(&A_mutex); data = &A->datum; // NORACE pthread_mutex_unlock(&A_mutex); *data = 42; // RACE <-- this is the real bug! return 0; }
Add example for warning ranking.
Add example for warning ranking.
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
cbeac1945a4d0da0745c80a1766dc6ddeb809930
gen_message_hashes/hash_func.h
gen_message_hashes/hash_func.h
static inline unsigned int hash_func_string(const char* key) { unsigned int hash = 0; int c; while ((c = *key++) != 0) hash = c + (hash << 6) + (hash << 16) - hash; return hash; }
static inline uint32_t hash_func_string(const char* key) { uint32_t hash = 0; int c; while ((c = *key++) != 0) hash = c + (hash << 6) + (hash << 16) - hash; return hash; }
Change unsigned int to uint32_t.
Change unsigned int to uint32_t. The fixed width data type is necessary to calculate the hash function correctly.
C
mit
mloy/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,gatzka/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,mloy/cjet
59b6d5b7e4f337320ea12d381e9cad0aa9c9fa75
tests/slice.c
tests/slice.c
#include <stdio.h> #include "../slice.h" #include "../assert.h" #include "../nelem.h" int main( void ) { int const xs[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; printf( "Testing subset slice...\n" ); int const ws[] = { SLICE( xs, 3, 4 ) }; ASSERT( NELEM( ws ) == 4, ws[ 0 ] == xs[ 3 ], ws[ 1 ] == xs[ 4 ], ws[ 2 ] == xs[ 5 ], ws[ 3 ] == xs[ 6 ] ); printf( "Testing total slice...\n" ); int const ys[] = { SLICE( xs, 0, 6 ) }; ASSERT( NELEM( ys ) == 6, ys[ 0 ] == xs[ 0 ], ys[ 1 ] == xs[ 1 ], ys[ 2 ] == xs[ 2 ], ys[ 3 ] == xs[ 3 ], ys[ 4 ] == xs[ 4 ], ys[ 5 ] == xs[ 5 ] ); printf( "Testing empty slice...\n" ); int const zs[] = { 0, SLICE( xs, 2, 0 ) }; ASSERT( NELEM( zs ) == 1 ); printf( "SLICE() tests passed.\n" ); }
#include <stdio.h> #include "../slice.h" #include "../assert.h" #include "../nelem.h" int main( void ) { int const xs[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; printf( "Testing subset slice...\n" ); int const ws[] = { SLICE( xs, 3, 4 ) }; ASSERT( NELEM( ws ) == 4, ws[ 0 ] == xs[ 3 ], ws[ 1 ] == xs[ 4 ], ws[ 2 ] == xs[ 5 ], ws[ 3 ] == xs[ 6 ] ); ( void ) ws; printf( "Testing total slice...\n" ); int const ys[] = { SLICE( xs, 0, 6 ) }; ASSERT( NELEM( ys ) == 6, ys[ 0 ] == xs[ 0 ], ys[ 1 ] == xs[ 1 ], ys[ 2 ] == xs[ 2 ], ys[ 3 ] == xs[ 3 ], ys[ 4 ] == xs[ 4 ], ys[ 5 ] == xs[ 5 ] ); ( void ) ys; printf( "Testing empty slice...\n" ); int const zs[] = { 0, SLICE( xs, 2, 0 ) }; ASSERT( NELEM( zs ) == 1 ); ( void ) zs; printf( "SLICE() tests passed.\n" ); }
Fix 'unused variable' warning on fast build
Fix 'unused variable' warning on fast build
C
agpl-3.0
mcinglis/libmacro,mcinglis/libmacro,mcinglis/libmacro
d3c505c880592f481c7ee356bb6dc6650a95a14b
include/ofpi_config.h
include/ofpi_config.h
/* Copyright (c) 2015, ENEA Software AB * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef _OFPI_CONFIG_H_ #define _OFPI_CONFIG_H_ #include "ofp_config.h" #define ARP_SANITY_CHECK 1 #endif
/* Copyright (c) 2015, ENEA Software AB * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef _OFPI_CONFIG_H_ #define _OFPI_CONFIG_H_ #include "api/ofp_config.h" #define ARP_SANITY_CHECK 1 #endif
Fix include path for ofp_config.h
Fix include path for ofp_config.h Signed-off-by: Bogdan Pricope <[email protected]> Reviewed-by: Sorin Vultureanu <[email protected]>
C
bsd-3-clause
OpenFastPath/ofp,OpenFastPath/ofp,OpenFastPath/ofp,TolikH/ofp,TolikH/ofp,TolikH/ofp,OpenFastPath/ofp
1a9f189af8076cf1f67b92567e47d7dd8e0514fa
applications/plugins/SofaPython/PythonCommon.h
applications/plugins/SofaPython/PythonCommon.h
#ifndef SOFAPYTHON_PYTHON_H #define SOFAPYTHON_PYTHON_H // This header simply includes Python.h, taking care of platform-specific stuff // It should be included before any standard headers: // "Since Python may define some pre-processor definitions which affect the // standard headers on some systems, you must include Python.h before any // standard headers are included." #if defined(_WIN32) # define MS_NO_COREDLL // deactivate pragma linking on Win32 done in Python.h #endif #if defined(_MSC_VER) && defined(_DEBUG) // undefine _DEBUG since we want to always link agains the release version of // python and pyconfig.h automatically links debug version if _DEBUG is defined. // ocarre: no we don't, in debug on Windows we cannot link with python release, if we want to build SofaPython in debug we have to compile python in debug //# undef _DEBUG # include <Python.h> //# define _DEBUG #elif defined(__APPLE__) && defined(__MACH__) # include <Python/Python.h> #else # include <Python.h> #endif #endif
#ifndef SOFAPYTHON_PYTHON_H #define SOFAPYTHON_PYTHON_H // This header simply includes Python.h, taking care of platform-specific stuff // It should be included before any standard headers: // "Since Python may define some pre-processor definitions which affect the // standard headers on some systems, you must include Python.h before any // standard headers are included." #if defined(_WIN32) # define MS_NO_COREDLL // deactivate pragma linking on Win32 done in Python.h # define Py_ENABLE_SHARED 1 // this flag ensure to use dll's version (needed because of MS_NO_COREDLL define). #endif #if defined(_MSC_VER) && defined(_DEBUG) // if you use Python on windows in debug build, be sure to provide a compiled version because // installation package doesn't come with debug libs. # include <Python.h> #elif defined(__APPLE__) && defined(__MACH__) # include <Python/Python.h> #else # include <Python.h> #endif #endif
Fix python link in release build.
Fix python link in release build. Former-commit-id: f2b0e4ff65df702ae4f98bed2a39dcfdc0f7e9c4
C
lgpl-2.1
FabienPean/sofa,Anatoscope/sofa,FabienPean/sofa,hdeling/sofa,FabienPean/sofa,Anatoscope/sofa,hdeling/sofa,Anatoscope/sofa,hdeling/sofa,hdeling/sofa,Anatoscope/sofa,hdeling/sofa,FabienPean/sofa,FabienPean/sofa,Anatoscope/sofa,hdeling/sofa,hdeling/sofa,Anatoscope/sofa,hdeling/sofa,FabienPean/sofa,Anatoscope/sofa,FabienPean/sofa,FabienPean/sofa,hdeling/sofa,FabienPean/sofa,Anatoscope/sofa,FabienPean/sofa,Anatoscope/sofa,hdeling/sofa
4529eb33e50f0662b6711bcc984ad3b298c2b169
src/Atomic.h
src/Atomic.h
/* ******************************************************************************* * * Purpose: Utils. Atomic types helper. * ******************************************************************************* * Copyright Monstrenyatko 2014. * * Distributed under the MIT License. * (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT) ******************************************************************************* */ #ifndef UTILS_ATOMIC_H_ #define UTILS_ATOMIC_H_ #ifndef __has_feature #define __has_feature(__x) 0 #endif #if __has_feature(cxx_atomic) #include <atomic> #else #include <boost/atomic.hpp> #define UTILS_USE_BOOST_ATOMIC #endif namespace Utils { #ifdef UTILS_USE_BOOST_ATOMIC typedef boost::atomic_bool atomic_bool; typedef boost::atomic_uint32_t atomic_uint32_t; #else typedef std::atomic_bool atomic_bool; typedef std::atomic<uint32_t> atomic_uint32_t; #endif } /* namespace Utils */ #endif /* UTILS_ATOMIC_H_ */
/* ******************************************************************************* * * Purpose: Utils. Atomic types helper. * ******************************************************************************* * Copyright Monstrenyatko 2014. * * Distributed under the MIT License. * (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT) ******************************************************************************* */ #ifndef UTILS_ATOMIC_H_ #define UTILS_ATOMIC_H_ #ifndef __has_feature #define __has_feature(__x) 0 #endif #if __cplusplus < 201103L #include <boost/atomic.hpp> #define UTILS_USE_BOOST_ATOMIC #else #include <atomic> #endif namespace Utils { #ifdef UTILS_USE_BOOST_ATOMIC typedef boost::atomic_bool atomic_bool; typedef boost::atomic_uint32_t atomic_uint32_t; #else typedef std::atomic_bool atomic_bool; typedef std::atomic<uint32_t> atomic_uint32_t; #endif } /* namespace Utils */ #endif /* UTILS_ATOMIC_H_ */
Use boost::atomic if C++ compiler older than 201103.
Use boost::atomic if C++ compiler older than 201103.
C
mit
monstrenyatko/butler-xbee-gateway,monstrenyatko/XBeeGateway,monstrenyatko/butler-xbee-gateway,monstrenyatko/XBeeGateway,monstrenyatko/butler-xbee-gateway
9275184cf22bcc045842bee7a26067e62381178a
lib/Remarks/RemarkParserImpl.h
lib/Remarks/RemarkParserImpl.h
//===-- RemarkParserImpl.h - Implementation details -------------*- C++/-*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file provides implementation details for the remark parser. // //===----------------------------------------------------------------------===// #ifndef LLVM_REMARKS_REMARK_PARSER_IMPL_H #define LLVM_REMARKS_REMARK_PARSER_IMPL_H namespace llvm { namespace remarks { /// This is used as a base for any parser implementation. struct ParserImpl { enum class Kind { YAML }; // The parser kind. This is used as a tag to safely cast between // implementations. Kind ParserKind; }; } // end namespace remarks } // end namespace llvm #endif /* LLVM_REMARKS_REMARK_PARSER_IMPL_H */
//===-- RemarkParserImpl.h - Implementation details -------------*- C++/-*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file provides implementation details for the remark parser. // //===----------------------------------------------------------------------===// #ifndef LLVM_REMARKS_REMARK_PARSER_IMPL_H #define LLVM_REMARKS_REMARK_PARSER_IMPL_H namespace llvm { namespace remarks { /// This is used as a base for any parser implementation. struct ParserImpl { enum class Kind { YAML }; explicit ParserImpl(Kind TheParserKind) : ParserKind(TheParserKind) {} // Virtual destructor prevents mismatched deletes virtual ~ParserImpl() {} // The parser kind. This is used as a tag to safely cast between // implementations. Kind ParserKind; }; } // end namespace remarks } // end namespace llvm #endif /* LLVM_REMARKS_REMARK_PARSER_IMPL_H */
Fix mismatched delete due to missing virtual destructor
[Remarks] Fix mismatched delete due to missing virtual destructor This fixes an asan failure introduced in r356519. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@356583 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm
83443f472fff11a74e983e42c56a245953890248
src/ref.h
src/ref.h
#pragma once #include <chrono> #include <string> enum class ref_src_t { FILE, AIRCRAFT, PLUGIN, USER_MSG, BLACKLIST, }; /// Superclass defining some common interface items for dataref and commandref. class RefRecord { protected: std::string name; ref_src_t source; std::chrono::system_clock::time_point last_updated; std::chrono::system_clock::time_point last_updated_big; RefRecord(const std::string & name, ref_src_t source) : name(name), source(source), last_updated(std::chrono::system_clock::now()) {} public: virtual ~RefRecord() {} const std::string & getName() const { return name; } ref_src_t getSource() const { return source; } virtual std::string getDisplayString(size_t display_length) const = 0; bool isBlacklisted() const { return ref_src_t::BLACKLIST == source; } const std::chrono::system_clock::time_point & getLastUpdateTime() const { return last_updated; } const std::chrono::system_clock::time_point & getLastBigUpdateTime() const { return last_updated_big; } };
#pragma once #include <chrono> #include <string> enum class ref_src_t { FILE, AIRCRAFT, PLUGIN, USER_MSG, BLACKLIST, }; /// Superclass defining some common interface items for dataref and commandref. class RefRecord { protected: std::string name; ref_src_t source; std::chrono::system_clock::time_point last_updated; std::chrono::system_clock::time_point last_updated_big; RefRecord(const std::string & name, ref_src_t source) : name(name), source(source), last_updated(std::chrono::system_clock::from_time_t(0)), last_updated_big(std::chrono::system_clock::from_time_t(0)) {} public: virtual ~RefRecord() {} const std::string & getName() const { return name; } ref_src_t getSource() const { return source; } virtual std::string getDisplayString(size_t display_length) const = 0; bool isBlacklisted() const { return ref_src_t::BLACKLIST == source; } const std::chrono::system_clock::time_point & getLastUpdateTime() const { return last_updated; } const std::chrono::system_clock::time_point & getLastBigUpdateTime() const { return last_updated_big; } };
Handle initialization of change detection variables in a more sane way. No more false positives of changes on startup.
Handle initialization of change detection variables in a more sane way. No more false positives of changes on startup.
C
mit
leecbaker/datareftool,leecbaker/datareftool,leecbaker/datareftool
c8ac1d0b0a97f5fc926a48e64e0e116387453dcd
apps/drivers/drv_airspeed.h
apps/drivers/drv_airspeed.h
/**************************************************************************** * * Copyright (C) 2013 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name PX4 nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ /** * @file Airspeed driver interface. */ #ifndef _DRV_AIRSPEED_H #define _DRV_AIRSPEED_H #include <stdint.h> #include <sys/ioctl.h> #include "drv_sensor.h" #include "drv_orb_dev.h" #define AIRSPEED_DEVICE_PATH "/dev/airspeed" /** * Airspeed report structure. Reads from the device must be in multiples of this * structure. */ struct airspeed_report { uint64_t timestamp; uint8_t speed; /** in meters/sec */ }; /* * ObjDev tag for raw range finder data. */ ORB_DECLARE(sensor_differential_pressure); /* * ioctl() definitions * * Airspeed drivers also implement the generic sensor driver * interfaces from drv_sensor.h */ #define _AIRSPEEDIOCBASE (0x7700) #define __AIRSPEEDIOC(_n) (_IOC(_AIRSPEEDIOCBASE, _n)) #endif /* _DRV_AIRSPEED_H */
Add in the missing header.
Add in the missing header.
C
bsd-3-clause
krbeverx/Firmware,PX4/Firmware,mcgill-robotics/Firmware,dagar/Firmware,dagar/Firmware,krbeverx/Firmware,mcgill-robotics/Firmware,PX4/Firmware,Aerotenna/Firmware,acfloria/Firmware,Aerotenna/Firmware,mcgill-robotics/Firmware,dagar/Firmware,krbeverx/Firmware,dagar/Firmware,acfloria/Firmware,Aerotenna/Firmware,mje-nz/PX4-Firmware,darknight-007/Firmware,krbeverx/Firmware,PX4/Firmware,mje-nz/PX4-Firmware,acfloria/Firmware,mje-nz/PX4-Firmware,mcgill-robotics/Firmware,PX4/Firmware,mje-nz/PX4-Firmware,jlecoeur/Firmware,jlecoeur/Firmware,krbeverx/Firmware,jlecoeur/Firmware,krbeverx/Firmware,mje-nz/PX4-Firmware,acfloria/Firmware,darknight-007/Firmware,dagar/Firmware,mcgill-robotics/Firmware,dagar/Firmware,acfloria/Firmware,Aerotenna/Firmware,mcgill-robotics/Firmware,mcgill-robotics/Firmware,acfloria/Firmware,darknight-007/Firmware,acfloria/Firmware,mje-nz/PX4-Firmware,jlecoeur/Firmware,jlecoeur/Firmware,Aerotenna/Firmware,PX4/Firmware,Aerotenna/Firmware,darknight-007/Firmware,mje-nz/PX4-Firmware,PX4/Firmware,krbeverx/Firmware,dagar/Firmware,darknight-007/Firmware,Aerotenna/Firmware,jlecoeur/Firmware,jlecoeur/Firmware,PX4/Firmware,jlecoeur/Firmware
3ca41de3333f47071289b6398a3f8c677dbdab89
src-qt5/desktop-utils/lumina-fm/gitCompat.h
src-qt5/desktop-utils/lumina-fm/gitCompat.h
//=========================================== // Lumina-DE source code // Copyright (c) 2016, Ken Moore // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== // This is the backend classe for interacting with the "git" utility //=========================================== #ifdef _LUMINA_FM_GIT_COMPAT_H #define _LUMINA_FM_GIT_COMPAT_H #include <QProcess> #include <QString> #include <QProcessEnvironment> #include <LuminaUtils.h> class GIT{ public: //Check if the git utility is installed and available static bool isAvailable(){ QString bin = "git" return isValidBinary(bin); } //Return if the current directory is a git repository static bool isRepo(QString dir){ QProcess P; P.setProcessEnvironment(QProcessEnvironment::systemEnvironment()); P.setWorkingDirectory(dir); P.exec("git",QStringList() <<"status" << "--porcelain" ); return (0==P.exitCode()); } //Return the current status of the repository static QString status(QString dir){ QProcess P; P.setProcessEnvironment(QProcessEnvironment::systemEnvironment()); P.setWorkingDirectory(dir); P.setProcessChannelMode(QProcess::MergedChannels); P.exec("git",QStringList() <<"status" ); return P.readAllStandardOutput(); } //Setup a process for running the clone operation (so the calling process can hook up any watchers and start it when ready) static QProcess setupClone(QString indir, QString url, QString branch = "", int depth = -1){ QProcess P; P.setProcessEnvironment( QProcessEnvironment::systemEnvironment() ); P.setWorkingDirectory(indir); P.setProgram("git"); QStringList args; args << "clone"; if(!branch.isEmpty()){ args << "-b" << branch; } if(depth>0){ args << "--depth" << QString::number(depth); } args << url; P.setArguments(args); return P; } }; #endif
Add the backend class/functions for using GIT within lumina-fm.
Add the backend class/functions for using GIT within lumina-fm.
C
bsd-3-clause
trueos/lumina,cpforbes/lumina,sasongko26/lumina,sasongko26/lumina,pcbsd/lumina,trueos/lumina,sasongko26/lumina,Nanolx/lumina,harcobbit/lumina,cpforbes/lumina,sasongko26/lumina,harcobbit/lumina,harcobbit/lumina,sasongko26/lumina,trueos/lumina,sasongko26/lumina,trueos/lumina,cpforbes/lumina,trueos/lumina,cpforbes/lumina,Nanolx/lumina,cpforbes/lumina,pcbsd/lumina,cpforbes/lumina,Nanolx/lumina,trueos/lumina,cpforbes/lumina,trueos/lumina,pcbsd/lumina,trueos/lumina,sasongko26/lumina,cpforbes/lumina,sasongko26/lumina
21bab842fb9e25fa8be50ae065090fef514fefed
test/Sema/incomplete-call.c
test/Sema/incomplete-call.c
// RUN: clang -fsyntax-only -verify %s struct foo; // expected-note 3 {{forward declaration of 'struct foo'}} struct foo a(); void b(struct foo); void c(); void func() { a(); // expected-error{{return type of called function ('struct foo') is incomplete}} b(*(struct foo*)0); // expected-error{{argument type 'struct foo' is incomplete}} c(*(struct foo*)0); // expected-error{{argument type 'struct foo' is incomplete}} }
Add testcase for incomplete call/return types for calls.
Add testcase for incomplete call/return types for calls. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@67486 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/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,apple/swift-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,llvm-mirror/clang
9cabd0a776f968311e47295daab61050caaea5dc
third_party/vulkan/loader/vk_loader_layer.h
third_party/vulkan/loader/vk_loader_layer.h
/* * * Copyright (c) 2016 The Khronos Group Inc. * Copyright (c) 2016 Valve Corporation * Copyright (c) 2016 LunarG, 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. * * Author: Mark Lobodzinski <[email protected]> * */ #pragma once // Linked list node for tree of debug callback functions typedef struct VkLayerDbgFunctionNode_ { VkDebugReportCallbackEXT msgCallback; PFN_vkDebugReportCallbackEXT pfnMsgCallback; VkFlags msgFlags; void *pUserData; struct VkLayerDbgFunctionNode_ *pNext; } VkLayerDbgFunctionNode;
Include every single file in the vulkan update.
Include every single file in the vulkan update.
C
bsd-3-clause
sabretooth/xenia,maxton/xenia,ObsidianGuardian/xenia,sephiroth99/xenia,sabretooth/xenia,sabretooth/xenia,sephiroth99/xenia,maxton/xenia,maxton/xenia,ObsidianGuardian/xenia,sephiroth99/xenia,ObsidianGuardian/xenia
acadbfb90a54673d6c8b05aa4e93218433890411
arch/alpha/include/asm/bug.h
arch/alpha/include/asm/bug.h
#ifndef _ALPHA_BUG_H #define _ALPHA_BUG_H #include <linux/linkage.h> #ifdef CONFIG_BUG #include <asm/pal.h> /* ??? Would be nice to use .gprel32 here, but we can't be sure that the function loaded the GP, so this could fail in modules. */ #define BUG() do { \ __asm__ __volatile__( \ "call_pal %0 # bugchk\n\t" \ ".long %1\n\t.8byte %2" \ : : "i"(PAL_bugchk), "i"(__LINE__), "i"(__FILE__)); \ for ( ; ; ); } while (0) #define HAVE_ARCH_BUG #endif #include <asm-generic/bug.h> #endif
#ifndef _ALPHA_BUG_H #define _ALPHA_BUG_H #include <linux/linkage.h> #ifdef CONFIG_BUG #include <asm/pal.h> /* ??? Would be nice to use .gprel32 here, but we can't be sure that the function loaded the GP, so this could fail in modules. */ #define BUG() do { \ __asm__ __volatile__( \ "call_pal %0 # bugchk\n\t" \ ".long %1\n\t.8byte %2" \ : : "i"(PAL_bugchk), "i"(__LINE__), "i"(__FILE__)); \ unreachable(); \ } while (0) #define HAVE_ARCH_BUG #endif #include <asm-generic/bug.h> #endif
Convert BUG() to use unreachable()
alpha: Convert BUG() to use unreachable() Use the new unreachable() macro instead of for(;;); Signed-off-by: David Daney <[email protected]> CC: Richard Henderson <[email protected]> CC: Ivan Kokshaysky <[email protected]> CC: [email protected] Signed-off-by: Matt Turner <[email protected]>
C
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
2536840398104b0270ba1156b1ff63cb4ae2a2ef
AsynchFilePlugin/AsynchFilePlugin.h
AsynchFilePlugin/AsynchFilePlugin.h
/* Header file for AsynchFile plugin */ /* module initialization/shutdown */ int asyncFileInit(void); int asyncFileShutdown(void); /*** Experimental Asynchronous File I/O ***/ typedef struct { int sessionID; void *state; } AsyncFile; int asyncFileClose(AsyncFile *f); int asyncFileOpen(AsyncFile *f, long fileNamePtr, int fileNameSize, int writeFlag, int semaIndex); int asyncFileRecordSize(); int asyncFileReadResult(AsyncFile *f, long bufferPtr, int bufferSize); int asyncFileReadStart(AsyncFile *f, int fPosition, int count); int asyncFileWriteResult(AsyncFile *f); int asyncFileWriteStart(AsyncFile *f, int fPosition, long bufferPtr, int bufferSize);
/* Header file for AsynchFile plugin */ /* module initialization/shutdown */ int asyncFileInit(void); int asyncFileShutdown(void); /*** Experimental Asynchronous File I/O ***/ typedef struct { int sessionID; void *state; } AsyncFile; int asyncFileClose(AsyncFile *f); int asyncFileOpen(AsyncFile *f, char *fileNamePtr, int fileNameSize, int writeFlag, int semaIndex); int asyncFileRecordSize(); int asyncFileReadResult(AsyncFile *f, void *bufferPtr, int bufferSize); int asyncFileReadStart(AsyncFile *f, int fPosition, int count); int asyncFileWriteResult(AsyncFile *f); int asyncFileWriteStart(AsyncFile *f, int fPosition, void *bufferPtr, int bufferSize);
Update platforms/* with Eliot's fixes for 64-bit clean AsyncPlugin.
Update platforms/* with Eliot's fixes for 64-bit clean AsyncPlugin. The platforms/unix changes are tested. The win32 and Mac OS changes are not tested but I believe them to be correct. Not applicable to RiscOS. Updates not applied to iOS. @eliot - I changed the declarations in Cross to (void *) rather than long to reduce type casts in platforms/[unix|win32|Mac OS]. @esteban - I did not update platforms/iOS in SVN trunk. Please update declarations as needed. @tim - no change required for RiscOS. git-svn-id: http://squeakvm.org/svn/squeak/trunk@3178 fa1542d4-bde8-0310-ad64-8ed1123d492a Former-commit-id: 55982481b07c41df485b88dff5a63920f92525d0
C
mit
bencoman/pharo-vm,peteruhnak/pharo-vm,peteruhnak/pharo-vm,OpenSmalltalk/vm,timfel/squeakvm,OpenSmalltalk/vm,bencoman/pharo-vm,bencoman/pharo-vm,bencoman/pharo-vm,timfel/squeakvm,timfel/squeakvm,bencoman/pharo-vm,bencoman/pharo-vm,peteruhnak/pharo-vm,timfel/squeakvm,peteruhnak/pharo-vm,OpenSmalltalk/vm,bencoman/pharo-vm,OpenSmalltalk/vm,timfel/squeakvm,peteruhnak/pharo-vm,timfel/squeakvm,bencoman/pharo-vm,peteruhnak/pharo-vm,bencoman/pharo-vm,OpenSmalltalk/vm,peteruhnak/pharo-vm,peteruhnak/pharo-vm,timfel/squeakvm,timfel/squeakvm,OpenSmalltalk/vm,OpenSmalltalk/vm,OpenSmalltalk/vm
d7f2d994baaa83db932dbb1a0b8a31a717af1103
src/badgewars.c
src/badgewars.c
#include <badgewars.h> #include <stdio.h> /* Initialize the BadgeWars world */ void bw_init(struct bw_world *world) { puts("bw_init requested"); } /* Run the BadgeWars world for a single instruction */ int bw_run(struct bw_world *world) { puts("bw_run requested"); return 0; } /* Receive a BadgeWars command from the outside world */ void bw_receive(struct bw_world *world, OPCODE command, void *addr, void(*send_response)(int, void *)) { printf("bw_receive got op: %d\n", command.op); } /* Peek into the core state */ CELL bw_peek(struct bw_world *world, CELLPTR addr) { printf("bw_peek(%d) called\n", addr); return 0; }
#include <badgewars.h> #include <string.h> /* Initialize the BadgeWars world */ void bw_init(struct bw_world *world) { memset(&world->core, 0, sizeof(world->core)); world->queue_head = world->queue_tail = 0; } /* Run the BadgeWars world for a single instruction */ int bw_run(struct bw_world *world) { return 0; } /* Receive a BadgeWars command from the outside world */ void bw_receive(struct bw_world *world, OPCODE command, void *addr, void(*send_response)(int, void *)) { } /* Peek into the core state */ CELL bw_peek(struct bw_world *world, CELLPTR addr) { return world->core[addr]; }
Initialize the world state to zero
Initialize the world state to zero
C
mit
tarcieri/BadgeWars,tarcieri/BadgeWars
822b9fd29f6ce8b69dc2705f04cae44fbb3e78f7
webkit/glue/plugins/ppb_private.h
webkit/glue/plugins/ppb_private.h
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ #define WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ #include "ppapi/c/pp_var.h" #define PPB_PRIVATE_INTERFACE "PPB_Private;1" typedef enum _ppb_ResourceString { PPB_RESOURCE_STRING_PDF_GET_PASSWORD = 0, } PP_ResourceString; typedef struct _ppb_Private { // Returns a localized string. PP_Var (*GetLocalizedString)(PP_ResourceString string_id); } PPB_Private; #endif // WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ #define WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ #include "third_party/ppapi/c/pp_var.h" #define PPB_PRIVATE_INTERFACE "PPB_Private;1" typedef enum _ppb_ResourceString { PPB_RESOURCE_STRING_PDF_GET_PASSWORD = 0, } PP_ResourceString; typedef struct _ppb_Private { // Returns a localized string. PP_Var (*GetLocalizedString)(PP_ResourceString string_id); } PPB_Private; #endif // WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_
Add third_party/ prefix to ppapi include for checkdeps.
Add third_party/ prefix to ppapi include for checkdeps. The only users of this ppb should be inside chrome so this should work fine. [email protected] Review URL: http://codereview.chromium.org/3019006 git-svn-id: http://src.chromium.org/svn/trunk/src@52766 4ff67af0-8c30-449e-8e8b-ad334ec8d88c Former-commit-id: b5583121378597058f8f083243d2299fd262e509
C
bsd-3-clause
meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser
e2a6ce53ab445fd8976923171e78bd0e46db2407
src/mapraised.c
src/mapraised.c
/* Copyright (c) 2013 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. * * Maps and raises the specified window id (integer). */ #include <X11/Xlib.h> #include <stdlib.h> int main(int argc, char** argv) { if (argc != 2) return 2; Display* display = XOpenDisplay(NULL); if (!display) return 1; XMapRaised(display, atoi(argv[1])); XCloseDisplay(display); return 0; }
/* Copyright (c) 2013 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. * * Maps and raises the specified window id (integer). */ /* TODO: use XResizeWindow to do the +1 width ratpoison hack. * And at this point, we might as well use XMoveResizeWindow, rename this to * wmtool and unmap the previously-mapped window, and perhaps call the * equivalent of XRefresh, eliminating the need for ratpoison entirely (!!). */ #include <X11/Xlib.h> #include <stdlib.h> int main(int argc, char** argv) { if (argc != 2) return 2; Display* display = XOpenDisplay(NULL); if (!display) return 1; XMapRaised(display, atoi(argv[1])); XCloseDisplay(display); return 0; }
Add TODO to replace ratpoison.
Add TODO to replace ratpoison.
C
bsd-3-clause
nromsdahl/crouton,twmccart/crouton,VandeurenGlenn/crouton,Timvrakas/crouton,stephen-soltesz/crouton,fxcebx/crouton,arbuztw/crouton,StrawnPoint04/crouton,Timvrakas/crouton,ikaritw/crouton,tonyxue/cruise,rperce/chroagh,armgong/chroagh,JDGBOLT/chroagh,arbuztw/crouton,Timvrakas/crouton,jamgregory/crouton,taterbase/crouton,arbuztw/crouton,StrawnPoint04/crouton,mkasick/crouton,DanDanBu/crouton,ikaritw/crouton,marriop/newCrouton,dragon788/chroagh,VandeurenGlenn/crouton,rperce/chroagh,mkasick/crouton,elkangaroo/chroagh,armgong/chroagh,rperce/chroagh,zofuthan/crouton,marriop/newCrouton,jamgregory/crouton,VandeurenGlenn/crouton,DanDanBu/crouton,StrawnPoint04/crouton,twmccart/crouton,jamgregory/crouton,tonyxue/cruise,dragon788/chroagh,armgong/chroagh,nromsdahl/crouton,nromsdahl/crouton,nromsdahl/crouton,elkangaroo/chroagh,tonyxue/cruise,twmccart/crouton,ikaritw/crouton,brayniac/crouton,VandeurenGlenn/crouton,armgong/chroagh,fxcebx/crouton,ikaritw/crouton,arbuztw/crouton,elkangaroo/chroagh,stephen-soltesz/crouton,VandeurenGlenn/crouton,tedm/crouton,jamgregory/crouton,dragon788/chroagh,tedm/crouton,zofuthan/crouton,armgong/chroagh,JDGBOLT/chroagh,jamgregory/crouton,StrawnPoint04/crouton,taterbase/crouton,ikaritw/crouton,brayniac/crouton,tedm/crouton,arbuztw/crouton,djmrr/crouton,mkasick/crouton,DanDanBu/crouton,brayniac/crouton,stephen-soltesz/crouton,mkasick/crouton,fxcebx/crouton,StrawnPoint04/crouton,elkangaroo/chroagh,stephen-soltesz/crouton,armgong/chroagh,taterbase/crouton,dnschneid/crouton,arbuztw/crouton,rperce/chroagh,VandeurenGlenn/crouton,Timvrakas/crouton,tonyxue/cruise,twmccart/crouton,dnschneid/crouton,dnschneid/crouton,tedm/crouton,dnschneid/crouton,mkasick/crouton,taterbase/crouton,ikaritw/crouton,taterbase/crouton,taterbase/crouton,rperce/chroagh,tonyxue/cruise,zofuthan/crouton,nromsdahl/crouton,dragon788/chroagh,JDGBOLT/chroagh,djmrr/crouton,djmrr/crouton,nromsdahl/crouton,djmrr/crouton,JDGBOLT/chroagh,fxcebx/crouton,tonyxue/cruise,brayniac/crouton,Timvrakas/crouton,mkasick/crouton,DanDanBu/crouton,fxcebx/crouton,marriop/newCrouton,zofuthan/crouton,zofuthan/crouton,twmccart/crouton,elkangaroo/chroagh,JDGBOLT/chroagh,twmccart/crouton,Timvrakas/crouton,djmrr/crouton,JDGBOLT/chroagh,zofuthan/crouton,DanDanBu/crouton,stephen-soltesz/crouton,elkangaroo/chroagh,rperce/chroagh,dragon788/chroagh,dragon788/chroagh,dnschneid/crouton,brayniac/crouton,brayniac/crouton,stephen-soltesz/crouton,DanDanBu/crouton,fxcebx/crouton,tedm/crouton,tedm/crouton,jamgregory/crouton,dnschneid/crouton,StrawnPoint04/crouton,djmrr/crouton
40373bf93e90ab4d372d149aad334dfe238c1eed
src/arch/zephyr/csp_zephyr_init.c
src/arch/zephyr/csp_zephyr_init.c
#include <zephyr.h> #include <init.h> #include <posix/time.h> #include <csp/csp_debug.h> #include <logging/log.h> LOG_MODULE_REGISTER(libcsp); static void hook_func(csp_debug_level_t level, const char * format, va_list args) { uint32_t args_num = log_count_args(format); switch (level) { case CSP_ERROR: Z_LOG_VA(LOG_LEVEL_ERR, format, args, args_num, LOG_STRDUP_EXEC); break; case CSP_WARN: Z_LOG_VA(LOG_LEVEL_WRN, format, args, args_num, LOG_STRDUP_EXEC); break; default: Z_LOG_VA(LOG_LEVEL_INF, format, args, args_num, LOG_STRDUP_EXEC); break; } } static int libcsp_zephyr_init(const struct device * unused) { csp_debug_hook_set(hook_func); struct timespec ts = { .tv_sec = 946652400, .tv_nsec = 0, }; clock_settime(CLOCK_REALTIME, &ts); return 0; } SYS_INIT(libcsp_zephyr_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY);
#include <zephyr.h> #include <init.h> #include <posix/time.h> #include <csp/csp_debug.h> #include <logging/log.h> LOG_MODULE_REGISTER(libcsp); } static int libcsp_zephyr_init(const struct device * unused) { struct timespec ts = { .tv_sec = 946652400, .tv_nsec = 0, }; clock_settime(CLOCK_REALTIME, &ts); return 0; } SYS_INIT(libcsp_zephyr_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY);
Remove debug print hook function
zephyr: Remove debug print hook function Debug print facility has been removed by the commit 39d6478; csp_debug_hook_set(), csp_debug_level_t, CSP_ERROR and its friends are gone. Remove it from Zephyr as well. Signed-off-by: Yasushi SHOJI <[email protected]>
C
mit
libcsp/libcsp,libcsp/libcsp
ea2b22d62983758013ca528ef1325d6c191420b2
CoreNetworking/AFNetworkSchedule.h
CoreNetworking/AFNetworkSchedule.h
// // AFNetworkEnvironment.h // CoreNetworking // // Created by Keith Duncan on 05/01/2013. // Copyright (c) 2013 Keith Duncan. All rights reserved. // #import <Foundation/Foundation.h> #import "CoreNetworking/AFNetwork-Macros.h" /*! \brief Schedule environment for run loop and dispatch */ @interface AFNetworkSchedule : NSObject { @package NSRunLoop *_runLoop; NSString *_runLoopMode; void *_dispatchQueue; } - (void)scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode; - (void)scheduleInQueue:(dispatch_queue_t)queue; @end
// // AFNetworkEnvironment.h // CoreNetworking // // Created by Keith Duncan on 05/01/2013. // Copyright (c) 2013 Keith Duncan. All rights reserved. // #import <Foundation/Foundation.h> #import "CoreNetworking/AFNetwork-Macros.h" /*! \brief Schedule environment for run loop and dispatch */ @interface AFNetworkSchedule : NSObject { @public NSRunLoop *_runLoop; NSString *_runLoopMode; void *_dispatchQueue; } - (void)scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode; - (void)scheduleInQueue:(dispatch_queue_t)queue; @end
Make the run loop and queue @public until we enhance the scheduler API
Make the run loop and queue @public until we enhance the scheduler API
C
bsd-3-clause
ddeville/CoreNetworking
1009adc8cf7154d19c7ffebc2e35d70722076ea8
native-unpacker/definitions.h
native-unpacker/definitions.h
/* * Header file for the definitions of packers/protectors * * Tim "diff" Strazzere <[email protected]> */ typedef struct { char* name; char* description; char* filter; char* marker; } packer; static packer packers[] = { // APKProtect { "APKProtect v1->5", "APKProtect generialized detection", // This is actually the filter APKProtect uses itself for finding it's own odex to modify ".apk@", "/libAPKProtect" }, // LIAPP { "LIAPP 'Egg' (v1->?)", "LockIn APP (lockincomp.com)", "LIAPPEgg.dex", "/LIAPPEgg" }, // Qihoo 'Monster' { "Qihoo 'Monster' (v1->?)", "Qihoo unknown version, code named 'monster'", "monster.dex", "/libprotectClass" } };
/* * Header file for the definitions of packers/protectors * * Tim "diff" Strazzere <[email protected]> */ typedef struct { char* name; char* description; char* filter; char* marker; } packer; static packer packers[] = { // APKProtect { "APKProtect v1->5", "APKProtect generialized detection", // This is actually the filter APKProtect uses itself for finding it's own odex to modify ".apk@", "/libAPKProtect" }, // Bangcle (??) or something equally silly { "Bangcle (??) silly version", "Something silly used by malware", "classes.dex", "/app_lib/" }, // LIAPP { "LIAPP 'Egg' (v1->?)", "LockIn APP (lockincomp.com)", "LIAPPEgg.dex", "/LIAPPEgg" }, // Qihoo 'Monster' { "Qihoo 'Monster' (v1->?)", "Qihoo unknown version, code named 'monster'", "monster.dex", "/libprotectClass" } };
Add detection for whatever silly protector new malware was using.
Add detection for whatever silly protector new malware was using. Closes issue #22
C
apache-2.0
strazzere/android-unpacker,strazzere/android-unpacker
b672df825ad9d6b4b16ddadb73c9b012c04ded05
include/llvm/DebugInfo/CodeView/GUID.h
include/llvm/DebugInfo/CodeView/GUID.h
//===- GUID.h ---------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_DEBUGINFO_CODEVIEW_GUID_H #define LLVM_DEBUGINFO_CODEVIEW_GUID_H #include <cstdint> #include <cstring> namespace llvm { class raw_ostream; namespace codeview { /// This represents the 'GUID' type from windows.h. struct GUID { uint8_t Guid[16]; }; inline bool operator==(const GUID &LHS, const GUID &RHS) { return 0 == ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)); } raw_ostream &operator<<(raw_ostream &OS, const GUID &Guid); } // namespace codeview } // namespace llvm #endif
//===- GUID.h ---------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_DEBUGINFO_CODEVIEW_GUID_H #define LLVM_DEBUGINFO_CODEVIEW_GUID_H #include <cstdint> #include <cstring> namespace llvm { class raw_ostream; namespace codeview { /// This represents the 'GUID' type from windows.h. struct GUID { uint8_t Guid[16]; }; inline bool operator==(const GUID &LHS, const GUID &RHS) { return 0 == ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)); } inline bool operator<(const GUID &LHS, const GUID &RHS) { return ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)) < 0; } inline bool operator<=(const GUID &LHS, const GUID &RHS) { return ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)) <= 0; } inline bool operator>(const GUID &LHS, const GUID &RHS) { return !(LHS <= RHS); } inline bool operator>=(const GUID &LHS, const GUID &RHS) { return !(LHS < RHS); } inline bool operator!=(const GUID &LHS, const GUID &RHS) { return !(LHS == RHS); } raw_ostream &operator<<(raw_ostream &OS, const GUID &Guid); } // namespace codeview } // namespace llvm #endif
Merge in types and items from type servers (/Zi)
[PDB] Merge in types and items from type servers (/Zi) Summary: Object files compiled with /Zi emit type information into a type server PDB. The .debug$S section will contain a single TypeServer2Record with the absolute path and GUID of the type server. LLD needs to load the type server PDB and merge all types and items it finds in it into the destination PDB. Depends on D35495 Reviewers: ruiu, inglorion Subscribers: zturner, llvm-commits Differential Revision: https://reviews.llvm.org/D35504 git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@308235 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm
4cb0950cfe4055ca54d08b9639ee4e462cb009a3
src/include/storage/relfilenode.h
src/include/storage/relfilenode.h
#ifndef RELFILENODE_H #define RELFILENODE_H /* * This is all what we need to know to find relation file. * tblNode is identificator of tablespace and because of * currently our tablespaces are equal to databases this is * database OID. relNode is currently relation OID on creation * but may be changed later if required. relNode is stored in * pg_class.relfilenode. */ typedef struct RelFileNode { Oid tblNode; /* tablespace */ Oid relNode; /* relation */ } RelFileNode; #define RelFileNodeEquals(node1, node2) \ ((node1).relNode == (node2).relNode && \ (node2).tblNode == (node2).tblNode) #endif /* RELFILENODE_H */
#ifndef RELFILENODE_H #define RELFILENODE_H /* * This is all what we need to know to find relation file. * tblNode is identificator of tablespace and because of * currently our tablespaces are equal to databases this is * database OID. relNode is currently relation OID on creation * but may be changed later if required. relNode is stored in * pg_class.relfilenode. */ typedef struct RelFileNode { Oid tblNode; /* tablespace */ Oid relNode; /* relation */ } RelFileNode; #define RelFileNodeEquals(node1, node2) \ ((node1).relNode == (node2).relNode && \ (node1).tblNode == (node2).tblNode) #endif /* RELFILENODE_H */
Fix small but critical typo ...
Fix small but critical typo ...
C
apache-2.0
xuegang/gpdb,jmcatamney/gpdb,cjcjameson/gpdb,chrishajas/gpdb,adam8157/gpdb,zeroae/postgres-xl,cjcjameson/gpdb,atris/gpdb,kaknikhil/gpdb,techdragon/Postgres-XL,janebeckman/gpdb,50wu/gpdb,0x0FFF/gpdb,ahachete/gpdb,rvs/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,kmjungersen/PostgresXL,rubikloud/gpdb,atris/gpdb,ashwinstar/gpdb,janebeckman/gpdb,yazun/postgres-xl,kaknikhil/gpdb,techdragon/Postgres-XL,oberstet/postgres-xl,pavanvd/postgres-xl,adam8157/gpdb,Postgres-XL/Postgres-XL,zaksoup/gpdb,adam8157/gpdb,xuegang/gpdb,kaknikhil/gpdb,snaga/postgres-xl,pavanvd/postgres-xl,ahachete/gpdb,royc1/gpdb,Chibin/gpdb,foyzur/gpdb,xuegang/gpdb,postmind-net/postgres-xl,greenplum-db/gpdb,CraigHarris/gpdb,lintzc/gpdb,Quikling/gpdb,foyzur/gpdb,ahachete/gpdb,atris/gpdb,yuanzhao/gpdb,techdragon/Postgres-XL,zeroae/postgres-xl,CraigHarris/gpdb,foyzur/gpdb,adam8157/gpdb,chrishajas/gpdb,xinzweb/gpdb,CraigHarris/gpdb,lintzc/gpdb,yuanzhao/gpdb,Postgres-XL/Postgres-XL,yazun/postgres-xl,50wu/gpdb,ovr/postgres-xl,50wu/gpdb,lintzc/gpdb,Quikling/gpdb,royc1/gpdb,kaknikhil/gpdb,jmcatamney/gpdb,CraigHarris/gpdb,lpetrov-pivotal/gpdb,postmind-net/postgres-xl,jmcatamney/gpdb,kmjungersen/PostgresXL,xinzweb/gpdb,edespino/gpdb,edespino/gpdb,Quikling/gpdb,Chibin/gpdb,ovr/postgres-xl,edespino/gpdb,lisakowen/gpdb,randomtask1155/gpdb,xinzweb/gpdb,edespino/gpdb,tpostgres-projects/tPostgres,ashwinstar/gpdb,techdragon/Postgres-XL,zaksoup/gpdb,zaksoup/gpdb,janebeckman/gpdb,oberstet/postgres-xl,royc1/gpdb,tangp3/gpdb,janebeckman/gpdb,kaknikhil/gpdb,rvs/gpdb,Chibin/gpdb,royc1/gpdb,atris/gpdb,arcivanov/postgres-xl,atris/gpdb,lisakowen/gpdb,Quikling/gpdb,arcivanov/postgres-xl,randomtask1155/gpdb,50wu/gpdb,edespino/gpdb,Quikling/gpdb,rvs/gpdb,atris/gpdb,chrishajas/gpdb,cjcjameson/gpdb,royc1/gpdb,xuegang/gpdb,postmind-net/postgres-xl,ahachete/gpdb,0x0FFF/gpdb,tangp3/gpdb,zeroae/postgres-xl,rubikloud/gpdb,greenplum-db/gpdb,zaksoup/gpdb,arcivanov/postgres-xl,greenplum-db/gpdb,Quikling/gpdb,rvs/gpdb,arcivanov/postgres-xl,kaknikhil/gpdb,edespino/gpdb,adam8157/gpdb,ovr/postgres-xl,xinzweb/gpdb,rubikloud/gpdb,kaknikhil/gpdb,snaga/postgres-xl,adam8157/gpdb,Quikling/gpdb,chrishajas/gpdb,CraigHarris/gpdb,randomtask1155/gpdb,edespino/gpdb,chrishajas/gpdb,tangp3/gpdb,greenplum-db/gpdb,oberstet/postgres-xl,yuanzhao/gpdb,lpetrov-pivotal/gpdb,tpostgres-projects/tPostgres,jmcatamney/gpdb,randomtask1155/gpdb,lisakowen/gpdb,tpostgres-projects/tPostgres,0x0FFF/gpdb,xinzweb/gpdb,janebeckman/gpdb,lisakowen/gpdb,50wu/gpdb,rvs/gpdb,lisakowen/gpdb,chrishajas/gpdb,rvs/gpdb,cjcjameson/gpdb,pavanvd/postgres-xl,pavanvd/postgres-xl,kmjungersen/PostgresXL,ovr/postgres-xl,greenplum-db/gpdb,cjcjameson/gpdb,0x0FFF/gpdb,Chibin/gpdb,xinzweb/gpdb,ahachete/gpdb,CraigHarris/gpdb,tangp3/gpdb,royc1/gpdb,0x0FFF/gpdb,yuanzhao/gpdb,zeroae/postgres-xl,randomtask1155/gpdb,arcivanov/postgres-xl,jmcatamney/gpdb,jmcatamney/gpdb,0x0FFF/gpdb,lintzc/gpdb,CraigHarris/gpdb,yazun/postgres-xl,royc1/gpdb,ashwinstar/gpdb,lpetrov-pivotal/gpdb,ashwinstar/gpdb,atris/gpdb,oberstet/postgres-xl,lintzc/gpdb,tangp3/gpdb,jmcatamney/gpdb,rvs/gpdb,Postgres-XL/Postgres-XL,snaga/postgres-xl,ashwinstar/gpdb,ashwinstar/gpdb,Chibin/gpdb,postmind-net/postgres-xl,janebeckman/gpdb,greenplum-db/gpdb,rubikloud/gpdb,tpostgres-projects/tPostgres,yazun/postgres-xl,foyzur/gpdb,rvs/gpdb,xinzweb/gpdb,kaknikhil/gpdb,ahachete/gpdb,ashwinstar/gpdb,yuanzhao/gpdb,rvs/gpdb,foyzur/gpdb,Chibin/gpdb,rubikloud/gpdb,lpetrov-pivotal/gpdb,janebeckman/gpdb,randomtask1155/gpdb,jmcatamney/gpdb,lpetrov-pivotal/gpdb,royc1/gpdb,50wu/gpdb,rubikloud/gpdb,xuegang/gpdb,janebeckman/gpdb,xuegang/gpdb,zaksoup/gpdb,cjcjameson/gpdb,janebeckman/gpdb,Chibin/gpdb,yuanzhao/gpdb,lintzc/gpdb,kmjungersen/PostgresXL,cjcjameson/gpdb,oberstet/postgres-xl,yazun/postgres-xl,CraigHarris/gpdb,xuegang/gpdb,Chibin/gpdb,CraigHarris/gpdb,janebeckman/gpdb,0x0FFF/gpdb,postmind-net/postgres-xl,cjcjameson/gpdb,xuegang/gpdb,ahachete/gpdb,foyzur/gpdb,50wu/gpdb,snaga/postgres-xl,randomtask1155/gpdb,yuanzhao/gpdb,lintzc/gpdb,ovr/postgres-xl,Quikling/gpdb,zaksoup/gpdb,tangp3/gpdb,foyzur/gpdb,lpetrov-pivotal/gpdb,Chibin/gpdb,chrishajas/gpdb,lintzc/gpdb,50wu/gpdb,Chibin/gpdb,zaksoup/gpdb,techdragon/Postgres-XL,edespino/gpdb,adam8157/gpdb,ashwinstar/gpdb,xinzweb/gpdb,Quikling/gpdb,0x0FFF/gpdb,lisakowen/gpdb,yuanzhao/gpdb,lisakowen/gpdb,adam8157/gpdb,foyzur/gpdb,pavanvd/postgres-xl,rubikloud/gpdb,edespino/gpdb,tpostgres-projects/tPostgres,cjcjameson/gpdb,chrishajas/gpdb,cjcjameson/gpdb,rubikloud/gpdb,lpetrov-pivotal/gpdb,tangp3/gpdb,kmjungersen/PostgresXL,Postgres-XL/Postgres-XL,lintzc/gpdb,ahachete/gpdb,xuegang/gpdb,kaknikhil/gpdb,rvs/gpdb,zeroae/postgres-xl,snaga/postgres-xl,Postgres-XL/Postgres-XL,randomtask1155/gpdb,tangp3/gpdb,lpetrov-pivotal/gpdb,lisakowen/gpdb,Quikling/gpdb,atris/gpdb,kaknikhil/gpdb,zaksoup/gpdb,edespino/gpdb,arcivanov/postgres-xl,greenplum-db/gpdb,greenplum-db/gpdb
9b86f2f27bdc1116be1b388e0e66c34b10006ba6
Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkCreateMultiLabelSegmentationAction.h
Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkCreateMultiLabelSegmentationAction.h
/*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_CreateMultiLabelSegmentation_H #define QMITK_CreateMultiLabelSegmentation_H #include "mitkIContextMenuAction.h" #include "org_mitk_gui_qt_multilabelsegmentation_Export.h" #include "vector" #include "mitkDataNode.h" class MITK_QT_SEGMENTATION QmitkCreateMultiLabelSegmentationAction : public QObject, public mitk::IContextMenuAction { Q_OBJECT Q_INTERFACES(mitk::IContextMenuAction) public: QmitkCreateMultiLabelSegmentationAction(); virtual ~QmitkCreateMultiLabelSegmentationAction(); //interface methods virtual void Run( const QList<mitk::DataNode::Pointer>& selectedNodes ); virtual void SetDataStorage(mitk::DataStorage* dataStorage); virtual void SetFunctionality(berry::QtViewPart* functionality); virtual void SetSmoothed(bool smoothed); virtual void SetDecimated(bool decimated); private: typedef QList<mitk::DataNode::Pointer> NodeList; mitk::DataStorage::Pointer m_DataStorage; }; #endif // QMITK_CreateMultiLabelSegmentation_H
/*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_CreateMultiLabelSegmentation_H #define QMITK_CreateMultiLabelSegmentation_H #include "mitkIContextMenuAction.h" #include "org_mitk_gui_qt_multilabelsegmentation_Export.h" #include "vector" #include "mitkDataNode.h" class MITK_QT_SEGMENTATION QmitkCreateMultiLabelSegmentationAction : public QObject, public mitk::IContextMenuAction { Q_OBJECT Q_INTERFACES(mitk::IContextMenuAction) public: QmitkCreateMultiLabelSegmentationAction(); virtual ~QmitkCreateMultiLabelSegmentationAction(); //interface methods virtual void Run( const QList<mitk::DataNode::Pointer>& selectedNodes ) override; virtual void SetDataStorage(mitk::DataStorage* dataStorage) override; virtual void SetFunctionality(berry::QtViewPart* functionality) override; virtual void SetSmoothed(bool smoothed) override; virtual void SetDecimated(bool decimated) override; private: typedef QList<mitk::DataNode::Pointer> NodeList; mitk::DataStorage::Pointer m_DataStorage; }; #endif // QMITK_CreateMultiLabelSegmentation_H
Add override keyword to overridden methods.
Add override keyword to overridden methods.
C
bsd-3-clause
iwegner/MITK,iwegner/MITK,fmilano/mitk,RabadanLab/MITKats,RabadanLab/MITKats,MITK/MITK,MITK/MITK,MITK/MITK,RabadanLab/MITKats,RabadanLab/MITKats,RabadanLab/MITKats,iwegner/MITK,fmilano/mitk,RabadanLab/MITKats,fmilano/mitk,fmilano/mitk,MITK/MITK,MITK/MITK,iwegner/MITK,iwegner/MITK,fmilano/mitk,fmilano/mitk,MITK/MITK,fmilano/mitk,iwegner/MITK
0c55d02164a8fcc6682791603e53d7c099f59699
include/matrix_access_impl.h
include/matrix_access_impl.h
//----------------------------------------------------------------------------- // Element Access //----------------------------------------------------------------------------- template<class T> T& matrix<T>::at( std::size_t row, std::size_t col ){ // TODO throw if out of bounds return data_.at(row*cols_+col); } template<class T> const T& matrix<T>::at( std::size_t row, std::size_t col ) const{ // TODO throw if out of bounds return data_.at(row*cols_+col); } template<class T> typename matrix<T>::matrix_row matrix<T>::operator[]( std::size_t row ){ return 0; } template<class T> const typename matrix<T>::matrix_row matrix<T>::operator[]( std::size_t row ) const{ return 0; }
//----------------------------------------------------------------------------- // Element Access //----------------------------------------------------------------------------- template<class T> T& matrix<T>::at( std::size_t row, std::size_t col ){ // TODO throw if out of bounds return data_.at(row*cols_+col); } template<class T> const T& matrix<T>::at( std::size_t row, std::size_t col ) const{ // TODO throw if out of bounds return data_.at(row*cols_+col); } template<class T> typename matrix<T>::matrix_row matrix<T>::operator[]( std::size_t row ){ return matrix_row(this,row); } template<class T> const typename matrix<T>::matrix_row matrix<T>::operator[]( std::size_t row ) const{ return matrix_row(this,row); } //----------------------------------------------------------------------------- // Row class element Access //----------------------------------------------------------------------------- template<class T> T& matrix<T>::matrix_row::operator[](std::size_t col){ return matrix_->data_[row_*matrix_->cols_+col]; } template<class T> const T& matrix<T>::matrix_row::operator[](std::size_t col) const{ return matrix_->data_[row_*matrix_->cols_+col]; }
Add square bracket opertator access.
Add square bracket opertator access.
C
mit
actinium/cppMatrix,actinium/cppMatrix
c2b721b570a6919d4e20d86dd380677714d37a61
SSPSolution/SSPSolution/StaticEntity.h
SSPSolution/SSPSolution/StaticEntity.h
#ifndef SSPAPPLICATION_ENTITIES_STATICENTITY_H #define SSPAPPLICATION_ENTITIES_STATICENTITY_H #include "Entity.h" class StaticEntity : public Entity { private: //Variables public: StaticEntity(); ~StaticEntity(); int Initialize(int entityID, PhysicsComponent* pComp, GraphicsComponent* gComp, AIComponent* aiComp); int Update(float dT, InputHandler* inputHandler); int React(int entityID, EVENT reactEvent); private: //Functions }; #endif
#ifndef SSPAPPLICATION_ENTITIES_STATICENTITY_H #define SSPAPPLICATION_ENTITIES_STATICENTITY_H #include "Entity.h" class StaticEntity : public Entity { private: //Variables public: StaticEntity(); ~StaticEntity(); int Initialize(int entityID, PhysicsComponent* pComp, GraphicsComponent* gComp, AIComponent* aiComp = nullptr); int Update(float dT, InputHandler* inputHandler); int React(int entityID, EVENT reactEvent); private: //Functions }; #endif
FIX Interface parameter for Entities
FIX Interface parameter for Entities
C
apache-2.0
Chringo/SSP,Chringo/SSP
c1edd1358355fd02d8687f679cb4486ad43a6cce
src/util.h
src/util.h
#ifndef UTIL_H #define UTIL_H /*** Utility functions ***/ #define ALLOC(type) ((type*) xmalloc(sizeof(type))) void *xmalloc(size_t); #define STARTS_WITH(x, y) (strncmp((x), (y), sizeof(y) - 1) == 0) #endif /* UTIL_H */
#ifndef UTIL_H #define UTIL_H /*** Utility functions ***/ #define ALLOC(type) ((type*) xmalloc(sizeof(type))) void *xmalloc(size_t); #define STARTS_WITH(x, y) (strncmp((x), (y), strlen(y)) == 0) #endif /* UTIL_H */
Fix STARTS_WITH macro comparing 1 less character than needed
Fix STARTS_WITH macro comparing 1 less character than needed
C
apache-2.0
mopidy/libmockspotify,mopidy/libmockspotify,mopidy/libmockspotify
bc33362a093bc50a2b0c6edad3242b5abf688482
ObjectiveRocks/RocksDBComparator.h
ObjectiveRocks/RocksDBComparator.h
// // RocksDBComparator.h // ObjectiveRocks // // Created by Iska on 22/11/14. // Copyright (c) 2014 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> typedef NS_ENUM(NSUInteger, RocksDBComparatorType) { RocksDBComparatorBytewiseAscending, RocksDBComparatorBytewiseDescending, RocksDBComparatorStringCompareAscending, RocksDBComparatorStringCompareDescending, RocksDBComparatorNumberAscending, RocksDBComparatorNumberDescending }; @interface RocksDBComparator : NSObject + (instancetype)comaparatorWithType:(RocksDBComparatorType)type; - (instancetype)initWithName:(NSString *)name andBlock:(int (^)(id key1, id key2))block; @end
// // RocksDBComparator.h // ObjectiveRocks // // Created by Iska on 22/11/14. // Copyright (c) 2014 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> /** An enum defining the built-in Comparators. */ typedef NS_ENUM(NSUInteger, RocksDBComparatorType) { /** @brief Orders the keys lexicographically in ascending order. */ RocksDBComparatorBytewiseAscending, /** @brief Orders the keys lexicographically in descending order. */ RocksDBComparatorBytewiseDescending, /** @brief Orders NSString keys in ascending order via the compare selector. */ RocksDBComparatorStringCompareAscending, /** @brief Orders NSString keys in descending order via the compare selector. */ RocksDBComparatorStringCompareDescending, /** @brief Orders NSNumber keys in ascending order via the compare selector.*/ RocksDBComparatorNumberAscending, /** @brief Orders NSNumber keys in descending order via the compare selector. */ RocksDBComparatorNumberDescending }; /** The keys are ordered within the key-value store according to a specified comparator function. The default ordering function for keys orders the bytes lexicographically. This behavior can be changed by supplying a custom Comparator when opening a database using the `RocksDBComparator`. */ @interface RocksDBComparator : NSObject /** Intializes a new Comparator instance for the given built-in type. @param type The comparator type. @return a newly-initialized instance of a keys comparator. */ + (instancetype)comaparatorWithType:(RocksDBComparatorType)type; /** Intializes a new Comparator instance with the given name and comparison block. @param name The name of the comparator. @param block The comparator block to apply on the keys in order to specify their order. @return a newly-initialized instance of a keys comparator. */ - (instancetype)initWithName:(NSString *)name andBlock:(int (^)(id key1, id key2))block; @end
Add source code documentation for the Comparator class
Add source code documentation for the Comparator class
C
mit
iabudiab/ObjectiveRocks,iabudiab/ObjectiveRocks,iabudiab/ObjectiveRocks,iabudiab/ObjectiveRocks
13d6f51d99675d5c31d4fb6c6fc18dcb1acb9ba0
spellutil.h
spellutil.h
#ifndef SPELLUTIL_H #define SPELLUTIL_H typedef struct spell_list_node { struct spell_list_node *next; void *data; } spell_list_node; spell_list_node *spell_list_init(void *); int spell_list_add(spell_list_node **, void *); void spell_list_free(spell_list_node **, void (*) (void *)); #endif
#ifndef SPELLUTIL_H #define SPELLUTIL_H typedef struct spell_list_node { struct spell_list_node *next; void *data; } spell_list_node; typedef struct spell_hashtable { char *key; spell_list_node *val; } spell_hashtable; spell_list_node *spell_list_init(void *); int spell_list_add(spell_list_node **, void *); void spell_list_remove(spell_list_node **, spell_list_node *); void spell_list_free(spell_list_node **, void (*) (void *)); spell_hashtable *spell_hashtable_init(size_t); void spell_hashtable_add(spell_hashtable *, char *, void *); void spell_hashtable_remove(spell_hashtable *, char *); void spell_hashtable_get(spell_hashtable *, char *); void spell_hashtable_free(spell_hashtable *, void (*) (void *)); #endif
Add interface for a hash table implementation required for the next stages of the spell checker implementation.
Add interface for a hash table implementation required for the next stages of the spell checker implementation.
C
bsd-2-clause
abhinav-upadhyay/spell,abhinav-upadhyay/spell
fdd0878001f328e622c1f3997ce803a2ef14a311
src/flags.c
src/flags.c
#include "flags.h" #include <stdio.h> #include "laco.h" #include "util.h" static const char* version_matches[] = {"-v", "--version", NULL}; static const char* help_matches[] = {"-h", "-?", "--help", NULL}; /* Print off the current version of laco */ static void handle_version(LacoState* laco, const char** arguments) { const char* version = laco_get_laco_version(laco); printf("laco version %s\n", version); laco_kill(laco, 0, NULL); } /* Print off the help screen */ static void handle_help(LacoState* laco, const char** arguments) { puts("A better REPL for Lua.\n"); puts("Usage: laco [options]\n"); puts("-h | -? | --help \tPrint this help screen"); puts("-v | --version \tPrint current version"); laco_kill(laco, 0, NULL); } static const LacoCommand flag_commands[] = { { version_matches, handle_version }, { help_matches, handle_help }, { NULL, NULL } }; /* External API */ void laco_handle_flag(LacoState* laco) { const char* command = laco_get_laco_args(laco)[1]; laco_dispatch(flag_commands, laco, command, NULL); }
#include "flags.h" #include <stdio.h> #include "laco.h" #include "util.h" static const char* version_matches[] = {"-v", "--version", NULL}; static const char* help_matches[] = {"-h", "--help", NULL}; /* Print off the current version of laco */ static void handle_version(LacoState* laco, const char** arguments) { const char* version = laco_get_laco_version(laco); printf("laco version %s\n", version); laco_kill(laco, 0, NULL); } /* Print off the help screen */ static void handle_help(LacoState* laco, const char** arguments) { puts("A better REPL for Lua.\n"); puts("Usage: laco [options]\n"); puts("-h | --help \tPrint this help screen"); puts("-v | --version \tPrint current version"); laco_kill(laco, 0, NULL); } static const LacoCommand flag_commands[] = { { version_matches, handle_version }, { help_matches, handle_help }, { NULL, NULL } }; /* External API */ void laco_handle_flag(LacoState* laco) { const char* command = laco_get_laco_args(laco)[1]; laco_dispatch(flag_commands, laco, command, NULL); }
Remove `-?` to display help
Remove `-?` to display help It seems like `--help` and `-h` is good enough alternatives for getting the help display.
C
bsd-2-clause
sourrust/laco
e4d969299a627124fde388be9b057781a3a57fe4
src/libreset/ht.c
src/libreset/ht.c
#include <stdlib.h> #include "ht.h" #include "util/macros.h" struct ht* ht_init( struct ht* ht, size_t n ) { if (ht) { ht->buckets = calloc(n, sizeof(*ht->buckets)); ht->nbuckets = n; } return ht; } void ht_destroy( struct ht* ht ) { if (ht) { for (; ht->nbuckets > 0; ht->nbuckets--) { avl_destroy(&ht->buckets[ht->nbuckets - 1].avl); } free(ht->buckets); free(ht); } } struct ht_bucket* ht_find( struct ht* ht, rs_hash hash ) { if (!ht) { return NULL; } return &ht->buckets[hash % (CONSTPOW_TWO(BITCOUNT(hash)) / ht->nbuckets)]; }
#include <stdlib.h> #include "ht.h" #include "util/macros.h" struct ht* ht_init( struct ht* ht, size_t n ) { if (ht) { ht->buckets = calloc(n, sizeof(*ht->buckets)); ht->nbuckets = n; } return ht; } void ht_destroy( struct ht* ht ) { if (ht) { for (; ht->nbuckets > 0; ht->nbuckets--) { avl_destroy(&ht->buckets[ht->nbuckets - 1].avl); } free(ht->buckets); free(ht); } } struct ht_bucket* ht_find( struct ht* ht, rs_hash hash ) { if (!ht) { return NULL; } return &ht->buckets[hash / ((CONSTPOW_TWO(BITCOUNT(hash)) / ht->nbuckets))]; }
Use division here, not modulo
Fixup: Use division here, not modulo
C
lgpl-2.1
waysome/libreset,waysome/libreset
f350f1048b136bcf5adf21769af3379abc094d68
zuzeelik.c
zuzeelik.c
#include <stdio.h> #include <stdlib.h> #include <editline/readline.h> #include <editline/history.h> int main(int argc, char** argv) { puts("zuzeelik [version: v0.0.0-0.0.2]"); puts("Press Ctrl+C to Exit \n"); /* Starting REPL */ while(1){ /* output from the prompt*/ char* input = readline("zuzeelik> "); /*Add input to history */ add_history(input); /* Echo the input back to the user */ printf("Got Input: %s \n", input); free(input); } return 0; }
#include <stdio.h> #include <stdlib.h> /* if compiling in windows, compiling with this functions */ #ifdef _WIN32 #include <string.h> static char buffer[2048]; /* fake readline functions */ char* readline(char* prompt) { fputs(prompt, stdout); fputs(buffer, 2048, stdin); fgets(buffer, 2048, stdin); char* copy = malloc(strlen(buffer)+1); strcpy(copy, buffer); copy[strlen(copy) - 1] = '\0'; return copy; } /* fake add_history function */ void add_history(char* not_used) {} /* or include thesse editline header */ #else #include <editline/readline.h> #include <editline/history.h> #endif int main(int argc, char** argv) { puts("zuzeelik [version: v0.0.0-0.0.3]"); puts("Press Ctrl+C to Exit \n"); /* Starting REPL */ while(1){ /* output from the prompt*/ char* input = readline("zuzeelik> "); /*Add input to history */ add_history(input); /* Echo the input back to the user */ printf("Got Input: %s \n", input); /*free retrieved input */ free(input); } return 0; }
Add portability for windows OS
Add portability for windows OS Added protibility for windows OS,using preprocessor directives and made fake functions for windows.
C
bsd-3-clause
Mr-Kumar-Abhishek/zuzeelik,shadow-stranger/zuzeelik
aeb2aad80dfff4276c3e64347dd506bc2d73bc41
pkg/fizhi/fizhi_ocean_coms.h
pkg/fizhi/fizhi_ocean_coms.h
C $Header$ C $Name$ c Ocean Exports c ------------------- common /ocean_exports/ sst, sice, ksst, kice _RL sst(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nsx,Nsy) _RL sice(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nsx,Nsy) integer ksst, kice
C $Header$ C $Name$ c Ocean Parameters c ------------------- common /ocean_params/sstclim,sstfreq,siceclim,sicefreq,ksst,kice logical sstclim,sstfreq,siceclim,sicefreq integer ksst, kice c Ocean Exports c ------------------- common /ocean_exports/ sst, sice _RL sst(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nsx,Nsy) _RL sice(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nsx,Nsy)
Add options for yearly sst data, move some other stuff around a bit
Add options for yearly sst data, move some other stuff around a bit
C
mit
altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h
446fbd56fc8ab90ea108f30376fb3f8706eabe75
src/sigen.h
src/sigen.h
// // sigen.h: global header file for user includes // ----------------------------------- #pragma once #include <sigen/types.h> #include <sigen/dvb_defs.h> #include <sigen/version.h> #include <sigen/tstream.h> #include <sigen/packetizer.h> #include <sigen/utc.h> #include <sigen/util.h> #include <sigen/dump.h> #include <sigen/table.h> #include <sigen/nit.h> #include <sigen/bat.h> #include <sigen/sdt.h> #include <sigen/pat.h> #include <sigen/pmt.h> #include <sigen/cat.h> #include <sigen/eit.h> #include <sigen/tdt.h> #include <sigen/tot.h> #include <sigen/other_tables.h> #include <sigen/descriptor.h> #include <sigen/dvb_desc.h> #include <sigen/stream_desc.h> #include <sigen/nit_desc.h> #include <sigen/linkage_desc.h> #include <sigen/sdt_desc.h> #include <sigen/pmt_desc.h> #include <sigen/ssu_desc.h> #include <sigen/eit_desc.h>
// // sigen.h: global header file for user includes // ----------------------------------- #pragma once #include "types.h" #include "dvb_defs.h" #include "version.h" #include "tstream.h" #include "packetizer.h" #include "utc.h" #include "util.h" #include "dump.h" #include "table.h" #include "nit.h" #include "bat.h" #include "sdt.h" #include "pat.h" #include "pmt.h" #include "cat.h" #include "eit.h" #include "tdt.h" #include "tot.h" #include "other_tables.h" #include "descriptor.h" #include "dvb_desc.h" #include "stream_desc.h" #include "nit_desc.h" #include "linkage_desc.h" #include "sdt_desc.h" #include "pmt_desc.h" #include "ssu_desc.h" #include "eit_desc.h"
Fix header includes to use local paths.
Fix header includes to use local paths.
C
mit
edporras/sigen,edporras/sigen,edporras/sigen,edporras/sigen
9e6bff980dd07d5cd9fcda8f882541fb2124366f
test/expression_command/timeout/wait-a-while.c
test/expression_command/timeout/wait-a-while.c
#include <stdio.h> #include <unistd.h> #include <sys/time.h> #include <stdint.h> int wait_a_while (useconds_t interval) { int num_times = 0; int return_value = 1; struct timeval start_time; gettimeofday(&start_time, NULL); uint64_t target = start_time.tv_sec * 1000000 + start_time.tv_usec + interval; while (1) { num_times++; return_value = usleep (interval); if (return_value != 0) { struct timeval now; gettimeofday(&now, NULL); interval = target - now.tv_sec * 1000000 + now.tv_usec; } else break; } return num_times; } int main (int argc, char **argv) { printf ("stop here in main.\n"); int num_times = wait_a_while (argc * 1000); printf ("Done, took %d times.\n", num_times); return 0; }
#include <stdio.h> #include <unistd.h> #include <sys/time.h> #include <stdint.h> int wait_a_while (useconds_t interval) { int num_times = 0; int return_value = 1; struct timeval start_time; gettimeofday(&start_time, NULL); uint64_t target = start_time.tv_sec * 1000000 + start_time.tv_usec + interval; while (1) { num_times++; return_value = usleep (interval); if (return_value != 0) { struct timeval now; gettimeofday(&now, NULL); interval = target - (now.tv_sec * 1000000 + now.tv_usec); } else break; } return num_times; } int main (int argc, char **argv) { printf ("stop here in main.\n"); int num_times = wait_a_while (argc * 1000); printf ("Done, took %d times.\n", num_times); return 0; }
Fix interval recalculation in the event that usleep is interrupted
Fix interval recalculation in the event that usleep is interrupted git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@207566 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb
f518438117dce6549cc1e5f8eec27c42621458dc
shellcode/shellcode_1.c
shellcode/shellcode_1.c
// gcc -mpreferred-stack-boundary=2 -ggdb shellcode_1.c -o shellcode_1 // run the syscalls from syscall_native.c from a static buffer #include <stdio.h> // WORKING // * exit is called, and the process exits with the right code // TODO // * write doesn't write anything - check %ebp-4 is the right address // Get hex representation of syscall_inline.c from gdb // `disas f` to find the inline asm, then print each address: // (gdb) x/bx f+13 // (gdb) x/bx f+14 // etc... // This shellcode has lots of null bytes which is a problem // for overflowing string buffers. It's OK here because there is no // overflow - we just point main's return pointer at the start of the // static shellcode. Static memory is executable. const char shellcode[] = // print %ebp-4 // "\xb8\x04\x00\x00\x00\xbb\x01\x00\x00\x00\x8b" //"\x4d\xfc\xba\x03\x00\x00\x00\xcd\x80" // exit 255 // (code is the first byte on the second line) "\xb8\x01\x00\x00\x00\xbb" "\xff\x00\x00\x00\xcd\x80"; void f() { // char s[] = "hello"; int *ret; ret = (int*)&ret + 2; (*ret) = (int)shellcode; } void main() { f(); printf("not called because exit\n"); }
Make exit syscall from shellcode in static memory
Make exit syscall from shellcode in static memory * write syscall not working yet
C
mit
jwhitfieldseed/sandbox,jwhitfieldseed/sandbox,jwhitfieldseed/sandbox,jwhitfieldseed/sandbox
4a84755d57214ef5b73fae956c525f70f4da7b66
collatz/count.c
collatz/count.c
#include <stdio.h> #include <stdlib.h> struct step_count { long start; long max; size_t steps; }; static long r(long n, struct step_count* cnt) { printf("%ld\n", n); //do not count last step, we're counting the initial call //causing 63,728,127 to count 950 steps instead of expected 949 if (n <= 1) return n; ++cnt->steps; if (cnt->max < n) { cnt->max = n; } if (n%2) return r(n*3+1, cnt); return r(n/2, cnt); } int main (int argc, char **argv) { long n = 15; if (argc > 1) n = strtol(argv[1], NULL, 10); struct step_count cnt = {n, n, 0}; puts("Basic collatz fun - recursive C function"); r(n, &cnt); printf( "Started with %ld. Reached end after %zu steps\nHighest value was %ld\n", cnt.start, cnt.steps, cnt.max ); return 0; }
Add collatz C snippet that keeps track of highest value + total steps taken
Add collatz C snippet that keeps track of highest value + total steps taken
C
mit
EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts
42352805016e94ea2d1b1f13bc8d6cde63c57022
src/commands/debugger.c
src/commands/debugger.c
#include "debugger.h" #include <stdio.h> #include <lua.h> #include "laco.h" void laco_print_debug_info(struct LacoState* laco, const char* function_name) { lua_State* L = laco_get_laco_lua_state(laco); lua_Debug debug_info = {0}; lua_getfield(L, LUA_GLOBALSINDEX, function_name); lua_getinfo(L, ">Sl", &debug_info); printf( "What: \t%s\n" "Source file: \t%s\n" "Line defined on: \t%d\n" "Current line: \t%d\n", debug_info.what, debug_info.source, debug_info.linedefined, debug_info.currentline); }
#include "debugger.h" #include <lua.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "laco.h" #include "util.h" void laco_print_debug_info(struct LacoState* laco, const char* function_name) { int i; char* namespace; lua_State* L = laco_get_laco_lua_state(laco); size_t index = LUA_GLOBALSINDEX; lua_Debug debug_info = {0}; char* name = strdup(function_name); char** namespaces = laco_split_by(".", name, 0); /* Walk down the namespace if there is something to go down */ for(i = 0; (namespace = namespaces[i]); i++) { lua_getfield(L, index, namespace); index = lua_gettop(L); } lua_getinfo(L, ">Sl", &debug_info); printf( "What: \t%s\n" "Source file: \t%s\n" "Line defined on: \t%d\n" "Current line: \t%d\n", debug_info.what, debug_info.source, debug_info.linedefined, debug_info.currentline); /* Pop off the extra fields from the top of the stack */ if(i > 1) { lua_pop(L, i - 1); } free(name); free(namespaces); }
Add ablity to look through named tables
Add ablity to look through named tables
C
bsd-2-clause
sourrust/laco
eeef499339106928c39e22d9b5e0edfcaf3bc85c
src/fuzzing/mutator.h
src/fuzzing/mutator.h
// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // 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 MUTATOR_H_ #define MUTATOR_H_ #include <vector> namespace fido2_tests { // Mutates the given data by applying combined basic mutation operations. class Mutator { public: enum MutationOperation { kEraseByte, kInsertByte, kShuffleBytes, }; Mutator(int max_mutation_degree = 10, int seed = time(NULL)); bool EraseByte(std::vector<uint8_t> &data, size_t max_size); bool InsertByte(std::vector<uint8_t> &data, size_t max_size); bool ShuffleBytes(std::vector<uint8_t> &data, size_t max_size); bool Mutate(std::vector<uint8_t> &data, size_t max_size); private: int max_mutation_degree_; }; } // namespace fido2_tests #endif // MUTATOR_H_
// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // 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 MUTATOR_H_ #define MUTATOR_H_ #include <stdint.h> #include <ctime> #include <vector> namespace fido2_tests { // Mutates the given data by applying combined basic mutation operations. class Mutator { public: enum MutationOperation { kEraseByte, kInsertByte, kShuffleBytes, }; Mutator(int max_mutation_degree = 10, int seed = time(NULL)); bool EraseByte(std::vector<uint8_t> &data, size_t max_size); bool InsertByte(std::vector<uint8_t> &data, size_t max_size); bool ShuffleBytes(std::vector<uint8_t> &data, size_t max_size); bool Mutate(std::vector<uint8_t> &data, size_t max_size); private: int max_mutation_degree_; }; } // namespace fido2_tests #endif // MUTATOR_H_
Add library for github workflow
Add library for github workflow
C
apache-2.0
google/CTAP2-test-tool,google/CTAP2-test-tool,google/CTAP2-test-tool
7d47b8f080e71139662b682d8f395f4a3f4789f2
firmware/greatfet_usb/usb_api_dac.c
firmware/greatfet_usb/usb_api_dac.c
/* * This file is part of GreatFET */ #include "usb_api_dac.h" #include "usb.h" #include "usb_queue.h" #include "usb_endpoint.h" #include <stddef.h> #include <greatfet_core.h> #include <dac.h> #include <pins.h> usb_request_status_t usb_vendor_request_dac_set( usb_endpoint_t* const endpoint, const usb_transfer_stage_t stage) { usb_endpoint_init(&usb0_endpoint_bulk_in); if (stage == USB_TRANSFER_STAGE_SETUP) { // set J2_P5 up as a DAC pin scu_pinmux(SCU_PINMUX_GPIO2_3, SCU_GPIO_FAST | SCU_GPIO_PUP | SCU_CONF_FUNCTION0); static struct gpio_t dac_pin = GPIO(2, 3); gpio_input(&dac_pin); DAC_CR = DAC_CR_VALUE(endpoint->setup.value) && DAC_CR_VALUE_MASK; DAC_CTRL = DAC_CTRL_DMA_ENA; usb_transfer_schedule_ack(endpoint->in); } return USB_REQUEST_STATUS_OK; }
/* * This file is part of GreatFET */ #include "usb_api_dac.h" #include "usb.h" #include "usb_queue.h" #include "usb_endpoint.h" #include <stddef.h> #include <greatfet_core.h> #include <dac.h> #include <pins.h> usb_request_status_t usb_vendor_request_dac_set( usb_endpoint_t* const endpoint, const usb_transfer_stage_t stage) { usb_endpoint_init(&usb0_endpoint_bulk_in); if (stage == USB_TRANSFER_STAGE_SETUP) { // set J2_P5 up as a DAC pin scu_pinmux(SCU_PINMUX_GPIO2_3, SCU_GPIO_FAST | SCU_GPIO_PUP | SCU_CONF_FUNCTION0); static struct gpio_t dac_pin = GPIO(2, 3); gpio_input(&dac_pin); DAC_CR = DAC_CR_VALUE(endpoint->setup.value) & DAC_CR_VALUE_MASK; DAC_CTRL = DAC_CTRL_DMA_ENA; usb_transfer_schedule_ack(endpoint->in); } return USB_REQUEST_STATUS_OK; }
Fix typo which used a mask for a logical-and
Fix typo which used a mask for a logical-and The DAC conversion register value mask was logical-and'ed instead of bitwise-and'ed when setting the DAC value via USB vendor request.
C
bsd-3-clause
greatscottgadgets/greatfet,dominicgs/GreatFET-experimental,greatscottgadgets/greatfet,greatscottgadgets/greatfet,dominicgs/GreatFET-experimental,dominicgs/GreatFET-experimental,greatscottgadgets/greatfet
452d4b6c823d793770676dc5e2f3fc32c6c15e6d
src/condor_includes/condor_constants.h
src/condor_includes/condor_constants.h
#ifndef CONSTANTS_H #define CONSTANTS_H #if !defined(__STDC__) && !defined(__cplusplus) #define const #endif /* Set up a boolean variable type. Since this definition could conflict with other reasonable definition of BOOLEAN, i.e. using an enumeration, it is conditional. */ #ifndef BOOLEAN_TYPE_DEFINED typedef int BOOLEAN; typedef int BOOL_T; #endif #if defined(TRUE) # undef TRUE # undef FALSE #endif static const int TRUE = 1; static const int FALSE = 0; /* Useful constants for turning seconds into larger units of time. Since these constants may have already been defined elsewhere, they are conditional. */ #ifndef TIME_CONSTANTS_DEFINED static const int MINUTE = 60; static const int HOUR = 60 * 60; static const int DAY = 24 * 60 * 60; #endif /* This is for use with strcmp() and related functions which will return 0 upon a match. */ #ifndef MATCH static const int MATCH = 0; #endif /* These are the well known file descriptors used for remote system call and logging functions. */ #ifndef CLIENT_LOG static const int CLIENT_LOG = 18; static const int RSC_SOCK = 17; #endif static const int REQ_SOCK = 16; static const int RPL_SOCK = 17; #endif
#ifndef CONSTANTS_H #define CONSTANTS_H #if !defined(__STDC__) && !defined(__cplusplus) #define const #endif /* Set up a boolean variable type. Since this definition could conflict with other reasonable definition of BOOLEAN, i.e. using an enumeration, it is conditional. */ #ifndef BOOLEAN_TYPE_DEFINED typedef int BOOLEAN; typedef int BOOL_T; #define BOOLAN_TYPE_DEFINED #endif #if defined(TRUE) # undef TRUE # undef FALSE #endif static const int TRUE = 1; static const int FALSE = 0; /* Useful constants for turning seconds into larger units of time. Since these constants may have already been defined elsewhere, they are conditional. */ #ifndef TIME_CONSTANTS_DEFINED static const int MINUTE = 60; static const int HOUR = 60 * 60; static const int DAY = 24 * 60 * 60; #endif /* This is for use with strcmp() and related functions which will return 0 upon a match. */ #ifndef MATCH static const int MATCH = 0; #endif /* These are the well known file descriptors used for remote system call and logging functions. */ #ifndef CLIENT_LOG static const int CLIENT_LOG = 18; static const int RSC_SOCK = 17; #endif static const int REQ_SOCK = 16; static const int RPL_SOCK = 17; #endif
Define CPP macro BOOLAN_TYPE_DEFINED when we define types BOOLEAN and BOOL_T, to avoid doing it twice.
Define CPP macro BOOLAN_TYPE_DEFINED when we define types BOOLEAN and BOOL_T, to avoid doing it twice.
C
apache-2.0
htcondor/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,zhangzhehust/htcondor,neurodebian/htcondor,djw8605/htcondor,htcondor/htcondor,neurodebian/htcondor,djw8605/condor,neurodebian/htcondor,djw8605/condor,clalancette/condor-dcloud,djw8605/condor,bbockelm/condor-network-accounting,djw8605/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,neurodebian/htcondor,djw8605/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,bbockelm/condor-network-accounting,djw8605/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,djw8605/htcondor,djw8605/htcondor,djw8605/htcondor,htcondor/htcondor,djw8605/condor,zhangzhehust/htcondor,djw8605/condor,djw8605/condor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,bbockelm/condor-network-accounting,zhangzhehust/htcondor,htcondor/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,neurodebian/htcondor,htcondor/htcondor,djw8605/condor,djw8605/condor,htcondor/htcondor,htcondor/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,bbockelm/condor-network-accounting,clalancette/condor-dcloud,clalancette/condor-dcloud,zhangzhehust/htcondor,zhangzhehust/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,neurodebian/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,djw8605/htcondor
c033df3aeef588c2faf3cce3066b091980be0083
src/include/xmmsc/xmmsc_sockets.h
src/include/xmmsc/xmmsc_sockets.h
#ifndef XMMSC_SOCKETS_H #define XMMSC_SOCKETS_H #include <xmmsc/xmmsc_stdbool.h> /* Windows */ #ifdef _MSC_VER #include <Winsock2.h> #include <Ws2tcpip.h> typedef SOCKET xmms_socket_t; typedef int socklen_t; #define XMMS_EINTR WSAEINTR #define XMMS_EAGAIN WSAEWOULDBLOCK /* UNIX */ #else #define SOCKET_ERROR (-1) #define XMMS_EINTR EINTR #define XMMS_EAGAIN EWOULDBLOCK #include <sys/socket.h> #include <sys/select.h> #include <sys/types.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <arpa/inet.h> #include <netdb.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> typedef int xmms_socket_t; #endif int xmms_sockets_initialize(); int xmms_socket_set_nonblock(xmms_socket_t socket); int xmms_socket_valid(xmms_socket_t socket); void xmms_socket_close(xmms_socket_t socket); int xmms_socket_errno(); bool xmms_socket_error_recoverable(); #endif
#ifndef XMMSC_SOCKETS_H #define XMMSC_SOCKETS_H #include <xmmsc/xmmsc_stdbool.h> /* Windows */ #ifdef _MSC_VER #include <Winsock2.h> #include <Ws2tcpip.h> typedef SOCKET xmms_socket_t; typedef int socklen_t; #define XMMS_EINTR WSAEINTR #define XMMS_EAGAIN WSAEWOULDBLOCK /* UNIX */ #else #define SOCKET_ERROR (-1) #define XMMS_EINTR EINTR #define XMMS_EAGAIN EWOULDBLOCK #include <sys/types.h> #include <sys/socket.h> #include <sys/select.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <arpa/inet.h> #include <netdb.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> typedef int xmms_socket_t; #endif int xmms_sockets_initialize(); int xmms_socket_set_nonblock(xmms_socket_t socket); int xmms_socket_valid(xmms_socket_t socket); void xmms_socket_close(xmms_socket_t socket); int xmms_socket_errno(); bool xmms_socket_error_recoverable(); #endif
Fix compilation on OpenBSD (from Bernhard Leiner)
BUG(501): Fix compilation on OpenBSD (from Bernhard Leiner)
C
lgpl-2.1
theefer/xmms2,oneman/xmms2-oneman-old,theeternalsw0rd/xmms2,oneman/xmms2-oneman-old,mantaraya36/xmms2-mantaraya36,krad-radio/xmms2-krad,theefer/xmms2,krad-radio/xmms2-krad,dreamerc/xmms2,chrippa/xmms2,mantaraya36/xmms2-mantaraya36,chrippa/xmms2,theefer/xmms2,oneman/xmms2-oneman-old,six600110/xmms2,six600110/xmms2,oneman/xmms2-oneman-old,chrippa/xmms2,chrippa/xmms2,oneman/xmms2-oneman-old,krad-radio/xmms2-krad,xmms2/xmms2-stable,theeternalsw0rd/xmms2,six600110/xmms2,dreamerc/xmms2,oneman/xmms2-oneman,mantaraya36/xmms2-mantaraya36,mantaraya36/xmms2-mantaraya36,chrippa/xmms2,theefer/xmms2,oneman/xmms2-oneman,mantaraya36/xmms2-mantaraya36,oneman/xmms2-oneman,theeternalsw0rd/xmms2,six600110/xmms2,mantaraya36/xmms2-mantaraya36,theeternalsw0rd/xmms2,oneman/xmms2-oneman,dreamerc/xmms2,oneman/xmms2-oneman,dreamerc/xmms2,mantaraya36/xmms2-mantaraya36,oneman/xmms2-oneman,xmms2/xmms2-stable,dreamerc/xmms2,theefer/xmms2,xmms2/xmms2-stable,krad-radio/xmms2-krad,oneman/xmms2-oneman,xmms2/xmms2-stable,theeternalsw0rd/xmms2,six600110/xmms2,theefer/xmms2,krad-radio/xmms2-krad,chrippa/xmms2,six600110/xmms2,xmms2/xmms2-stable,theefer/xmms2,xmms2/xmms2-stable,krad-radio/xmms2-krad,theeternalsw0rd/xmms2
2c90cd47e03a5ae5f725d3a7d638dfaf05f7896d
tests/Native/Passes.h
tests/Native/Passes.h
enum FlagEnum { A = 1 << 0, B = 1 << 1, C = 1 << 2, D = 1 << 3, }; enum FlagEnum2 { A = 1 << 0, B = 1 << 1, C = 1 << 2, D = 1 << 4, }; class C { }; void DoSomethingC(C*, int); struct TestRename { int lowerCaseMethod(); int lowerCaseField; }; #define TEST_ENUM_ITEM_NAME_0 0 #define TEST_ENUM_ITEM_NAME_1 1 #define TEST_ENUM_ITEM_NAME_2 2
enum FlagEnum { A = 1 << 0, B = 1 << 1, C = 1 << 2, D = 1 << 3, }; enum FlagEnum2 { A1 = 1 << 0, B1 = 3, C1 = 1 << 2, D1 = 1 << 4, }; class Foo { }; void FooStart(Foo*, int); struct TestRename { int lowerCaseMethod(); int lowerCaseField; }; #define TEST_ENUM_ITEM_NAME_0 0 #define TEST_ENUM_ITEM_NAME_1 1 #define TEST_ENUM_ITEM_NAME_2 2 // TestStructInheritance struct S1 { int F1, F2; }; struct S2 : S1 { int F3; };
Update the passes test source file.
Update the passes test source file.
C
mit
ktopouzi/CppSharp,genuinelucifer/CppSharp,zillemarco/CppSharp,inordertotest/CppSharp,mono/CppSharp,inordertotest/CppSharp,xistoso/CppSharp,txdv/CppSharp,u255436/CppSharp,ktopouzi/CppSharp,nalkaro/CppSharp,xistoso/CppSharp,mohtamohit/CppSharp,imazen/CppSharp,KonajuGames/CppSharp,SonyaSa/CppSharp,Samana/CppSharp,ddobrev/CppSharp,ktopouzi/CppSharp,u255436/CppSharp,txdv/CppSharp,genuinelucifer/CppSharp,ddobrev/CppSharp,nalkaro/CppSharp,imazen/CppSharp,mohtamohit/CppSharp,imazen/CppSharp,mohtamohit/CppSharp,mydogisbox/CppSharp,mydogisbox/CppSharp,ddobrev/CppSharp,mono/CppSharp,u255436/CppSharp,SonyaSa/CppSharp,nalkaro/CppSharp,mohtamohit/CppSharp,mono/CppSharp,txdv/CppSharp,KonajuGames/CppSharp,genuinelucifer/CppSharp,zillemarco/CppSharp,Samana/CppSharp,KonajuGames/CppSharp,ktopouzi/CppSharp,genuinelucifer/CppSharp,Samana/CppSharp,ktopouzi/CppSharp,mydogisbox/CppSharp,KonajuGames/CppSharp,Samana/CppSharp,xistoso/CppSharp,inordertotest/CppSharp,SonyaSa/CppSharp,xistoso/CppSharp,ddobrev/CppSharp,mohtamohit/CppSharp,genuinelucifer/CppSharp,mydogisbox/CppSharp,zillemarco/CppSharp,KonajuGames/CppSharp,zillemarco/CppSharp,inordertotest/CppSharp,zillemarco/CppSharp,imazen/CppSharp,nalkaro/CppSharp,SonyaSa/CppSharp,SonyaSa/CppSharp,u255436/CppSharp,mono/CppSharp,mono/CppSharp,ddobrev/CppSharp,Samana/CppSharp,mono/CppSharp,imazen/CppSharp,nalkaro/CppSharp,txdv/CppSharp,inordertotest/CppSharp,mydogisbox/CppSharp,xistoso/CppSharp,u255436/CppSharp,txdv/CppSharp
c0a4377575c734ce8872d804229f852240d5b661
include/probes_mysql.h
include/probes_mysql.h
/* Copyright (c) 2008 Sun Microsystems, Inc. Use is subject to license terms. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef PROBES_MYSQL_H #define PROBES_MYSQL_H #include <my_global.h> #if defined(HAVE_DTRACE) && !defined(DISABLE_DTRACE) #include "probes_mysql_dtrace.h" #else #include "probes_mysql_nodtrace.h" #endif #endif /* PROBES_MYSQL_H */
/* Copyright (c) 2008 Sun Microsystems, Inc. Use is subject to license terms. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef PROBES_MYSQL_H #define PROBES_MYSQL_H #if defined(HAVE_DTRACE) && !defined(DISABLE_DTRACE) #ifdef __linux__ /* On Linux, generated probes header may include C++ header <limits> which conflicts with min and max macros from my_global.h . To fix, temporarily undefine the macros. */ #pragma push_macro("min") #pragma push_macro("max") #undef min #undef max #endif #include "probes_mysql_dtrace.h" #ifdef __linux__ #pragma pop_macro("min") #pragma pop_macro("max") #endif #else /* no dtrace */ #include "probes_mysql_nodtrace.h" #endif #endif /* PROBES_MYSQL_H */
Fix build error on Ubuntu 11.10, if systemtap is installed.
Fix build error on Ubuntu 11.10, if systemtap is installed. The error is due to conflict between min/max macros in my_global.h and system header < limits>, indirectly included via generated probes_mysql_dtrace.h Temporarily undefined min/max for the inclusion of the probes_mysq_dtrace.h
C
lgpl-2.1
ollie314/server,natsys/mariadb_10.2,davidl-zend/zenddbi,ollie314/server,davidl-zend/zenddbi,davidl-zend/zenddbi,ollie314/server,natsys/mariadb_10.2,ollie314/server,natsys/mariadb_10.2,natsys/mariadb_10.2,natsys/mariadb_10.2,davidl-zend/zenddbi,flynn1973/mariadb-aix,ollie314/server,natsys/mariadb_10.2,flynn1973/mariadb-aix,flynn1973/mariadb-aix,ollie314/server,davidl-zend/zenddbi,davidl-zend/zenddbi,natsys/mariadb_10.2,natsys/mariadb_10.2,ollie314/server,flynn1973/mariadb-aix,flynn1973/mariadb-aix,ollie314/server,flynn1973/mariadb-aix,davidl-zend/zenddbi,flynn1973/mariadb-aix,ollie314/server,ollie314/server,davidl-zend/zenddbi,natsys/mariadb_10.2,flynn1973/mariadb-aix,davidl-zend/zenddbi,davidl-zend/zenddbi,natsys/mariadb_10.2,ollie314/server,slanterns/server,davidl-zend/zenddbi,flynn1973/mariadb-aix,natsys/mariadb_10.2,flynn1973/mariadb-aix,flynn1973/mariadb-aix
6bdd0fda6908cd99fb4186d45faa80b34ccfdc83
include/xaptum-ecdaa.h
include/xaptum-ecdaa.h
/****************************************************************************** * * Copyright 2017 Xaptum, 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 XAPTUM_ECDAA_XAPTUM_ECDAA_H #define XAPTUM_ECDAA_XAPTUM_ECDAA_H #pragma once #include "xaptum-ecdaa/sign.h" #include "xaptum-ecdaa/join_member.h" #include "xaptum-ecdaa/context.h" #endif
/****************************************************************************** * * Copyright 2017 Xaptum, 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 XAPTUM_ECDAA_XAPTUM_ECDAA_H #define XAPTUM_ECDAA_XAPTUM_ECDAA_H #pragma once #include "xaptum-ecdaa/sign.h" #include "xaptum-ecdaa/join_member.h" #include "xaptum-ecdaa/context.h" #include "xaptum-ecdaa/verify.h" #endif
Add verify.h to top-level include-all header.
FIX: Add verify.h to top-level include-all header.
C
apache-2.0
xaptum/ecdaa,xaptum/ecdaa,xaptum/ecdaa
60323734541afb648b0805abf04a3cb043494bfa
libgnome/gnome-popt.h
libgnome/gnome-popt.h
#ifndef __GNOME_POPT_H__ #define __GNOME_POPT_H__ 1 #include "gnome-defs.h" BEGIN_GNOME_DECLS /* This is here because it does not have its own #ifdef __cplusplus */ #include <popt-gnome.h> void gnomelib_register_popt_table(const struct poptOption *options, const char *description); poptContext gnomelib_parse_args(int argc, char *argv[], int popt_flags); /* Some systems, like Red Hat 4.0, define these but don't declare them. Hopefully it is safe to always declare them here. */ extern char *program_invocation_short_name; extern char *program_invocation_name; END_GNOME_DECLS #endif /* __GNOME_HELP_H__ */
#ifndef __GNOME_POPT_H__ #define __GNOME_POPT_H__ 1 #include "gnome-defs.h" BEGIN_GNOME_DECLS /* This is here because it does not have its own #ifdef __cplusplus */ #include <popt.h> void gnomelib_register_popt_table(const struct poptOption *options, const char *description); poptContext gnomelib_parse_args(int argc, char *argv[], int popt_flags); /* Some systems, like Red Hat 4.0, define these but don't declare them. Hopefully it is safe to always declare them here. */ extern char *program_invocation_short_name; extern char *program_invocation_name; END_GNOME_DECLS #endif /* __GNOME_HELP_H__ */
Check for newer popt, and include it in the needed libs. Give correct
Check for newer popt, and include it in the needed libs. Give correct * configure.in: Check for newer popt, and include it in the needed libs. * gnome-compat-1.0.h: Give correct paths to compat headers. * gnome-config.in: Fixes to make help output correct. * gnome.m4: Reorg so it doesn't do any path searching itself, just uses gnome-config. * libgnome/gnome-popt.h: Include popt.h not popt-gnome.h * support/Makefile.am: No popt built-in.
C
lgpl-2.1
Distrotech/libgnome,Distrotech/libgnome,Distrotech/libgnome
aea6ee736f73e503c0fcc2513ffd51bd74d17071
net/proxy/proxy_resolver_mac.h
net/proxy/proxy_resolver_mac.h
// Copyright (c) 2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_PROXY_PROXY_RESOLVER_MAC_H_ #define NET_PROXY_PROXY_RESOLVER_MAC_H_ #pragma once #include <string> #include "googleurl/src/gurl.h" #include "net/base/net_errors.h" #include "net/proxy/proxy_resolver.h" namespace net { // Implementation of ProxyResolver that uses the Mac CFProxySupport to implement // proxies. class ProxyResolverMac : public ProxyResolver { public: ProxyResolverMac() : ProxyResolver(false /*expects_pac_bytes*/) {} // ProxyResolver methods: virtual int GetProxyForURL(const GURL& url, ProxyInfo* results, CompletionCallback* callback, RequestHandle* request, const BoundNetLog& net_log); virtual void CancelRequest(RequestHandle request) { NOTREACHED(); } virtual int SetPacScript( const scoped_refptr<ProxyResolverScriptData>& script_data, CompletionCallback* /*callback*/) { script_data_ = script_data_; return OK; } private: scoped_refptr<ProxyResolverScriptData> script_data_; }; } // namespace net #endif // NET_PROXY_PROXY_RESOLVER_MAC_H_
// Copyright (c) 2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_PROXY_PROXY_RESOLVER_MAC_H_ #define NET_PROXY_PROXY_RESOLVER_MAC_H_ #pragma once #include <string> #include "googleurl/src/gurl.h" #include "net/base/net_errors.h" #include "net/proxy/proxy_resolver.h" namespace net { // Implementation of ProxyResolver that uses the Mac CFProxySupport to implement // proxies. class ProxyResolverMac : public ProxyResolver { public: ProxyResolverMac() : ProxyResolver(false /*expects_pac_bytes*/) {} // ProxyResolver methods: virtual int GetProxyForURL(const GURL& url, ProxyInfo* results, CompletionCallback* callback, RequestHandle* request, const BoundNetLog& net_log); virtual void CancelRequest(RequestHandle request) { NOTREACHED(); } virtual int SetPacScript( const scoped_refptr<ProxyResolverScriptData>& script_data, CompletionCallback* /*callback*/) { script_data_ = script_data; return OK; } private: scoped_refptr<ProxyResolverScriptData> script_data_; }; } // namespace net #endif // NET_PROXY_PROXY_RESOLVER_MAC_H_
Fix a typo, that could cause a crash on mac.
Fix a typo, that could cause a crash on mac. BUG=50717 TBR=rvargas TEST=Set system proxy settings to use a custom PAC script, then launch TestShell.app -- should not crash. Review URL: http://codereview.chromium.org/3023030 git-svn-id: http://src.chromium.org/svn/trunk/src@54279 4ff67af0-8c30-449e-8e8b-ad334ec8d88c Former-commit-id: 1f1e880a7ff7fc1dcb3dbba5910ff6e5a65603c6
C
bsd-3-clause
meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser
505e4531b7e52daf6caa9eac9904d9a014e0d14f
tests/online/badssl.c
tests/online/badssl.c
#include "clar_libgit2.h" #include "git2/clone.h" static git_repository *g_repo; #if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT) void test_online_badssl__expired(void) { cl_git_fail_with(GIT_ECERTIFICATE, git_clone(&g_repo, "https://expired.badssl.com/fake.git", "./fake", NULL)); } void test_online_badssl__wrong_host(void) { cl_git_fail_with(GIT_ECERTIFICATE, git_clone(&g_repo, "https://wrong.host.badssl.com/fake.git", "./fake", NULL)); } void test_online_badssl__self_signed(void) { cl_git_fail_with(GIT_ECERTIFICATE, git_clone(&g_repo, "https://self-signed.badssl.com/fake.git", "./fake", NULL)); } #endif
#include "clar_libgit2.h" #include "git2/clone.h" static git_repository *g_repo; #if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT) static bool g_has_ssl = true; #else static bool g_has_ssl = false; #endif void test_online_badssl__expired(void) { if (!g_has_ssl) cl_skip(); cl_git_fail_with(GIT_ECERTIFICATE, git_clone(&g_repo, "https://expired.badssl.com/fake.git", "./fake", NULL)); } void test_online_badssl__wrong_host(void) { if (!g_has_ssl) cl_skip(); cl_git_fail_with(GIT_ECERTIFICATE, git_clone(&g_repo, "https://wrong.host.badssl.com/fake.git", "./fake", NULL)); } void test_online_badssl__self_signed(void) { if (!g_has_ssl) cl_skip(); cl_git_fail_with(GIT_ECERTIFICATE, git_clone(&g_repo, "https://self-signed.badssl.com/fake.git", "./fake", NULL)); }
Fix build for unit test
Fix build for unit test If none of GIT_OPENSSL, GIT_WINHTTP or GIT_SECURE_TRANSPORT is defined we should also be able to build the unit test.
C
lgpl-2.1
stewid/libgit2,magnus98/TEST,leoyanggit/libgit2,Tousiph/Demo1,yongthecoder/libgit2,jeffhostetler/public_libgit2,KTXSoftware/libgit2,KTXSoftware/libgit2,saurabhsuniljain/libgit2,magnus98/TEST,yongthecoder/libgit2,KTXSoftware/libgit2,magnus98/TEST,yongthecoder/libgit2,Tousiph/Demo1,Tousiph/Demo1,Corillian/libgit2,saurabhsuniljain/libgit2,joshtriplett/libgit2,saurabhsuniljain/libgit2,yongthecoder/libgit2,Corillian/libgit2,leoyanggit/libgit2,KTXSoftware/libgit2,magnus98/TEST,jeffhostetler/public_libgit2,Corillian/libgit2,stewid/libgit2,stewid/libgit2,saurabhsuniljain/libgit2,joshtriplett/libgit2,Tousiph/Demo1,jeffhostetler/public_libgit2,Corillian/libgit2,KTXSoftware/libgit2,magnus98/TEST,leoyanggit/libgit2,saurabhsuniljain/libgit2,stewid/libgit2,yongthecoder/libgit2,yongthecoder/libgit2,leoyanggit/libgit2,jeffhostetler/public_libgit2,stewid/libgit2,Corillian/libgit2,magnus98/TEST,joshtriplett/libgit2,stewid/libgit2,jeffhostetler/public_libgit2,saurabhsuniljain/libgit2,joshtriplett/libgit2,leoyanggit/libgit2,joshtriplett/libgit2,Tousiph/Demo1,joshtriplett/libgit2,jeffhostetler/public_libgit2,Tousiph/Demo1,leoyanggit/libgit2,KTXSoftware/libgit2,Corillian/libgit2
a014bcdc929147cd6c5c2b0dea1d32b1339625b4
ogles_gpgpu/common/macros.h
ogles_gpgpu/common/macros.h
// // ogles_gpgpu project - GPGPU for mobile devices and embedded systems using OpenGL ES 2.0 // // Author: Markus Konrad <[email protected]>, Winter 2014/2015 // http://www.mkonrad.net // // See LICENSE file in project repository root for the license. // #ifndef OGLES_GPGPU_COMMON_MACROS #define OGLES_GPGPU_COMMON_MACROS #define OG_TO_STR_(x) #x #define OG_TO_STR(x) OG_TO_STR_(x) #ifdef DEBUG #define OG_LOGINF(class, args...) fprintf(stdout, "ogles_gpgpu::%s - %s - ", class, __FUNCTION__); fprintf(stdout, args); fprintf(stdout, "\n") #else #define OG_LOGINF(class, args...) #endif #define OG_LOGERR(class, args...) fprintf(stderr, "ogles_gpgpu::%s - %s - ", class, __FUNCTION__); fprintf(stderr, args); fprintf(stderr, "\n") #endif
// // ogles_gpgpu project - GPGPU for mobile devices and embedded systems using OpenGL ES 2.0 // // Author: Markus Konrad <[email protected]>, Winter 2014/2015 // http://www.mkonrad.net // // See LICENSE file in project repository root for the license. // #ifndef OGLES_GPGPU_COMMON_MACROS #define OGLES_GPGPU_COMMON_MACROS #define OG_TO_STR_(x) #x #define OG_TO_STR(x) OG_TO_STR_(x) #if !defined(NDEBUG) #define OG_LOGINF(class, args...) fprintf(stdout, "ogles_gpgpu::%s - %s - ", class, __FUNCTION__); fprintf(stdout, args); fprintf(stdout, "\n") #else #define OG_LOGINF(class, args...) #endif #define OG_LOGERR(class, args...) fprintf(stderr, "ogles_gpgpu::%s - %s - ", class, __FUNCTION__); fprintf(stderr, args); fprintf(stderr, "\n") #endif
Use !NDEBUG to detect Debug variant of build
Use !NDEBUG to detect Debug variant of build
C
apache-2.0
headupinclouds/ogles_gpgpu,headupinclouds/ogles_gpgpu,hunter-packages/ogles_gpgpu,hunter-packages/ogles_gpgpu,hunter-packages/ogles_gpgpu,headupinclouds/ogles_gpgpu,hunter-packages/ogles_gpgpu,headupinclouds/ogles_gpgpu
ed69dd7849b8921917191d6a037d52043e44579f
algorithms/include/algorithms/quick_union_with_path_compression.h
algorithms/include/algorithms/quick_union_with_path_compression.h
#ifndef INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_ #define INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_ #include "DLLDefines.h" #include <vector> #include <stddef.h> /* This algorithm "Quick Union With Path Compression" solves the dynamic connectivity problem. Starting from an empty data structure, any sequence of M union-find ops on N objects makes ≤ c ( N + M lg* N ) array accesses. In reality log * function can be considered to be at the most 5. Thus in theory, this algorithm is not quite linear but in practice it is. */ namespace algorithms { class QuickUnionWithPathCompression { public: MYLIB_EXPORT QuickUnionWithPathCompression(size_t no_of_elements); MYLIB_EXPORT ~QuickUnionWithPathCompression() = default; MYLIB_EXPORT void Union(size_t elementA, size_t elementB); MYLIB_EXPORT bool Connected(size_t elementA, size_t elementB); private: size_t GetRoot(size_t element); inline bool IsIdInBounds(size_t element) { return element >= 0 && element < id_.size(); } private: std::vector<size_t> id_; std::vector<size_t> size_; }; } #endif //INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_
#ifndef INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_ #define INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_ #include "DLLDefines.h" #include <vector> #include <stddef.h> /* This algorithm "Quick Union With Path Compression" solves the dynamic connectivity problem. Starting from an empty data structure, any sequence of M union-find ops on N objects makes ≤ c ( N + M lg* N ) array accesses. In reality log * function can be considered to be at the most 5. Thus in theory, this algorithm is not quite linear but in practice it is. */ namespace algorithms { class QuickUnionWithPathCompression { public: MYLIB_EXPORT QuickUnionWithPathCompression(size_t no_of_elements); MYLIB_EXPORT ~QuickUnionWithPathCompression() = default; MYLIB_EXPORT void Union(size_t elementA, size_t elementB); MYLIB_EXPORT bool Connected(size_t elementA, size_t elementB); private: size_t GetRoot(size_t element); inline bool IsIdInBounds(size_t element) { return element < id_.size(); } private: std::vector<size_t> id_; std::vector<size_t> size_; }; } #endif //INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_
Remove unnecessary checking of size_t >= 0
Remove unnecessary checking of size_t >= 0
C
mit
TusharJadhav/algorithms,TusharJadhav/algorithms
e5171648164a72ea9ae83e5f2bb47dcb5b498fa6
eg/inc/Hepevt.h
eg/inc/Hepevt.h
/* @(#)root/eg:$Name$:$Id$ */ /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_HepEvt #define ROOT_HepEvt extern "C" { #ifndef __CFORTRAN_LOADED #include "cfortran.h" #endif typedef struct { Int_t nevhep; Int_t nhep; Int_t isthep[2000]; Int_t idhep[2000]; Int_t jmohep[2000][2]; Int_t jdahep[2000][2]; Double_t phep[2000][5]; Double_t vhep[2000][4]; } HEPEVT_DEF; #define HEPEVT COMMON_BLOCK(HEPEVT,hepevt) COMMON_BLOCK_DEF(HEPEVT_DEF,HEPEVT); HEPEVT_DEF HEPEVT; } #endif
/* @(#)root/eg:$Name: $:$Id: Hepevt.h,v 1.1.1.1 2000/05/16 17:00:47 rdm Exp $ */ /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_HepEvt #define ROOT_HepEvt extern "C" { #ifndef __CFORTRAN_LOADED #include "cfortran.h" #endif typedef struct { Int_t nevhep; Int_t nhep; Int_t isthep[4000]; Int_t idhep[4000]; Int_t jmohep[4000][2]; Int_t jdahep[4000][2]; Double_t phep[4000][5]; Double_t vhep[4000][4]; } HEPEVT_DEF; #define HEPEVT COMMON_BLOCK(HEPEVT,hepevt) COMMON_BLOCK_DEF(HEPEVT_DEF,HEPEVT); HEPEVT_DEF HEPEVT; } #endif
Change maximum dimension of hepevt from 2000 to 4000 to be consistent between Pythia5 and 6. Note that this change implies a recompilation of jetset.f
Change maximum dimension of hepevt from 2000 to 4000 to be consistent between Pythia5 and 6. Note that this change implies a recompilation of jetset.f git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@5072 27541ba8-7e3a-0410-8455-c3a389f83636
C
lgpl-2.1
sbinet/cxx-root,krafczyk/root,beniz/root,karies/root,agarciamontoro/root,sbinet/cxx-root,simonpf/root,nilqed/root,Dr15Jones/root,vukasinmilosevic/root,gbitzes/root,omazapa/root,zzxuanyuan/root,buuck/root,lgiommi/root,satyarth934/root,0x0all/ROOT,jrtomps/root,agarciamontoro/root,krafczyk/root,perovic/root,sbinet/cxx-root,cxx-hep/root-cern,thomaskeck/root,georgtroska/root,abhinavmoudgil95/root,gbitzes/root,karies/root,Y--/root,omazapa/root-old,dfunke/root,perovic/root,sawenzel/root,sawenzel/root,agarciamontoro/root,mhuwiler/rootauto,cxx-hep/root-cern,zzxuanyuan/root-compressor-dummy,simonpf/root,sirinath/root,Duraznos/root,krafczyk/root,olifre/root,beniz/root,sirinath/root,simonpf/root,strykejern/TTreeReader,davidlt/root,ffurano/root5,karies/root,simonpf/root,davidlt/root,Duraznos/root,dfunke/root,dfunke/root,evgeny-boger/root,mkret2/root,sirinath/root,jrtomps/root,esakellari/root,esakellari/my_root_for_test,olifre/root,Y--/root,0x0all/ROOT,abhinavmoudgil95/root,satyarth934/root,sawenzel/root,esakellari/my_root_for_test,zzxuanyuan/root-compressor-dummy,davidlt/root,vukasinmilosevic/root,perovic/root,buuck/root,pspe/root,evgeny-boger/root,veprbl/root,nilqed/root,Y--/root,zzxuanyuan/root-compressor-dummy,kirbyherm/root-r-tools,omazapa/root,CristinaCristescu/root,dfunke/root,root-mirror/root,pspe/root,ffurano/root5,esakellari/root,mkret2/root,beniz/root,smarinac/root,simonpf/root,sirinath/root,krafczyk/root,lgiommi/root,abhinavmoudgil95/root,esakellari/my_root_for_test,Y--/root,simonpf/root,root-mirror/root,gganis/root,0x0all/ROOT,thomaskeck/root,karies/root,nilqed/root,zzxuanyuan/root,nilqed/root,strykejern/TTreeReader,mhuwiler/rootauto,jrtomps/root,abhinavmoudgil95/root,gganis/root,BerserkerTroll/root,satyarth934/root,omazapa/root,alexschlueter/cern-root,Duraznos/root,karies/root,perovic/root,Duraznos/root,0x0all/ROOT,sawenzel/root,esakellari/my_root_for_test,mkret2/root,beniz/root,jrtomps/root,georgtroska/root,vukasinmilosevic/root,buuck/root,CristinaCristescu/root,nilqed/root,beniz/root,pspe/root,buuck/root,evgeny-boger/root,root-mirror/root,sirinath/root,alexschlueter/cern-root,CristinaCristescu/root,sirinath/root,mattkretz/root,arch1tect0r/root,Duraznos/root,esakellari/root,davidlt/root,arch1tect0r/root,veprbl/root,arch1tect0r/root,olifre/root,root-mirror/root,tc3t/qoot,Duraznos/root,tc3t/qoot,pspe/root,omazapa/root-old,Dr15Jones/root,perovic/root,Y--/root,CristinaCristescu/root,dfunke/root,jrtomps/root,tc3t/qoot,omazapa/root,georgtroska/root,jrtomps/root,smarinac/root,sirinath/root,Duraznos/root,lgiommi/root,kirbyherm/root-r-tools,esakellari/root,karies/root,CristinaCristescu/root,strykejern/TTreeReader,cxx-hep/root-cern,arch1tect0r/root,veprbl/root,kirbyherm/root-r-tools,zzxuanyuan/root,lgiommi/root,BerserkerTroll/root,CristinaCristescu/root,nilqed/root,gganis/root,evgeny-boger/root,Dr15Jones/root,karies/root,gganis/root,nilqed/root,lgiommi/root,gganis/root,bbockelm/root,lgiommi/root,buuck/root,zzxuanyuan/root-compressor-dummy,vukasinmilosevic/root,root-mirror/root,Dr15Jones/root,mhuwiler/rootauto,nilqed/root,davidlt/root,veprbl/root,pspe/root,gbitzes/root,sirinath/root,esakellari/my_root_for_test,root-mirror/root,veprbl/root,lgiommi/root,agarciamontoro/root,sawenzel/root,0x0all/ROOT,CristinaCristescu/root,zzxuanyuan/root-compressor-dummy,perovic/root,mhuwiler/rootauto,Y--/root,sirinath/root,karies/root,krafczyk/root,mattkretz/root,thomaskeck/root,evgeny-boger/root,davidlt/root,jrtomps/root,vukasinmilosevic/root,krafczyk/root,esakellari/my_root_for_test,perovic/root,gbitzes/root,olifre/root,Dr15Jones/root,alexschlueter/cern-root,esakellari/my_root_for_test,beniz/root,mattkretz/root,karies/root,arch1tect0r/root,CristinaCristescu/root,simonpf/root,pspe/root,jrtomps/root,zzxuanyuan/root-compressor-dummy,mhuwiler/rootauto,alexschlueter/cern-root,vukasinmilosevic/root,bbockelm/root,mattkretz/root,omazapa/root-old,buuck/root,agarciamontoro/root,pspe/root,lgiommi/root,cxx-hep/root-cern,kirbyherm/root-r-tools,Y--/root,omazapa/root,gbitzes/root,jrtomps/root,mattkretz/root,gganis/root,arch1tect0r/root,dfunke/root,gbitzes/root,agarciamontoro/root,gbitzes/root,vukasinmilosevic/root,BerserkerTroll/root,cxx-hep/root-cern,beniz/root,Y--/root,jrtomps/root,gbitzes/root,zzxuanyuan/root,gbitzes/root,georgtroska/root,smarinac/root,CristinaCristescu/root,vukasinmilosevic/root,nilqed/root,sbinet/cxx-root,zzxuanyuan/root-compressor-dummy,vukasinmilosevic/root,mhuwiler/rootauto,bbockelm/root,tc3t/qoot,Y--/root,sbinet/cxx-root,alexschlueter/cern-root,omazapa/root,alexschlueter/cern-root,ffurano/root5,zzxuanyuan/root,thomaskeck/root,kirbyherm/root-r-tools,smarinac/root,sbinet/cxx-root,olifre/root,mkret2/root,omazapa/root-old,kirbyherm/root-r-tools,0x0all/ROOT,arch1tect0r/root,Duraznos/root,agarciamontoro/root,esakellari/my_root_for_test,esakellari/root,thomaskeck/root,omazapa/root-old,mhuwiler/rootauto,Y--/root,Duraznos/root,sawenzel/root,BerserkerTroll/root,abhinavmoudgil95/root,sawenzel/root,zzxuanyuan/root,zzxuanyuan/root-compressor-dummy,omazapa/root,omazapa/root,perovic/root,mkret2/root,root-mirror/root,satyarth934/root,sirinath/root,satyarth934/root,smarinac/root,buuck/root,sbinet/cxx-root,evgeny-boger/root,buuck/root,kirbyherm/root-r-tools,lgiommi/root,omazapa/root-old,tc3t/qoot,veprbl/root,cxx-hep/root-cern,root-mirror/root,georgtroska/root,CristinaCristescu/root,lgiommi/root,arch1tect0r/root,veprbl/root,smarinac/root,ffurano/root5,arch1tect0r/root,zzxuanyuan/root,Y--/root,simonpf/root,sbinet/cxx-root,simonpf/root,pspe/root,omazapa/root,mattkretz/root,ffurano/root5,davidlt/root,zzxuanyuan/root,olifre/root,sbinet/cxx-root,omazapa/root-old,abhinavmoudgil95/root,evgeny-boger/root,tc3t/qoot,mkret2/root,abhinavmoudgil95/root,beniz/root,0x0all/ROOT,georgtroska/root,veprbl/root,thomaskeck/root,buuck/root,BerserkerTroll/root,CristinaCristescu/root,BerserkerTroll/root,sawenzel/root,thomaskeck/root,sawenzel/root,arch1tect0r/root,zzxuanyuan/root-compressor-dummy,esakellari/my_root_for_test,thomaskeck/root,thomaskeck/root,buuck/root,sirinath/root,abhinavmoudgil95/root,vukasinmilosevic/root,BerserkerTroll/root,veprbl/root,bbockelm/root,georgtroska/root,agarciamontoro/root,olifre/root,gganis/root,bbockelm/root,omazapa/root-old,omazapa/root-old,esakellari/root,olifre/root,tc3t/qoot,esakellari/root,thomaskeck/root,0x0all/ROOT,abhinavmoudgil95/root,gganis/root,mkret2/root,Duraznos/root,perovic/root,krafczyk/root,ffurano/root5,simonpf/root,georgtroska/root,mhuwiler/rootauto,sbinet/cxx-root,root-mirror/root,georgtroska/root,perovic/root,davidlt/root,beniz/root,smarinac/root,beniz/root,esakellari/root,jrtomps/root,krafczyk/root,tc3t/qoot,karies/root,tc3t/qoot,dfunke/root,krafczyk/root,omazapa/root-old,mattkretz/root,agarciamontoro/root,agarciamontoro/root,beniz/root,zzxuanyuan/root-compressor-dummy,satyarth934/root,BerserkerTroll/root,0x0all/ROOT,mkret2/root,gbitzes/root,smarinac/root,simonpf/root,omazapa/root,gbitzes/root,mhuwiler/rootauto,smarinac/root,bbockelm/root,arch1tect0r/root,strykejern/TTreeReader,dfunke/root,abhinavmoudgil95/root,sawenzel/root,sawenzel/root,Dr15Jones/root,perovic/root,davidlt/root,dfunke/root,pspe/root,BerserkerTroll/root,gganis/root,georgtroska/root,gganis/root,mattkretz/root,BerserkerTroll/root,satyarth934/root,nilqed/root,olifre/root,esakellari/root,olifre/root,evgeny-boger/root,vukasinmilosevic/root,BerserkerTroll/root,krafczyk/root,esakellari/root,bbockelm/root,strykejern/TTreeReader,zzxuanyuan/root,sbinet/cxx-root,mattkretz/root,satyarth934/root,gganis/root,Dr15Jones/root,davidlt/root,satyarth934/root,mkret2/root,zzxuanyuan/root,omazapa/root-old,evgeny-boger/root,evgeny-boger/root,esakellari/my_root_for_test,evgeny-boger/root,zzxuanyuan/root,nilqed/root,zzxuanyuan/root-compressor-dummy,dfunke/root,satyarth934/root,mattkretz/root,dfunke/root,alexschlueter/cern-root,mattkretz/root,karies/root,strykejern/TTreeReader,krafczyk/root,mhuwiler/rootauto,veprbl/root,zzxuanyuan/root,olifre/root,bbockelm/root,tc3t/qoot,omazapa/root,mhuwiler/rootauto,root-mirror/root,smarinac/root,ffurano/root5,georgtroska/root,abhinavmoudgil95/root,bbockelm/root,strykejern/TTreeReader,pspe/root,esakellari/root,agarciamontoro/root,bbockelm/root,Duraznos/root,lgiommi/root,pspe/root,bbockelm/root,cxx-hep/root-cern,cxx-hep/root-cern,root-mirror/root,buuck/root,veprbl/root,mkret2/root,satyarth934/root,davidlt/root,mkret2/root
6cbb0e446c5e939612b8e3dfa3771165ca255074
list.h
list.h
#include <stdlib.h> #ifndef __LIST_H__ #define __LIST_H__ struct ListNode; struct List; typedef struct ListNode ListNode; typedef struct List List; List* List_Create(void); void List_Destroy(List* l); ListNode* ListNode_Create(void *); void ListNode_Destroy(ListNode* n); ListNode* List_Search(List* l, void* k, int (f)(void*, void*)); #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 *); void ListNode_Destroy(ListNode* n); ListNode* List_Search(List* l, void* k, int (f)(void*, void*)); void List_Insert(List* l, ListNode* n); #endif
Add List Insert function declaration
Add List Insert function declaration
C
mit
MaxLikelihood/CADT
e849a32bb0b490d77b7c42ccbd9d7508e16a0f00
include/fmrcxx/fmrcxx.h
include/fmrcxx/fmrcxx.h
#ifndef FMRCXX_FMRCXX_H_ #define FMRCXX_FMRCXX_H_ #include <fmrcxx/Iterator.h> #include <fmrcxx/Range.h> #include <fmrcxx/internal/StdMapIterator.h> #include <fmrcxx/internal/StdContainerIterator.h> namespace fmrcxx { template <typename T, template <typename...> class Container, typename... TTs> StdContainerIterator<T, typename Container<T, TTs...>::iterator> iterateOver(Container<T, TTs...>& container); template <typename T, template <typename... Others> class Container, typename... TTs> StdContainerIterator<T, typename Container<T>::iterator> reverseIterateOver(Container<T>& container); template <typename Key, typename Value, template <typename...> class MapContainer, typename... TTs> StdMapIterator<Key, Value, typename MapContainer<Key, Value, TTs...>::iterator> iterateOverMap(MapContainer<Key, Value, TTs...>& container); template <typename Key, typename Value, template <typename...> class MapContainer, typename... TTs> StdMapIterator<Key, Value, typename MapContainer<Key, Value, TTs...>::iterator> reverseIterateOverMap(MapContainer<Key, Value, TTs...>& container); } #include <fmrcxx/impl/fmrcxx.hpp> #endif
#ifndef FMRCXX_FMRCXX_H_ #define FMRCXX_FMRCXX_H_ #include <fmrcxx/Iterator.h> #include <fmrcxx/Range.h> #include <fmrcxx/Random.h> #include <fmrcxx/internal/StdMapIterator.h> #include <fmrcxx/internal/StdContainerIterator.h> namespace fmrcxx { template <typename T, template <typename...> class Container, typename... TTs> StdContainerIterator<T, typename Container<T, TTs...>::iterator> iterateOver(Container<T, TTs...>& container); template <typename T, template <typename... Others> class Container, typename... TTs> StdContainerIterator<T, typename Container<T>::iterator> reverseIterateOver(Container<T>& container); template <typename Key, typename Value, template <typename...> class MapContainer, typename... TTs> StdMapIterator<Key, Value, typename MapContainer<Key, Value, TTs...>::iterator> iterateOverMap(MapContainer<Key, Value, TTs...>& container); template <typename Key, typename Value, template <typename...> class MapContainer, typename... TTs> StdMapIterator<Key, Value, typename MapContainer<Key, Value, TTs...>::iterator> reverseIterateOverMap(MapContainer<Key, Value, TTs...>& container); } #include <fmrcxx/impl/fmrcxx.hpp> #endif
Add Random to general header
Add Random to general header
C
apache-2.0
cyr62110/fmrcxx
dbb3b7606ccb070aedf6771e8efa54a15c2e5426
src/condor_includes/condor_common.h
src/condor_includes/condor_common.h
#include "_condor_fix_types.h" #include "condor_fix_stdio.h" #include <stdlib.h> #include "condor_fix_unistd.h" #include "condor_fix_limits.h" #include <string.h> #include <ctype.h> #include <fcntl.h> #include <errno.h>
#include "_condor_fix_types.h" #include "condor_fix_stdio.h" #include <stdlib.h> #include "condor_fix_unistd.h" #include "condor_fix_limits.h" #include "condor_fix_string.h" #include <ctype.h> #include <fcntl.h> #include <errno.h>
Include condor_fix_string.h rather than just string.h
Include condor_fix_string.h rather than just string.h
C
apache-2.0
bbockelm/condor-network-accounting,neurodebian/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,djw8605/htcondor,htcondor/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,neurodebian/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,djw8605/condor,bbockelm/condor-network-accounting,htcondor/htcondor,neurodebian/htcondor,djw8605/condor,neurodebian/htcondor,clalancette/condor-dcloud,djw8605/condor,mambelli/osg-bosco-marco,djw8605/condor,djw8605/condor,clalancette/condor-dcloud,zhangzhehust/htcondor,djw8605/condor,bbockelm/condor-network-accounting,djw8605/htcondor,htcondor/htcondor,clalancette/condor-dcloud,zhangzhehust/htcondor,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,djw8605/htcondor,htcondor/htcondor,neurodebian/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,htcondor/htcondor,djw8605/htcondor,djw8605/condor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,djw8605/condor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,djw8605/htcondor,htcondor/htcondor,djw8605/htcondor,neurodebian/htcondor,djw8605/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,clalancette/condor-dcloud,neurodebian/htcondor
c805263f16973c011d9d8bf89da77024fc549d42
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 106 #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 107 #endif
Update Skia milestone to 107
Update Skia milestone to 107 Change-Id: I2e2b4917adaea52c9cabd92bce092d279210cb82 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/571236 Auto-Submit: Rakshit Sharma <[email protected]> Reviewed-by: Heather Miller <[email protected]> Commit-Queue: Heather Miller <[email protected]> Reviewed-by: Rakshit Sharma <[email protected]>
C
bsd-3-clause
google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia
02e0e8e72ad4f1e71483a8b6ab374ef8f47818a5
ExtendTypedef/ExtendFunctor.h
ExtendTypedef/ExtendFunctor.h
#ifndef __extendFunctor_ #define __extendFunctor_ template<class Functor, typename CSig, typename ESig> struct ExtendedFunctor : public Functor { public: typedef typename CSig::type ControlSignature; typedef typename ESig::type ExecutionSignature; }; #endif
Add new functor that inherits from base and has custom sigs.
Add new functor that inherits from base and has custom sigs.
C
bsd-2-clause
robertmaynard/Sandbox,robertmaynard/Sandbox,robertmaynard/Sandbox,robertmaynard/Sandbox
5f55407acaccc0e20efaa71ee3cbd247707397b0
src/robobo.h
src/robobo.h
#ifndef ROBOBO_H #define ROBOBO_H #include "main.h" #include <string.h> // C strings to handle args #include <sstream> #endif
#ifndef ROBOBO_H #define ROBOBO_H #include "main.h" #include "base.h" #include <string.h> // C strings to handle args #include <sstream> #endif
Include unincluded necessary header file.
Include unincluded necessary header file.
C
mit
ElementalAlchemist/RoBoBo,ElementalAlchemist/RoBoBo
7326541875f1df288b485711dda342fe09297e4e
PHPHub/Constants/APIConstant.h
PHPHub/Constants/APIConstant.h
// // APIConstant.h // PHPHub // // Created by Aufree on 9/30/15. // Copyright (c) 2015 ESTGroup. All rights reserved. // #define APIAccessTokenURL [NSString stringWithFormat:@"%@%@", APIBaseURL, @"/oauth/access_token"] #define QiniuUploadTokenIdentifier @"QiniuUploadTokenIdentifier" #if DEBUG #define APIBaseURL @"https://staging_api.phphub.org/v1" #else #define APIBaseURL @"https://api.phphub.org/v1" #endif #define PHPHubHost @"phphub.org" #define PHPHubUrl @"https://phphub.org/" #define GitHubURL @"https://github.com/" #define TwitterURL @"https://twitter.com/" #define ProjectURL @"https://github.com/aufree/phphub-ios" #define AboutPageURL @"https://phphub.org/about" #define ESTGroupURL @"http://est-group.org" #define AboutTheAuthorURL @"weibo.com/jinfali" #define PHPHubGuide @"http://7xnqwn.com1.z0.glb.clouddn.com/index.html" #define PHPHubTopicURL @"https://phphub.org/topics/" #define SinaRedirectURL @"http://sns.whalecloud.com/sina2/callback" #define UpdateNoticeCount @"UpdateNoticeCount"
// // APIConstant.h // PHPHub // // Created by Aufree on 9/30/15. // Copyright (c) 2015 ESTGroup. All rights reserved. // #define APIAccessTokenURL [NSString stringWithFormat:@"%@%@", APIBaseURL, @"/oauth/access_token"] #define QiniuUploadTokenIdentifier @"QiniuUploadTokenIdentifier" #if DEBUG #define APIBaseURL @"https://staging_api.phphub.org/v1" #else #define APIBaseURL @"https://api.phphub.org/v1" #endif #define PHPHubHost @"phphub.org" #define PHPHubUrl @"https://phphub.org/" #define GitHubURL @"https://github.com/" #define TwitterURL @"https://twitter.com/" #define ProjectURL @"https://github.com/aufree/phphub-ios" #define AboutPageURL @"https://phphub.org/about" #define ESTGroupURL @"http://est-group.org" #define AboutTheAuthorURL @"https://github.com/aufree" #define PHPHubGuide @"http://7xnqwn.com1.z0.glb.clouddn.com/index.html" #define PHPHubTopicURL @"https://phphub.org/topics/" #define SinaRedirectURL @"http://sns.whalecloud.com/sina2/callback" #define UpdateNoticeCount @"UpdateNoticeCount"
Change about the author url
Change about the author url
C
mit
Aufree/phphub-ios
53849e2086a253bca800b5f25153c3892a4f4db1
test/suite/bugs/ifpp.c
test/suite/bugs/ifpp.c
int f(int d) { int i = 0, j, k, l; if (d%2==0) if (d%3==0) i+=2; else i+=3; if (d%2==0) { if (d%3==0) i+=7; } else i+=11; l = d; if (d%2==0) while (l--) if (1) i+=13; else i+=17; l = d; if (d%2==0) { while (l--) if (1) i+=21; } else i+=23; if (d==0) i+=27; else if (d%2==0) if (d%3==0) i+=29; else if (d%5==0) if (d%7==0) i+=31; else i+=33; return i; } int main() { int i,k=0; for(i=0;i<255;i++) { k+=f(i); } printf("Result: %d\n",k); }
Add another test for pretty printing if-then-else
Add another test for pretty printing if-then-else Ignore-this: c0cab673ec9d716deb4154ae5599ed74 darcs-hash:512056f55df6186193f854d96821b4a589d19d04
C
bsd-3-clause
micknelso/language-c,micknelso/language-c,micknelso/language-c
a5f90d80a27a575b3fc428e38d2d179dad1c877b
Pod/Classes/Core/CLPUIObject.h
Pod/Classes/Core/CLPUIObject.h
#import "CLPBaseObject.h" @interface CLPUIObject : CLPBaseObject @property (nonatomic, readwrite) IBOutlet UIView *view; - (instancetype)remove; @end
#import "CLPBaseObject.h" @interface CLPUIObject : CLPBaseObject @property (nonatomic, strong, readwrite) IBOutlet UIView *view; - (instancetype)remove; @end
Set view property to strong for UIObjects.
Set view property to strong for UIObjects.
C
bsd-3-clause
barbosa/clappr-ios,clappr/clappr-ios,clappr/clappr-ios,clappr/clappr-ios,barbosa/clappr-ios
62f828c9bd51124a9a24362fbf6d2bc4a7971e75
src/domain/noterepository.h
src/domain/noterepository.h
/* This file is part of Zanshin Copyright 2014 Kevin Ottens <[email protected]> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DOMAIN_NOTEREPOSITORY_H #define DOMAIN_NOTEREPOSITORY_H #include "note.h" class KJob; namespace Domain { class NoteRepository { public: NoteRepository(); virtual ~NoteRepository(); virtual KJob *save(Note::Ptr note) = 0; virtual KJob *remove(Note::Ptr note) = 0; }; } #endif // DOMAIN_NOTEREPOSITORY_H
/* This file is part of Zanshin Copyright 2014 Kevin Ottens <[email protected]> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DOMAIN_NOTEREPOSITORY_H #define DOMAIN_NOTEREPOSITORY_H #include "datasource.h" #include "note.h" class KJob; namespace Domain { class NoteRepository { public: NoteRepository(); virtual ~NoteRepository(); virtual bool isDefaultSource(DataSource::Ptr source) const = 0; virtual void setDefaultSource(DataSource::Ptr source) = 0; virtual KJob *save(Note::Ptr note) = 0; virtual KJob *remove(Note::Ptr note) = 0; }; } #endif // DOMAIN_NOTEREPOSITORY_H
Add the default source concept to NoteRepository
Add the default source concept to NoteRepository
C
lgpl-2.1
sandsmark/zanshin,kolab-groupware/zanshin,sandsmark/zanshin,sandsmark/zanshin,kolab-groupware/zanshin,kolab-groupware/zanshin
b202cb277a68a78e431bdf0cdbf1dd5215a7055e
experiments.h
experiments.h
/* * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef WEBRTC_EXPERIMENTS_H_ #define WEBRTC_EXPERIMENTS_H_ #include "webrtc/typedefs.h" namespace webrtc { struct RemoteBitrateEstimatorMinRate { RemoteBitrateEstimatorMinRate() : min_rate(30000) {} RemoteBitrateEstimatorMinRate(uint32_t min_rate) : min_rate(min_rate) {} uint32_t min_rate; }; struct SkipEncodingUnusedStreams { SkipEncodingUnusedStreams() : enabled(false) {} explicit SkipEncodingUnusedStreams(bool set_enabled) : enabled(set_enabled) {} virtual ~SkipEncodingUnusedStreams() {} const bool enabled; }; struct AimdRemoteRateControl { AimdRemoteRateControl() : enabled(false) {} explicit AimdRemoteRateControl(bool set_enabled) : enabled(set_enabled) {} virtual ~AimdRemoteRateControl() {} const bool enabled; }; } // namespace webrtc #endif // WEBRTC_EXPERIMENTS_H_
/* * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef WEBRTC_EXPERIMENTS_H_ #define WEBRTC_EXPERIMENTS_H_ #include "webrtc/typedefs.h" namespace webrtc { struct RemoteBitrateEstimatorMinRate { RemoteBitrateEstimatorMinRate() : min_rate(30000) {} RemoteBitrateEstimatorMinRate(uint32_t min_rate) : min_rate(min_rate) {} uint32_t min_rate; }; struct AimdRemoteRateControl { AimdRemoteRateControl() : enabled(false) {} explicit AimdRemoteRateControl(bool set_enabled) : enabled(set_enabled) {} virtual ~AimdRemoteRateControl() {} const bool enabled; }; } // namespace webrtc #endif // WEBRTC_EXPERIMENTS_H_
Remove no longer used SkipEncodingUnusedStreams.
Remove no longer used SkipEncodingUnusedStreams. [email protected] Review URL: https://webrtc-codereview.appspot.com/18829004 git-svn-id: 03ae4fbe531b1eefc9d815f31e49022782c42458@6753 4adac7df-926f-26a2-2b94-8c16560cd09d
C
bsd-3-clause
jgcaaprom/android_external_chromium_org_third_party_webrtc,android-ia/platform_external_chromium_org_third_party_webrtc,android-ia/platform_external_chromium_org_third_party_webrtc,jgcaaprom/android_external_chromium_org_third_party_webrtc,MIPS/external-chromium_org-third_party-webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,MIPS/external-chromium_org-third_party-webrtc,android-ia/platform_external_chromium_org_third_party_webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,Omegaphora/external_chromium_org_third_party_webrtc,Omegaphora/external_chromium_org_third_party_webrtc,jgcaaprom/android_external_chromium_org_third_party_webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,Omegaphora/external_chromium_org_third_party_webrtc,Omegaphora/external_chromium_org_third_party_webrtc,Omegaphora/external_chromium_org_third_party_webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,Omegaphora/external_chromium_org_third_party_webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,Omegaphora/external_chromium_org_third_party_webrtc,MIPS/external-chromium_org-third_party-webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,jgcaaprom/android_external_chromium_org_third_party_webrtc,jgcaaprom/android_external_chromium_org_third_party_webrtc,MIPS/external-chromium_org-third_party-webrtc,android-ia/platform_external_chromium_org_third_party_webrtc,android-ia/platform_external_chromium_org_third_party_webrtc,MIPS/external-chromium_org-third_party-webrtc,jgcaaprom/android_external_chromium_org_third_party_webrtc,Omegaphora/external_chromium_org_third_party_webrtc,android-ia/platform_external_chromium_org_third_party_webrtc,MIPS/external-chromium_org-third_party-webrtc,MIPS/external-chromium_org-third_party-webrtc,android-ia/platform_external_chromium_org_third_party_webrtc,MIPS/external-chromium_org-third_party-webrtc,android-ia/platform_external_chromium_org_third_party_webrtc,jgcaaprom/android_external_chromium_org_third_party_webrtc,jgcaaprom/android_external_chromium_org_third_party_webrtc
452dbb09e2fd05a8f9fcfa300dd12ceefe9bf8ab
src/Update.h
src/Update.h
// Copyright (c) 2016-2020 The Karbowanec developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef UPDATE_H #define UPDATE_H #include <QObject> #include <QNetworkAccessManager> #include <QNetworkRequest> #include <QNetworkReply> #include <QUrl> const static QString KARBO_UPDATE_URL = "https://api.github.com/repos/Karbovanets/karbowanecwallet/tags"; const static QString KARBO_DOWNLOAD_URL = "https://github.com/Karbovanets/karbowanecwallet/releases/"; class Updater : public QObject { Q_OBJECT public: explicit Updater(QObject *parent = 0); ~Updater() { delete manager; } void checkForUpdate(); signals: public slots: void replyFinished (QNetworkReply *reply); private: QNetworkAccessManager *manager; }; #endif // UPDATE_H
// Copyright (c) 2016-2020 The Karbowanec developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef UPDATE_H #define UPDATE_H #include <QObject> #include <QNetworkAccessManager> #include <QNetworkRequest> #include <QNetworkReply> #include <QUrl> const static QString KARBO_UPDATE_URL = "https://api.github.com/repos/seredat/karbowanecwallet/tags"; const static QString KARBO_DOWNLOAD_URL = "https://github.com/seredat/karbowanecwallet/releases/"; class Updater : public QObject { Q_OBJECT public: explicit Updater(QObject *parent = 0); ~Updater() { delete manager; } void checkForUpdate(); signals: public slots: void replyFinished (QNetworkReply *reply); private: QNetworkAccessManager *manager; }; #endif // UPDATE_H
Change repository urls to proper for this version
Change repository urls to proper for this version
C
mit
seredat/karbowanecwallet,seredat/karbowanecwallet,seredat/karbowanecwallet
465934742bafb175501c12cc2b8ebfe9bd732e3b
src/common.c
src/common.c
#define BASE_SPEED_FULL 127 void base_set(int fr, int br, int bl, int fl); void base_set(int power); void dump_set(int x); void lift_set(int x); #define LCD_BUTTON_LEFT 1 #define LCD_BUTTON_CENTER 2 #define LCD_BUTTON_RIGHT 4 #define LCD_BUTTON_NONE 0 #define LCD_LINE_TOP 0 #define LCD_LINE_BOTTOM 1 void lcd_voltage(void); void lcd_clear(void);
#define BASE_SPEED_FULL 127 void base_set(int fr, int br, int bl, int fl); void base_set(int power); void dump_set(int x); void lift_set(int x); #define LCD_BUTTON_LEFT 1 #define LCD_BUTTON_CENTER 2 #define LCD_BUTTON_RIGHT 4 #define LCD_BUTTON_NONE 0 #define LCD_LINE_TOP 0 #define LCD_LINE_BOTTOM 1 void lcd_voltage(void); void lcd_clear(void); // Get rid of annoying "unreferenced function" warnings static void DO_NOT_CALL_THIS_FUNCTION(void) { DO_NOT_CALL_THIS_FUNCTION(); UserControlCodePlaceholderForTesting(); AutonomousCodePlaceholderForTesting(); }
Remove annoying "unreferenced function" warnings
Remove annoying "unreferenced function" warnings
C
mit
qsctr/vex-4194b-2016