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
|
---|---|---|---|---|---|---|---|---|---|
68772ba85b158325b82743a9df55d583cc547c48 | bpf/netdev_config.h | bpf/netdev_config.h | /* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2016-2020 Authors of Cilium */
/*
* This is just a dummy header with dummy values to allow for test
* compilation without the full code generation engine backend.
*/
#define DROP_NOTIFY
#ifndef SKIP_DEBUG
#define DEBUG
#endif
#define ENCAP_IFINDEX 1
#define SECLABEL 2
#define SECLABEL_NB 0xfffff
| /* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2016-2020 Authors of Cilium */
/*
* This is just a dummy header with dummy values to allow for test
* compilation without the full code generation engine backend.
*/
#define DROP_NOTIFY
#ifndef SKIP_DEBUG
#define DEBUG
#endif
#define ENCAP_IFINDEX 1
#define SECLABEL 2
#define SECLABEL_NB 0xfffff
#define CALLS_MAP test_cilium_calls_65535
| Replace CALLS_MAP symbol in compile-tested binaries | bpf: Replace CALLS_MAP symbol in compile-tested binaries
Because we don't define CALLS_MAP for several programs, the binaries end
up with 'CALLS_MAP' as the actual map name:
$ for f in $(ls bpf/*.o); do ( readelf -s $f | grep -q CALLS_MAP ) && echo $f; done
bpf/bpf_alignchecker.o
bpf/bpf_network.o
bpf/bpf_overlay.o
bpf/bpf_xdp.o
That can lead to warnings when trying to load the programs with
test/bpf/verifier-test.sh. This commit fixes it.
$ for f in $(ls bpf/*.o); do ( readelf -s $f | grep -q CALLS_MAP ) && echo $f; done
bpf/bpf_alignchecker.o
Signed-off-by: Paul Chaignon <[email protected]>
| C | apache-2.0 | cilium/cilium,michi-covalent/cilium,tgraf/cilium,tgraf/cilium,cilium/cilium,michi-covalent/cilium,tklauser/cilium,tgraf/cilium,michi-covalent/cilium,tklauser/cilium,cilium/cilium,tklauser/cilium,cilium/cilium,michi-covalent/cilium,tgraf/cilium,tgraf/cilium,tgraf/cilium,cilium/cilium,tklauser/cilium,michi-covalent/cilium,tklauser/cilium |
f7c7267e99a50ece23ff4db05e6fdb5aead0fdbe | test/cpp-raw/os.h | test/cpp-raw/os.h |
#define INTERCOM_FLATTEN_DECLARATIONS
#include <intercom.h>
#include "../../intercom-cpp/src/msdef.h"
// Interface definitions.
#ifdef _MSC_VER
#include "msvc/import.h"
#endif
// Platform specific runtime initialization.
void InitializeRuntime();
// Platform specific runtime uninitialization.
void UninitializeRuntime();
// Create Intercom object instance.
HRESULT CreateInstance( REFCLSID clsid, REFIID iid, void** pout );
// Create Intercom object instance.
template <class TInterface>
HRESULT CreateInstance( REFCLSID clsid, REFIID iid, TInterface** pout )
{
return CreateInstance( clsid, iid, reinterpret_cast< void** >( pout ) );
}
|
// Interface definitions.
#ifdef _MSC_VER
#include "msvc/import.h"
#else
// Include declarations on non-Windows platforms.
#define INTERCOM_FLATTEN_DECLARATIONS
#include <intercom.h>
#include "../../intercom-cpp/src/msdef.h"
#endif
// Platform specific runtime initialization.
void InitializeRuntime();
// Platform specific runtime uninitialization.
void UninitializeRuntime();
// Create Intercom object instance.
HRESULT CreateInstance( REFCLSID clsid, REFIID iid, void** pout );
// Create Intercom object instance.
template <class TInterface>
HRESULT CreateInstance( REFCLSID clsid, REFIID iid, TInterface** pout )
{
return CreateInstance( clsid, iid, reinterpret_cast< void** >( pout ) );
}
| Include specific declarations only on ńon-Windows platform | Include specific declarations only on ńon-Windows platform
The "intercom.h" is not currently visible on Windows build chain.
| C | mit | Rantanen/com-export-rs,Rantanen/com-export-rs,Rantanen/com-export-rs,Rantanen/com-export-rs |
a9f39225c5502b7d8948dc195292db80a5814834 | src/ent.c | src/ent.c | #include <ent/ent.h>
#if defined __OPENBSD__ || (defined __linux__ && defined _DEFAULT_SOURCE)
# include <unistd.h>
# define getentropy_impl getentropy
#elif defined __APPLE__ && defined __MACH__
# include <sys/random.h>
# define getentropy_impl getentropy
#else
# error "Port: getentropy unimplemented"
#endif
int
ent_getentropy(void *buf, size_t buflen)
{
return getentropy_impl(buf, buflen);
}
| #include <ent/ent.h>
#if defined __OPENBSD__ || (defined __linux__ && defined _DEFAULT_SOURCE)
# include <unistd.h>
# define getentropy_impl getentropy
#elif defined __APPLE__ && defined __MACH__
# include <unistd.h>
# include <sys/random.h>
# define getentropy_impl getentropy
#else
# error "Port: getentropy unimplemented"
#endif
int
ent_getentropy(void *buf, size_t buflen)
{
return getentropy_impl(buf, buflen);
}
| Fix build on OS X | Fix build on OS X
| C | mit | jfranklin9000/urbit,urbit/urbit,ngzax/urbit,ngzax/urbit,ngzax/urbit,jfranklin9000/urbit,urbit/urbit,urbit/urbit,jfranklin9000/urbit,urbit/urbit,ngzax/urbit,ngzax/urbit,jfranklin9000/urbit,jfranklin9000/urbit,urbit/urbit,urbit/urbit,jfranklin9000/urbit,ngzax/urbit,urbit/urbit,ngzax/urbit,jfranklin9000/urbit |
facd3c72a46b2a62ec347a1527583abc2bd529ab | block.h | block.h | #ifndef BLOCK_PAGE_SIZE
# define BLOCK_PAGE_SIZE 65536
#endif
#include <stddef.h>
struct block {
void **pages;
size_t *offsets;
size_t count;
size_t size;
};
struct block *block_new(void);
void block_free(struct block*);
void *block_alloc(struct block*, size_t bytes);
| #ifndef BLOCK_PAGE_SIZE
# define BLOCK_PAGE_SIZE 4096
#endif
#include <stddef.h>
struct block {
void **pages;
size_t *offsets;
size_t count;
size_t size;
};
struct block *block_new(void);
void block_free(struct block*);
void *block_alloc(struct block*, size_t bytes);
| Use 4KB as the default page size | Use 4KB as the default page size
| C | mit | chriso/intern |
3879da46920abe21c07fa073a31713086c898a7d | source/examples/demo_buffer_fifo.c | source/examples/demo_buffer_fifo.c | //============================================================================//
// File: demo_buffer_fifo.c //
// Description: Example for CANpie FIFO configuration //
// //
// Copyright (C) MicroControl GmbH & Co. KG //
// 53844 Troisdorf - Germany //
// www.microcontrol.net //
// //
//----------------------------------------------------------------------------//
// 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, the following disclaimer and //
// the referenced file 'LICENSE'. //
// 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 of MicroControl nor the names of its contributors //
// may be used to endorse or promote products derived from this software //
// without specific prior written permission. //
// //
// Provided that this notice is retained in full, this software may be //
// distributed under the terms of the GNU Lesser General Public License //
// ("LGPL") version 3 as distributed in the 'LICENSE' file. //
// //
//============================================================================//
#include "cp_core.h"
#include "cp_msg.h"
#define FIFO_RCV_SIZE 32
static CpFifo_ts tsFifoRcvS;
static CpCanMsg_ts atsCanMsgRcvS[FIFO_RCV_SIZE];
//----------------------------------------------------------------------------//
// DemoFifoConfig() //
// //
//----------------------------------------------------------------------------//
void DemoFifoConfig(CpPort_ts * ptsCanPortV)
{
//------------------------------------------------------
// set message buffer 2 as receive buffer for classic
// CAN frame with identifier 180h .. 18Fh
//
CpCoreBufferConfig(ptsCanPortV, eCP_BUFFER_2,
(uint32_t) 0x180,
(uint32_t) 0x7F0, // mask
CP_MSG_FORMAT_CBFF,
eCP_BUFFER_DIR_RCV);
CpFifoInit(&tsFifoRcvS, &atsCanMsgRcvS[0], FIFO_RCV_SIZE);
CpCoreFifoConfig(ptsCanPortV, eCP_BUFFER_2, &tsFifoRcvS);
}
//----------------------------------------------------------------------------//
// DemoFifoRead() //
// //
//----------------------------------------------------------------------------//
void DemoFifoRead(CpPort_ts * ptsCanPortV)
{
CpCanMsg_ts tsCanMsgReadT;
uint32_t ulMsgCntT;
//------------------------------------------------------
// try to read one CAN message
//
ulMsgCntT = 1;
CpCoreFifoRead(ptsCanPortV, eCP_BUFFER_2,
&tsCanMsgReadT,
&ulMsgCntT);
}
| Add example code for FIFO | Add example code for FIFO | C | apache-2.0 | JoTid/CANpie,canpie/CANpie,canpie/CANpie,JoTid/CANpie,canpie/CANpie,JoTid/CANpie |
|
70143e0f9e65543b4fef71a67bacc53ae25f57e2 | SouqTask/Application/SouqTask-Bridging-Header.h | SouqTask/Application/SouqTask-Bridging-Header.h | //
// SouqTask-Bridging-Header.h
// SouqTask
//
// Created by Ma'moun Diraneyya on 3/4/16.
// Copyright © 2016 Mamouneyya. All rights reserved.
//
// NOTE This workaround is used to import important libraries everywhere in the app
// REF http://stackoverflow.com/questions/26408612/implicitly-import-specific-swift-module
//
@import Alamofire;
@import AlamofireImage;
@import ObjectMapper;
@import SwiftyUserDefaults;
| Create a bridging header so we can import important libraries implicitly. | Create a bridging header so we can import important libraries implicitly.
| C | mit | mamouneyya/TheSkillsProof,mamouneyya/TheSkillsProof |
|
ce976a1d0bfd1679fd9eef466f993216e88dc7e5 | ann.c | ann.c | #include <stdio.h>
#define INPUTS 3
#define HIDDEN 5
#define OUTPUTS 2
#define ROWS 5
typedef struct {
double input[HIDDEN][INPUTS];
double hidden[ROWS - 3][HIDDEN][HIDDEN];
double output[OUTPUTS][HIDDEN];
} Links;
typedef struct {
int input[INPUTS];
int hidden[HIDDEN];
int output[OUTPUTS];
} Neurons;
typedef struct {
Links weights;
Neurons values;
} ANN;
int main(void)
{
return 0;
}
| #include <stdio.h>
#define INPUTS 3
#define HIDDEN 5
#define OUTPUTS 2
#define ROWS 5
typedef struct {
double input[HIDDEN][INPUTS];
double hidden[ROWS - 3][HIDDEN][HIDDEN];
double output[OUTPUTS][HIDDEN];
} Links;
typedef struct {
int input[INPUTS];
int hidden[ROWS - 3][HIDDEN];
int output[OUTPUTS];
} Neurons;
typedef struct {
Links weights;
Neurons values;
} ANN;
int main(void)
{
return 0;
}
| Fix Neurons struct so that hidden is 2D | Fix Neurons struct so that hidden is 2D
| C | mit | tysonzero/c-ann |
169dc7b8de2f347edb54ce9007cfbf1c551be33a | Settings/Display.h | Settings/Display.h | #pragma once
#include "Tab.h"
class Display : public Tab {
public:
virtual void SaveSettings();
private:
virtual DLGPROC Command(unsigned short nCode, unsigned short ctrlId);
virtual DLGPROC Notification(NMHDR *nHdr);
virtual void Initialize();
virtual void LoadSettings();
void OnPositionChanged();
void OnCustomCheckChanged();
void OnAnimationChanged();
private:
/* Controls: */
Checkbox _onTop;
Checkbox _hideFullscreen;
ComboBox _position;
Label _customX;
EditBox _positionX;
Label _customY;
EditBox _positionY;
Checkbox _customDistance;
Spinner _edgeSpinner;
Label _displayDevLabel;
ComboBox _displayDevice;
ComboBox _animation;
Label _hideDelayLabel;
Spinner _hideDelay;
Label _hideSpeedLabel;
Spinner _hideSpeed;
private:
/* Constants: */
const int MIN_EDGE = -65535;
const int MAX_EDGE = 65535;
const int MIN_MS = USER_TIMER_MINIMUM;
const int MAX_MS = 60000;
}; | #pragma once
#include "Tab.h"
class Display : public Tab {
public:
virtual void SaveSettings();
private:
virtual DLGPROC Command(unsigned short nCode, unsigned short ctrlId);
virtual DLGPROC Notification(NMHDR *nHdr);
virtual void Initialize();
virtual void LoadSettings();
void OnPositionChanged();
void OnCustomCheckChanged();
void OnAnimationChanged();
private:
/* Controls: */
Checkbox _onTop;
Checkbox _hideFullscreen;
ComboBox _position;
Label _customX;
EditBox _positionX;
Label _customY;
EditBox _positionY;
Checkbox _customDistance;
Spinner _edgeSpinner;
Label _displayDevLabel;
ComboBox _displayDevice;
ComboBox _animation;
Label _hideDelayLabel;
Spinner _hideDelay;
Label _hideSpeedLabel;
Spinner _hideSpeed;
private:
/* Strings: */
std::wstring primaryMonitorStr = L"Primary Monitor";
std::wstring allMonitorStr = L"All Monitors";
std::wstring customPositionStr = L"Custom";
std::wstring noAnimStr = L"None";
private:
/* Constants: */
const int MIN_EDGE = -65535;
const int MAX_EDGE = 65535;
const int MIN_MS = USER_TIMER_MINIMUM;
const int MAX_MS = 60000;
}; | Add strings (will be used for translation) | Add strings (will be used for translation)
| C | bsd-2-clause | Soulflare3/3RVX,malensek/3RVX,malensek/3RVX,malensek/3RVX,Soulflare3/3RVX,Soulflare3/3RVX |
280ced6bd1aebd62b1288b3b55f70fe1d00e3b2f | 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 94
#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 95
#endif
| Update Skia milestone to 95 | Update Skia milestone to 95
Change-Id: I17a6adf5f14cfc160c13a2341453e9767ab39f0a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439158
Reviewed-by: Eric Boren <[email protected]>
| C | bsd-3-clause | aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia |
673ab60ceb8dbb42bebd52241178741a57f5f7a0 | main.c | main.c | int main() {
printf("Hello World!\n");
return 0;
}
| #include <bwio.h>
int main() {
bwsetfifo(COM2, OFF);
bwprintf(COM2, "Hello World!\n");
return 0;
}
| Add Makefile, bwio lib, headers and compile script | Add Makefile, bwio lib, headers and compile script
| C | mit | gregwym/ARM-Micro-Kernel,gregwym/ARM-Micro-Kernel,gregwym/ARM-Micro-Kernel |
204927c50f6ca2549092e422fe5377ae3aae1b63 | Files/VelibModel.h | Files/VelibModel.h | //
// Velib.h
// Bicyclette
//
// Created by Nicolas on 09/10/10.
// Copyright 2010 Nicolas Bouilleaud. All rights reserved.
//
#import "CoreDataManager.h"
#import <MapKit/MapKit.h>
#define kVelibStationsListURL @"http://www.velib.paris.fr/service/carto"
#define kVelibStationsStatusURL @"http://www.velib.paris.fr/service/stationdetails/"
/****************************************************************************/
#pragma mark -
@class Station;
@class DataUpdater;
@interface VelibModel : CoreDataManager
@property (nonatomic, retain, readonly) DataUpdater * updater;
@property (readonly) BOOL updatingXML;
@property (readonly, nonatomic) MKCoordinateRegion regionContainingData;
@property (readonly, nonatomic, retain) CLRegion * hardcodedLimits;
@end
// reverse link to obtain the CoreDataManager from a moc, for example in the objects implementation.
@interface NSManagedObjectContext (AssociatedModel)
@property (nonatomic, retain, readonly) VelibModel * model;
@end | //
// Velib.h
// Bicyclette
//
// Created by Nicolas on 09/10/10.
// Copyright 2010 Nicolas Bouilleaud. All rights reserved.
//
#import "CoreDataManager.h"
#import <MapKit/MapKit.h>
#define kVelibStationsListURL @"http://www.velib.paris.fr/service/carto"
#define kVelibStationsStatusURL @"http://www.velib.paris.fr/service/stationdetails/paris/"
/****************************************************************************/
#pragma mark -
@class Station;
@class DataUpdater;
@interface VelibModel : CoreDataManager
@property (nonatomic, retain, readonly) DataUpdater * updater;
@property (readonly) BOOL updatingXML;
@property (readonly, nonatomic) MKCoordinateRegion regionContainingData;
@property (readonly, nonatomic, retain) CLRegion * hardcodedLimits;
@end
// reverse link to obtain the CoreDataManager from a moc, for example in the objects implementation.
@interface NSManagedObjectContext (AssociatedModel)
@property (nonatomic, retain, readonly) VelibModel * model;
@end | Fix stations details request url (webservices were updated) | Fix stations details request url (webservices were updated)
| C | bsd-2-clause | durvalrafael/Bicyclette,n-b/Bicyclette,durvalrafael/Bicyclette,n-b/Bicyclette |
265bbe4f8fed33baff0f6340ac0f36965b2f24ed | src/gba/renderers/video-software.h | src/gba/renderers/video-software.h | #ifndef VIDEO_SOFTWARE_H
#define VIDEO_SOFTWARE_H
#include "gba-video.h"
#include <pthread.h>
struct GBAVideoSoftwareRenderer {
struct GBAVideoRenderer d;
uint16_t* outputBuffer;
unsigned outputBufferStride;
union GBARegisterDISPCNT dispcnt;
pthread_mutex_t mutex;
pthread_cond_t cond;
};
void GBAVideoSoftwareRendererCreate(struct GBAVideoSoftwareRenderer* renderer);
#endif
| #ifndef VIDEO_SOFTWARE_H
#define VIDEO_SOFTWARE_H
#include "gba-video.h"
#include <pthread.h>
struct GBAVideoSoftwareBackground {
int index;
int enabled;
int priority;
uint32_t charBase;
int mosaic;
int multipalette;
uint32_t screenBase;
int overflow;
int size;
uint16_t x;
uint16_t y;
uint32_t refx;
uint32_t refy;
uint16_t dx;
uint16_t dmx;
uint16_t dy;
uint16_t dmy;
uint32_t sx;
uint32_t sy;
};
struct GBAVideoSoftwareRenderer {
struct GBAVideoRenderer d;
uint16_t* outputBuffer;
unsigned outputBufferStride;
union GBARegisterDISPCNT dispcnt;
struct GBAVideoSoftwareBackground bg[4];
pthread_mutex_t mutex;
pthread_cond_t cond;
};
void GBAVideoSoftwareRendererCreate(struct GBAVideoSoftwareRenderer* renderer);
#endif
| Add struct for keeping track of background state | Add struct for keeping track of background state
| C | mpl-2.0 | Anty-Lemon/mgba,sergiobenrocha2/mgba,mgba-emu/mgba,Iniquitatis/mgba,Touched/mgba,askotx/mgba,Anty-Lemon/mgba,Iniquitatis/mgba,fr500/mgba,libretro/mgba,jeremyherbert/mgba,askotx/mgba,askotx/mgba,fr500/mgba,AdmiralCurtiss/mgba,fr500/mgba,matthewbauer/mgba,Anty-Lemon/mgba,bentley/mgba,sergiobenrocha2/mgba,mgba-emu/mgba,mgba-emu/mgba,jeremyherbert/mgba,libretro/mgba,cassos/mgba,cassos/mgba,sergiobenrocha2/mgba,iracigt/mgba,zerofalcon/mgba,iracigt/mgba,Touched/mgba,libretro/mgba,jeremyherbert/mgba,nattthebear/mgba,MerryMage/mgba,iracigt/mgba,zerofalcon/mgba,fr500/mgba,sergiobenrocha2/mgba,matthewbauer/mgba,askotx/mgba,MerryMage/mgba,AdmiralCurtiss/mgba,libretro/mgba,cassos/mgba,iracigt/mgba,jeremyherbert/mgba,MerryMage/mgba,bentley/mgba,libretro/mgba,AdmiralCurtiss/mgba,nattthebear/mgba,Iniquitatis/mgba,Anty-Lemon/mgba,mgba-emu/mgba,Touched/mgba,sergiobenrocha2/mgba,Iniquitatis/mgba,zerofalcon/mgba |
7558b9540b6c51b9822c63bbbdf42da282b1a7c1 | src/include/cynara-creds-commons.h | src/include/cynara-creds-commons.h | /*
* Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/
/*
* @file cynara-creds-commons.h
* @author Lukasz Wojciechowski <[email protected]>
* @version 1.0
* @brief This file contains common APIs for Cynara credentials helper.
*/
#ifndef CYNARA_CREDS_COMMONS_H
#define CYNARA_CREDS_COMMONS_H
#ifdef __cplusplus
extern "C" {
#endif
/* empty initial file */
#ifdef __cplusplus
}
#endif
#endif /* CYNARA_CREDS_COMMONS_H */
| /*
* Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/
/*
* @file cynara-creds-commons.h
* @author Lukasz Wojciechowski <[email protected]>
* @author Radoslaw Bartosiak <[email protected]>
* @author Aleksander Zdyb <[email protected]>
* @version 1.0
* @brief This file contains common APIs for Cynara credentials helper.
*/
#ifndef CYNARA_CREDS_COMMONS_H
#define CYNARA_CREDS_COMMONS_H
enum cynara_client_creds {
CLIENT_METHOD_SMACK,
CLIENT_METHOD_PID
};
enum cynara_user_creds {
USER_METHOD_UID,
USER_METHOD_GID
};
#ifdef __cplusplus
extern "C" {
#endif
/* empty initial file */
#ifdef __cplusplus
}
#endif
#endif /* CYNARA_CREDS_COMMONS_H */
| Add enums for credentials acquire methods | Add enums for credentials acquire methods
Change-Id: I5719a7622a78ae6d1ca86a7dcce986c69abb3e23
| C | apache-2.0 | Samsung/cynara,Samsung/cynara,pohly/cynara,pohly/cynara,pohly/cynara,Samsung/cynara |
9c48a952435797ead8239b7e0c9d5eeda1d7f999 | lib/libmid/errstr.c | lib/libmid/errstr.c | #include "../../include/mid.h"
#include <SDL/SDL_error.h>
#include <stdarg.h>
#include <errno.h>
#include <string.h>
enum { Bufsz = 1024 };
static char curerr[Bufsz + 1];
void seterrstr(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vsnprintf(curerr, Bufsz + 1, fmt, ap);
va_end(ap);
}
const char *miderrstr(void){
int err = errno;
if (curerr[0] != '\0') {
static char retbuf[Bufsz + 1];
strncpy(retbuf, curerr, Bufsz);
retbuf[Bufsz] = '\0';
curerr[0] = '\0';
return retbuf;
}
const char *e = SDL_GetError();
if(e[0] != '\0')
return e;
return strerror(err);
}
| #include "../../include/mid.h"
#include <SDL/SDL_error.h>
#include <stdarg.h>
#include <errno.h>
#include <string.h>
enum { Bufsz = 1024 };
static char curerr[Bufsz];
void seterrstr(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vsnprintf(curerr, Bufsz, fmt, ap);
va_end(ap);
}
const char *miderrstr(void){
int err = errno;
if (curerr[0] != '\0') {
static char retbuf[Bufsz];
strncpy(retbuf, curerr, Bufsz - 1);
retbuf[Bufsz - 1] = '\0';
curerr[0] = '\0';
return retbuf;
}
const char *e = SDL_GetError();
if(e[0] != '\0')
return e;
return strerror(err);
}
| Change buffer sizes to ease stk5. | Change buffer sizes to ease stk5.
| C | mit | velour/mid,velour/mid,velour/mid |
c083b0c24035620ec14db062fff8e62bd689c237 | test/Driver/compilation_database.c | test/Driver/compilation_database.c | // RUN: %clang -MD -MP -c -x c %s -xc++ %s -Wall -MJ - 2>&1 | FileCheck %s
// RUN: not %clang -c -x c %s -MJ %s/non-existant 2>&1 | FileCheck --check-prefix=ERROR %s
// CHECK: { "directory": "[[CWD:[^"]+]]", "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc", "[[SRC]]", "-c", "-Wall", "--target={{[^"]+}}"]},
// CHECK: { "directory": "[[CWD:[^"]+]]", "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc++", "[[SRC]]", "-c", "-Wall", "--target={{[^"]+}}"]},
// ERROR: error: compilation database '{{.*}}/non-existant' could not be opened:
int main(void) {
return 0;
}
| // RUN: %clang -MD -MP --sysroot=somewhere -c -x c %s -xc++ %s -Wall -MJ - 2>&1 | FileCheck %s
// RUN: not %clang -c -x c %s -MJ %s/non-existant 2>&1 | FileCheck --check-prefix=ERROR %s
// CHECK: { "directory": "[[CWD:[^"]+]]", "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc", "[[SRC]]", "--sysroot=somewhere", "-c", "-Wall", "--target={{[^"]+}}"]},
// CHECK: { "directory": "[[CWD:[^"]+]]", "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc++", "[[SRC]]", "--sysroot=somewhere", "-c", "-Wall", "--target={{[^"]+}}"]},
// ERROR: error: compilation database '{{.*}}/non-existant' could not be opened:
int main(void) {
return 0;
}
| Make test case slightly more robust by explicitly passing --sysroot. Otherwise it would change when DEFAULT_SYSROOT is provided. | Make test case slightly more robust by explicitly passing --sysroot.
Otherwise it would change when DEFAULT_SYSROOT is provided.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@288823 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang |
79ecdd107f7531d36f69d6e7089b4a685a370312 | src/graphics_tb.h | src/graphics_tb.h | #ifndef __GRAPHICS_TB_H__
#define __GRAPHICS_TB_H__
#include <termbox.h>
#include "models.h"
#include "graphics.h"
typedef struct {} graphics_tb_t;
// graphics_tb initialize the graphic module.
graphics_tb_t *graphics_tb_init();
// graphics_tb_draw draws the given state on the screen.
void graphics_tb_draw(void *context, state_to_draw_t *state);
// graphics_tb_quit terminate the graphic module.
void graphics_tb_quit(graphics_tb_t *tg);
#endif
| #ifndef __GRAPHICS_TB_H__
#define __GRAPHICS_TB_H__
#include <termbox.h>
#include "models.h"
#include "graphics.h"
typedef struct {} graphics_tb_t;
// graphics_tb initializes the graphic module.
graphics_tb_t *graphics_tb_init();
// graphics_tb_draw draws the given state on the screen.
//
// We do not use `graphics_tb_t *tg` but `void *context` because this function
// is used as a callback and the caller shouldn't have to know about
// graphics_tb. This way, this module is pluggable.
void graphics_tb_draw(void *context, state_to_draw_t *state);
// graphics_tb_quit terminates the graphic module.
void graphics_tb_quit(graphics_tb_t *tg);
#endif
| Add an explanation for graphics_*_draw prototype | Add an explanation for graphics_*_draw prototype
| C | mit | moverest/bagh-chal,moverest/bagh-chal,moverest/bagh-chal |
d1e345a13ca28825b672aa8e75e9f5d0f48be1bd | overseer.c | overseer.c | // vim: sw=4 ts=4 et filetype=c
#include <stdio.h>
#include <stdlib.h>
#include "overseer.h"
#include "iface_lcd.h"
#include "iface_uart.h"
#include "iface_w1_gpio.h"
int main()
{
sensor_t *sensor_array = malloc(SENSOR_ARRAY_LENGTH * sizeof(*sensor_array));
size_t actualsize = getSensorList(sensor_array);
char outbuf[16];
(void)uartInit();
lcdClear();
int i = 0;
for (i = 0; i < (int)actualsize; i++)
{
printf("Sensor %d (%s) = %g degrees C\n",
i, sensor_array[i].filename, sensor_array[i].reading);
snprintf(outbuf, 16, "s%d = %3.1f", i, sensor_array[i].reading);
lcdWrite(outbuf);
}
return 0;
}
| // vim: sw=4 ts=4 et filetype=c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "overseer.h"
#include "iface_lcd.h"
#include "iface_uart.h"
#include "iface_w1_gpio.h"
int main()
{
sensor_t *sensor_array = malloc(SENSOR_ARRAY_LENGTH * sizeof(*sensor_array));
size_t actualsize = getSensorList(sensor_array);
char outbuf[16];
int i = 0;
time_t t;
struct tm *tmp;
// Initialize the display
(void)uartInit();
lcdClear();
// Produce a hunk of output for munin
for (i = 0; i < (int)actualsize; i++)
{
printf("sensor_%s.value %g\n",
sensor_array[i].filename, sensor_array[i].reading);
}
// Output the current time to the display
t = time(NULL);
tmp = localtime(&t);
if (tmp == NULL)
{
snprintf(outbuf, 16, "Time: NULL");
}
else if (strftime(outbuf, 16, "%a %H:%M", tmp) == 0)
{
snprintf(outbuf, 16, "Time: INVALID");
}
lcdWrite(outbuf);
// Output two temperatures to the display
if((int)actualsize > 1)
{
snprintf(outbuf, 16, "0=%3.1f 1=%3.1f",
sensor_array[0].reading, sensor_array[1].reading);
}
else if((int)actualsize > 0)
{
snprintf(outbuf, 16, "Temp: %3.1f", sensor_array[0].reading);
}
else
{
snprintf(outbuf, 16, "NO DATA");
}
lcdWrite(outbuf);
return 0;
}
| Adjust output to LCD and console | Adjust output to LCD and console
Better kitchen usefulness w/ a timestamp.
Also munin support!
| C | mit | rtucker/raspi-fridge-overseer,rtucker/raspi-fridge-overseer |
228304d144861aa3e13384835aea7dc51fae140f | include/lldb/Host/freebsd/HostInfoFreeBSD.h | include/lldb/Host/freebsd/HostInfoFreeBSD.h | //===-- HostInfoFreeBSD.h ---------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef lldb_Host_freebsd_HostInfoFreeBSD_h_
#define lldb_Host_freebsd_HostInfoFreeBSD_h_
#include "lldb/Host/posix/HostInfoPosix.h"
namespace lldb_private
{
class HostInfoFreeBSD : public HostInfoPosix
{
public:
bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
bool GetOSBuildString(std::string &s);
bool GetOSKernelDescription(std::string &s);
};
}
#endif
| //===-- HostInfoFreeBSD.h ---------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef lldb_Host_freebsd_HostInfoFreeBSD_h_
#define lldb_Host_freebsd_HostInfoFreeBSD_h_
#include "lldb/Host/posix/HostInfoPosix.h"
namespace lldb_private
{
class HostInfoFreeBSD : public HostInfoPosix
{
public:
static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
static bool GetOSBuildString(std::string &s);
static bool GetOSKernelDescription(std::string &s);
};
}
#endif
| Fix FreeBSD build after r215992 | Fix FreeBSD build after r215992
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@216021 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb |
2044a19198c1a178b0994ece8db9286099586ed4 | text_widget.c | text_widget.c | // Copyright 2017, Jeffrey E. Bedard
#include "text_widget.h"
#include "XSTextWidget.h"
#include "font.h"
#include "xdata.h"
short xstatus_draw_text_widget(struct XSTextWidget * widget)
{
xcb_connection_t * xc = widget->connection;
struct JBDim font_size = xstatus_get_font_size();
xcb_image_text_8(xc, widget->buffer_size, xstatus_get_window(xc),
xstatus_get_gc(xc), widget->offset, font_size.height,
widget->buffer);
return widget->offset + font_size.width * widget->buffer_size;
}
| // Copyright 2017, Jeffrey E. Bedard
#include "text_widget.h"
#include "XSTextWidget.h"
#include "config.h"
#include "font.h"
#include "xdata.h"
short xstatus_draw_text_widget(struct XSTextWidget * widget)
{
xcb_connection_t * xc = widget->connection;
struct JBDim font_size = xstatus_get_font_size();
xcb_image_text_8(xc, widget->buffer_size, xstatus_get_window(xc),
xstatus_get_gc(xc), widget->offset, font_size.height,
widget->buffer);
return widget->offset + font_size.width * widget->buffer_size
+ XSTATUS_CONST_PAD;
}
| Include configured padding in offset calculation. | Include configured padding in offset calculation.
| C | mit | jefbed/xstatus,jefbed/xstatus,jefbed/xstatus,jefbed/xstatus |
324243f6bb70687aeaeb2419193a335648c5869d | thrust/detail/config/cpp_dialect.h | thrust/detail/config/cpp_dialect.h | /*
* Copyright 2018 NVIDIA Corporation
*
* 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.
*/
#pragma once
#ifdef _MSC_VER
#define THRUST_CPP_VER _MSVC_LANG
#else
#define THRUST_CPP_VER __cplusplus
#endif
#if THRUST_CPP_VER < 201103L
#define THRUST_CPP03
#define THRUST_CPP_DIALECT 2003
#elif THRUST_CPP_VER < 201402L
#define THRUST_CPP11
#define THRUST_CPP_DIALECT 2011
#elif THRUST_CPP_VER < 201703L
#define THRUST_CPP14
#define THRUST_CPP_DIALECT 2014
#else
#define THRUST_CPP17
#define THRUST_CPP_DIALECT 2017
#endif
#undef THRUST_CPP_VER
| /*
* Copyright 2018 NVIDIA Corporation
*
* 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.
*/
#pragma once
#if __cplusplus < 201103L
#define THRUST_CPP03
#define THRUST_CPP_DIALECT 2003
#elif __cplusplus < 201402L
#define THRUST_CPP11
#define THRUST_CPP_DIALECT 2011
#elif __cplusplus < 201703L
#define THRUST_CPP14
#define THRUST_CPP_DIALECT 2014
#else
#define THRUST_CPP17
#define THRUST_CPP_DIALECT 2017
#endif
| Revert "Handle MSVC's definition of __cplusplus" | Revert "Handle MSVC's definition of __cplusplus"
This reverts commit 20e1c433e05c7147af5c267e0e0a38a781a6efb4.
| C | apache-2.0 | thrust/thrust,jaredhoberock/thrust,jaredhoberock/thrust,jaredhoberock/thrust,jaredhoberock/thrust,thrust/thrust,andrewcorrigan/thrust-multi-permutation-iterator,andrewcorrigan/thrust-multi-permutation-iterator,thrust/thrust,thrust/thrust,thrust/thrust,andrewcorrigan/thrust-multi-permutation-iterator,jaredhoberock/thrust |
2766579a314f92c3fdf3f87e7bb20e5a4e52c01b | JPetUnpacker/Unpacker2/TDCChannel.h | JPetUnpacker/Unpacker2/TDCChannel.h | #ifndef TDCChannel_h
#define TDCChannel_h
#include <fstream>
#include <TObject.h>
#include <TClonesArray.h>
#include <iostream>
#define MAX_FULL_HITS 100
class TDCChannel : public TObject {
protected:
Int_t channel;
double leadTime1;
double trailTime1;
double tot1;
double referenceDiff1;
double leadTimes[MAX_FULL_HITS];
double trailTimes[MAX_FULL_HITS];
double tots[MAX_FULL_HITS];
double referenceDiffs[MAX_FULL_HITS];
int hitsNum;
public:
TDCChannel();
~TDCChannel();
void SetChannel(Int_t channel) { this->channel = channel; }
int GetChannel() { return channel; }
int GetHitsNum() { return hitsNum; }
void AddHit(double lead, double trail, double ref);
void AddHit(double lead, double trail);
double GetLeadTime1() { return leadTime1; }
double GetLeadTime(int mult) { return leadTimes[mult]; }
double GetTrailTime1() { return trailTime1; }
double GetTrailTime(int mult) { return trailTimes[mult]; }
double GetTOT1() { return tot1; }
int GetMult() { return hitsNum; }
double GetTOT(int mult) { return tots[mult]; }
ClassDef(TDCChannel,1);
};
#endif
| #ifndef TDCChannel_h
#define TDCChannel_h
#include <fstream>
#include <TObject.h>
#include <TClonesArray.h>
#include <iostream>
#define MAX_FULL_HITS 50
class TDCChannel : public TObject {
protected:
Int_t channel;
double leadTime1;
double trailTime1;
double tot1;
double referenceDiff1;
double leadTimes[MAX_FULL_HITS];
double trailTimes[MAX_FULL_HITS];
double tots[MAX_FULL_HITS];
double referenceDiffs[MAX_FULL_HITS];
int hitsNum;
public:
TDCChannel();
~TDCChannel();
void SetChannel(Int_t channel) { this->channel = channel; }
int GetChannel() { return channel; }
int GetHitsNum() { return hitsNum; }
void AddHit(double lead, double trail, double ref);
void AddHit(double lead, double trail);
double GetLeadTime1() { return leadTime1; }
double GetLeadTime(int mult) { return leadTimes[mult]; }
double GetTrailTime1() { return trailTime1; }
double GetTrailTime(int mult) { return trailTimes[mult]; }
double GetTOT1() { return tot1; }
int GetMult() { return hitsNum; }
double GetTOT(int mult) { return tots[mult]; }
ClassDef(TDCChannel,1);
};
#endif
| Change TDCHits array size from 100 to 50 | Change TDCHits array size from 100 to 50
For consistency with the standalone version
of the Unpacker.
| C | apache-2.0 | kmuzalewska/j-pet-framework,kmuzalewska/j-pet-framework,kmuzalewska/j-pet-framework,kmuzalewska/j-pet-framework,kmuzalewska/j-pet-framework |
f5eda040d34b33f438d562ae5cef8bf144d7f9fe | bin/varnishd/mgt.h | bin/varnishd/mgt.h | /*
* $Id$
*/
#include "common.h"
#include "miniobj.h"
extern struct evbase *mgt_evb;
/* mgt_child.c */
void mgt_run(int dflag);
void mgt_start_child(void);
void mgt_stop_child(void);
extern pid_t mgt_pid, child_pid;
/* mgt_cli.c */
void mgt_cli_init(void);
void mgt_cli_setup(int fdi, int fdo, int verbose);
int mgt_cli_askchild(int *status, char **resp, const char *fmt, ...);
void mgt_cli_start_child(int fdi, int fdo);
void mgt_cli_stop_child(void);
/* mgt_vcc.c */
void mgt_vcc_init(void);
int mgt_vcc_default(const char *bflag, const char *fflag);
int mgt_push_vcls_and_start(int *status, char **p);
/* tcp.c */
int open_tcp(const char *port);
#include "stevedore.h"
extern struct stevedore sma_stevedore;
extern struct stevedore smf_stevedore;
#include "hash_slinger.h"
extern struct hash_slinger hsl_slinger;
extern struct hash_slinger hcl_slinger;
| /*
* $Id$
*/
#include "common.h"
#include "miniobj.h"
extern struct evbase *mgt_evb;
/* mgt_child.c */
void mgt_run(int dflag);
extern pid_t mgt_pid, child_pid;
/* mgt_cli.c */
void mgt_cli_init(void);
void mgt_cli_setup(int fdi, int fdo, int verbose);
int mgt_cli_askchild(int *status, char **resp, const char *fmt, ...);
void mgt_cli_start_child(int fdi, int fdo);
void mgt_cli_stop_child(void);
/* mgt_vcc.c */
void mgt_vcc_init(void);
int mgt_vcc_default(const char *bflag, const char *fflag);
int mgt_push_vcls_and_start(int *status, char **p);
/* tcp.c */
int open_tcp(const char *port);
#include "stevedore.h"
extern struct stevedore sma_stevedore;
extern struct stevedore smf_stevedore;
#include "hash_slinger.h"
extern struct hash_slinger hsl_slinger;
extern struct hash_slinger hcl_slinger;
| Remove prototypes for no longer existing functions | Remove prototypes for no longer existing functions
git-svn-id: 2c9807fa3ff65b17195bd55dc8a6c4261e10127b@659 d4fa192b-c00b-0410-8231-f00ffab90ce4
| C | bsd-2-clause | gauthier-delacroix/Varnish-Cache,drwilco/varnish-cache-drwilco,gauthier-delacroix/Varnish-Cache,ajasty-cavium/Varnish-Cache,wikimedia/operations-debs-varnish,ssm/pkg-varnish,1HLtd/Varnish-Cache,ambernetas/varnish-cache,chrismoulton/Varnish-Cache,gauthier-delacroix/Varnish-Cache,zhoualbeart/Varnish-Cache,feld/Varnish-Cache,varnish/Varnish-Cache,franciscovg/Varnish-Cache,alarky/varnish-cache-doc-ja,wikimedia/operations-debs-varnish,varnish/Varnish-Cache,feld/Varnish-Cache,franciscovg/Varnish-Cache,ambernetas/varnish-cache,feld/Varnish-Cache,wikimedia/operations-debs-varnish,mrhmouse/Varnish-Cache,ajasty-cavium/Varnish-Cache,feld/Varnish-Cache,mrhmouse/Varnish-Cache,gauthier-delacroix/Varnish-Cache,mrhmouse/Varnish-Cache,drwilco/varnish-cache-old,ssm/pkg-varnish,1HLtd/Varnish-Cache,zhoualbeart/Varnish-Cache,ajasty-cavium/Varnish-Cache,chrismoulton/Varnish-Cache,ssm/pkg-varnish,gquintard/Varnish-Cache,drwilco/varnish-cache-drwilco,zhoualbeart/Varnish-Cache,ssm/pkg-varnish,ajasty-cavium/Varnish-Cache,wikimedia/operations-debs-varnish,zhoualbeart/Varnish-Cache,franciscovg/Varnish-Cache,varnish/Varnish-Cache,1HLtd/Varnish-Cache,chrismoulton/Varnish-Cache,chrismoulton/Varnish-Cache,alarky/varnish-cache-doc-ja,gquintard/Varnish-Cache,gquintard/Varnish-Cache,ambernetas/varnish-cache,gquintard/Varnish-Cache,varnish/Varnish-Cache,drwilco/varnish-cache-drwilco,zhoualbeart/Varnish-Cache,ajasty-cavium/Varnish-Cache,mrhmouse/Varnish-Cache,mrhmouse/Varnish-Cache,drwilco/varnish-cache-old,1HLtd/Varnish-Cache,feld/Varnish-Cache,gauthier-delacroix/Varnish-Cache,franciscovg/Varnish-Cache,wikimedia/operations-debs-varnish,franciscovg/Varnish-Cache,alarky/varnish-cache-doc-ja,alarky/varnish-cache-doc-ja,drwilco/varnish-cache-old,ssm/pkg-varnish,chrismoulton/Varnish-Cache,varnish/Varnish-Cache,alarky/varnish-cache-doc-ja |
79d2c8944e8cb838cf6fba47d8f857672f05855d | src/clientversion.h | src/clientversion.h | #ifndef CLIENTVERSION_H
#define CLIENTVERSION_H
//
// client versioning
//
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 8
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 0
// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
#define STRINGIZE(X) DO_STRINGIZE(X)
#define DO_STRINGIZE(X) #X
#endif // CLIENTVERSION_H
| #ifndef CLIENTVERSION_H
#define CLIENTVERSION_H
//
// client versioning
//
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 8
#define CLIENT_VERSION_REVISION 1
#define CLIENT_VERSION_BUILD 99
// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE false
// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
#define STRINGIZE(X) DO_STRINGIZE(X)
#define DO_STRINGIZE(X) #X
#endif // CLIENTVERSION_H
| Switch version numbers to 0.8.1.99 | Switch version numbers to 0.8.1.99
| C | mit | bmp02050/ReddcoinUpdates,ahmedbodi/poscoin,reddcoin-project/reddcoin,coinkeeper/2015-06-22_19-10_cannacoin,coinkeeper/2015-06-22_19-10_cannacoin,bmp02050/ReddcoinUpdates,joroob/reddcoin,coinkeeper/2015-06-22_19-10_cannacoin,reddink/reddcoin,bmp02050/ReddcoinUpdates,reddink/reddcoin,reddink/reddcoin,Cannacoin-Project/Cannacoin,joroob/reddcoin,ahmedbodi/poscoin,Cannacoin-Project/Cannacoin,coinkeeper/2015-06-22_18-46_reddcoin,coinkeeper/2015-06-22_18-46_reddcoin,reddcoin-project/reddcoin,reddcoin-project/reddcoin,bmp02050/ReddcoinUpdates,reddcoin-project/reddcoin,Cannacoin-Project/Cannacoin,reddcoin-project/reddcoin,Cannacoin-Project/Cannacoin,reddcoin-project/reddcoin,ahmedbodi/poscoin,Cannacoin-Project/Cannacoin,reddink/reddcoin,joroob/reddcoin,coinkeeper/2015-06-22_19-10_cannacoin,bmp02050/ReddcoinUpdates,ahmedbodi/poscoin,coinkeeper/2015-06-22_18-46_reddcoin,coinkeeper/2015-06-22_18-46_reddcoin,coinkeeper/2015-06-22_19-10_cannacoin,coinkeeper/2015-06-22_18-46_reddcoin,joroob/reddcoin,ahmedbodi/poscoin,reddink/reddcoin,joroob/reddcoin |
486c59553f64771f7bc1c984324b71442b45dfa2 | TDTChocolate/TDTCoreDataAdditions.h | TDTChocolate/TDTCoreDataAdditions.h | #import "CoreDataAdditions/NSManagedObject+TDTAdditions.h"
#import "CoreDataAdditions/NSManagedObjectContext+TDTAdditions.h"
#import "CoreDataAdditions/TDTCoreDataUtilityMacros.h"
#ifdef TARGET_IPHONE_OS
#import "CoreDataAdditions/NSFetchedResultsController+TDTAdditions.h"
#endif
| #import "CoreDataAdditions/NSManagedObject+TDTAdditions.h"
#import "CoreDataAdditions/NSManagedObjectContext+TDTAdditions.h"
#import "CoreDataAdditions/TDTCoreDataUtilityMacros.h"
#import "TargetConditionals.h"
#if TARGET_OS_IPHONE
#import "CoreDataAdditions/NSFetchedResultsController+TDTAdditions.h"
#endif
| Fix conditional compilation mechanism for ios | Fix conditional compilation mechanism for ios
| C | bsd-3-clause | talk-to/Chocolate,talk-to/Chocolate |
526b46b04e52247275453fca4d3c8c94d45cb91b | std/fp16.h | std/fp16.h | #ifndef __STD_FP16_H__
#define __STD_FP16_H__
typedef struct {
int16_t integer;
uint16_t fraction;
} Q16T;
void CastFloatQ16(Q16T *result asm("a0"), float value asm("fp0"));
void CastIntQ16(Q16T *result asm("a0"), int value asm("d0"));
void IAddQ16(Q16T *result asm("a0"), Q16T value asm("d0"));
#endif
| Add stubs for fp 16.16 handling rountines. | Add stubs for fp 16.16 handling rountines.
| C | artistic-2.0 | cahirwpz/demoscene,cahirwpz/demoscene,cahirwpz/demoscene,cahirwpz/demoscene |
|
78604e09580cac8f6e3adcb79e250adad46b04f7 | Wikipedia/Code/WKScriptMessage+WMFScriptMessage.h | Wikipedia/Code/WKScriptMessage+WMFScriptMessage.h | #import <WebKit/WebKit.h>
typedef NS_ENUM (NSInteger, WMFWKScriptMessageType) {
WMFWKScriptMessagePeek,
WMFWKScriptMessageConsoleMessage,
WMFWKScriptMessageClickLink,
WMFWKScriptMessageClickImage,
WMFWKScriptMessageClickReference,
WMFWKScriptMessageClickEdit,
WMFWKScriptMessageNonAnchorTouchEndedWithoutDragging,
WMFWKScriptMessageLateJavascriptTransform,
WMFWKScriptMessageArticleState,
WMFWKScriptMessageUnknown
};
@interface WKScriptMessage (WMFScriptMessage)
+ (WMFWKScriptMessageType)wmf_typeForMessageName:(NSString*)name;
+ (Class)wmf_expectedMessageBodyClassForType:(WMFWKScriptMessageType)type;
@end
| #import <WebKit/WebKit.h>
typedef NS_ENUM (NSInteger, WMFWKScriptMessageType) {
WMFWKScriptMessageUnknown,
WMFWKScriptMessagePeek,
WMFWKScriptMessageConsoleMessage,
WMFWKScriptMessageClickLink,
WMFWKScriptMessageClickImage,
WMFWKScriptMessageClickReference,
WMFWKScriptMessageClickEdit,
WMFWKScriptMessageNonAnchorTouchEndedWithoutDragging,
WMFWKScriptMessageLateJavascriptTransform,
WMFWKScriptMessageArticleState
};
@interface WKScriptMessage (WMFScriptMessage)
+ (WMFWKScriptMessageType)wmf_typeForMessageName:(NSString*)name;
+ (Class)wmf_expectedMessageBodyClassForType:(WMFWKScriptMessageType)type;
@end
| Move unknown enum entry to top. | Move unknown enum entry to top.
| C | mit | montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,anirudh24seven/wikipedia-ios,julienbodet/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/wikipedia-ios,julienbodet/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,josve05a/wikipedia-ios,josve05a/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,anirudh24seven/wikipedia-ios,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,wikimedia/wikipedia-ios,anirudh24seven/wikipedia-ios,anirudh24seven/wikipedia-ios,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/wikipedia-ios |
ad63f95e203ba5f5fe7e9fc5abf3c357a79d014f | examples/consume-compare-test.c | examples/consume-compare-test.c | #define REQUIRE_EXPLICIT_ATOMICS 1
#include "rmc.h"
int foo;
// LLVM will want to propagate the knowledge that p == &foo into the
// conditional, breaking our chain. We need to make sure that doesn't
// happen. The optimization is performed by -gvn.
int test(_Rmc(int *)* pp) {
XEDGE(a, b);
int *p = L(a, rmc_load(pp));
if (p == &foo) {
return L(b, *p);
}
return -1;
}
| Add a (broken) test for consume-style things where we compare the pointer. | Add a (broken) test for consume-style things where we compare the pointer.
| C | mit | msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler |
|
bc8356bb8359e531c793a2c9fc4a0e46c34361f3 | src/xenia/base/bit_field.h | src/xenia/base/bit_field.h | /**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2017 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_BASE_BIT_FIELD_H_
#define XENIA_BASE_BIT_FIELD_H_
#include <cstdint>
#include <cstdlib>
#include <type_traits>
namespace xe {
// Bitfield, where position starts at the LSB.
template <typename T, size_t position, size_t n_bits>
struct bf {
bf() = default;
inline operator T() const { return value(); }
inline T value() const {
return static_cast<T>((storage & mask()) >> position);
}
// For enum values, we strip them down to an underlying type.
typedef
typename std::conditional<std::is_enum<T>::value, std::underlying_type<T>,
std::identity<T>>::type::type value_type;
inline value_type mask() const {
return (((value_type)~0) >> (8 * sizeof(value_type) - n_bits)) << position;
}
value_type storage;
};
} // namespace xe
#endif // XENIA_BASE_BIT_FIELD_H_ | /**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2017 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_BASE_BIT_FIELD_H_
#define XENIA_BASE_BIT_FIELD_H_
#include <cstdint>
#include <cstdlib>
#include <type_traits>
namespace xe {
// Bitfield, where position starts at the LSB.
template <typename T, size_t position, size_t n_bits>
struct bf {
bf() = default;
inline operator T() const { return value(); }
inline T value() const {
return static_cast<T>((storage & mask()) >> position);
}
// For enum values, we strip them down to an underlying type.
typedef
typename std::conditional<std::is_enum<T>::value, std::underlying_type<T>,
std::remove_reference<T>>::type::type
value_type;
inline value_type mask() const {
return (((value_type)~0) >> (8 * sizeof(value_type) - n_bits)) << position;
}
value_type storage;
};
} // namespace xe
#endif // XENIA_BASE_BIT_FIELD_H_
| Remove usage of non standard identity struct | Remove usage of non standard identity struct
std::identity was removed from the standards, but Visual Studio kept
it as an extension.
Replace it by std::remove_reference, which does just a little bit
more than std::identity does, but without impact in this case.
| C | bsd-3-clause | sephiroth99/xenia,sephiroth99/xenia,sephiroth99/xenia |
c6813f627f8facb973616f1cec551013b46ebb00 | bin/check_it.c | bin/check_it.c | #include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <pwd.h>
int main(int argc, char** argv) {
struct passwd *passwd = getpwuid(getuid());
int errno = setreuid(geteuid(), geteuid());
// errno = execle("/usr/bin/id", (char *) 0, envp);
if (errno == 0 && passwd != 0) {
// CHECKIT_USER will contain the name of the user that invoked us.
char user_evar[100];
snprintf(user_evar, 80, "CHECKIT_USER=%s", passwd->pw_name);
// Use a nice clean PATH.
char * envp[] = {
"PATH=/bin:/usr/bin"
, "HOME=/home2/ling572_00"
, "JAVA_HOME=/usr/java/latest"
, "JAVA_OPTS=-Xmx300m -Xms140m"
, user_evar
, (char *) 0 };
// Do it!
errno = execve("/home2/ling572_00/Projects/CheckIt/bin/check_it.groovy", argv, envp);
}
printf("An error occured %d\n", errno);
return errno;
}
| #include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <pwd.h>
int main(int argc, char** argv) {
struct passwd *passwd = getpwuid(getuid());
int errno = setreuid(geteuid(), geteuid());
// errno = execle("/usr/bin/id", (char *) 0, envp);
if (errno == 0 && passwd != 0) {
// CHECKIT_USER will contain the name of the user that invoked us.
char user_evar[100];
snprintf(user_evar, 80, "CHECKIT_USER=%s", passwd->pw_name);
// Use a nice clean PATH.
char * envp[] = {
"PATH=/bin:/usr/bin"
, "HOME=/home2/ling572_00"
, "JAVA_HOME=/usr/java/latest"
, "JAVA_OPTS=-Xmx300m -Xms140m"
, "LC_ALL=en_US.UTF-8"
, user_evar
, (char *) 0 };
// Do it!
errno = execve("/home2/ling572_00/Projects/CheckIt/bin/check_it.groovy", argv, envp);
}
printf("An error occured %d\n", errno);
return errno;
}
| Set LC_ALL to UTF-8 so that SSH is clean. | Set LC_ALL to UTF-8 so that SSH is clean.
| C | agpl-3.0 | jimwhite/CheckIt,jimwhite/CheckIt,jimwhite/CheckIt,jimwhite/CheckIt |
c4f3c0153378f2a49adf47940d4de489642d8be1 | src/common/matrix.h | src/common/matrix.h | #ifndef COMMON_MATRIX_H
#define COMMON_MATRIX_H
/*
* Printipi/common/matrix.h
* (c) 2014 Colin Wallace
*
* This file exposes classes and templates used to construct 3x3 matrices.
* Matrices are useful in applying linear transformations. Notably, they can be used to adjust coordinates to a different coordinate-space in order to account for an unlevel bed.
*/
class Matrix3x3 {
float a00, a01, a02;
float a10, a11, a12;
float a20, a21, a22;
public:
Matrix3x3() : a00(0), a01(0), a02(0), a10(0), a11(0), a12(0), a20(0), a21(0), a22(0) {}
Matrix3x3(float a00, float a01, float a02,
float a10, float a11, float a12,
float a20, float a21, float a22) :
a00(a00), a01(a01), a02(a02),
a10(a10), a11(a11), a12(a12),
a20(a20), a21(a21), a22(a22) {}
template <typename VecT> VecT transform(const VecT &xyz) const {
return VecT(
a00*xyz.x() + a01*xyz.y() + a02*xyz.z(),
a10*xyz.x() + a11*xyz.y() + a12*xyz.z(),
a20*xyz.x() + a21*xyz.y() + a22*xyz.z()
);
}
};
#endif
| #ifndef COMMON_MATRIX_H
#define COMMON_MATRIX_H
#include "common/vector3.h"
/*
* Matrices are useful in applying linear transformations.
* Notably, they can be used to adjust coordinates to a different coordinate-space in order to account for an unlevel bed.
*/
class Matrix3x3 {
//r0, r1, r2 each represent one row of the matrix.
Vector3f r0, r1, r2;
public:
Matrix3x3() : r0(), r1(), r2() {}
Matrix3x3(float a00, float a01, float a02,
float a10, float a11, float a12,
float a20, float a21, float a22) :
r0(a00, a01, a02),
r1(a10, a11, a12),
r2(a20, a21, a22) {}
template <typename VecT> VecT transform(const VecT &xyz) const {
return VecT(r0.dot(xyz), r1.dot(xyz), r2.dot(xyz));
}
};
#endif
| Refactor Matrix3x3 to internally use Vector3's | Refactor Matrix3x3 to internally use Vector3's
| C | mit | harry159821/printipi,Wallacoloo/printipi,Wallacoloo/printipi,harry159821/printipi,Igor-Rast/printipi,Igor-Rast/printipi,harry159821/printipi,Igor-Rast/printipi,harry159821/printipi,Wallacoloo/printipi,Igor-Rast/printipi,Wallacoloo/printipi |
ec2c60ee36437d0bf817a836aa78130087c36fc7 | bcl/stm/src/main.c | bcl/stm/src/main.c | #include <bc_scheduler.h>
#include <bc_module_core.h>
#include <stm32l0xx.h>
void application_init(void);
void application_task(void *param);
int main(void)
{
bc_module_core_init();
bc_scheduler_init();
application_init();
bc_scheduler_register(application_task, NULL, 0);
bc_scheduler_run();
}
__attribute__((weak)) void application_init(void)
{
}
__attribute__((weak)) void application_task(void *param)
{
(void) param;
}
| #include <bc_scheduler.h>
#include <bc_module_core.h>
#include <stm32l0xx.h>
void application_init(void);
void application_task(void *param);
int main(void)
{
bc_module_core_init();
bc_scheduler_init();
bc_scheduler_register(application_task, NULL, 0);
application_init();
bc_scheduler_run();
}
__attribute__((weak)) void application_init(void)
{
}
__attribute__((weak)) void application_task(void *param)
{
(void) param;
}
| Move app_task() scheduler registration before app_init() so app_task() has task_id 0 | Move app_task() scheduler registration before app_init() so app_task() has task_id 0
| C | mit | bigclownlabs/bc-core-module-sdk,bigclownlabs/bc-core-module-sdk,bigclownlabs/bc-core-module-sdk |
2d12b42eb6dda7dcf6e4088201c754842b4b50b2 | arp.h | arp.h | #ifndef ARP_H_
#define ARP_H_
/*
* Address Resolution Protocol.
* See RFC 826 for protocol description.
* - https://tools.ietf.org/html/rfc826
*/
struct arphdr {
uint16_t ar_hrd; /* hardware type, one of: */
#define ARPHRD_ETHER 1 /* ethernet */
#define ARPHRD_FRELAY 15 /* frame relay */
uint16_t ar_pro; /* protocol type */
uint8_t ar_hln; /* length of hardware address */
uint8_t ar_pln; /* length of protocol address */
uint16_t ar_op; /* arp opcode, one of: */
#define ARPOP_REQUEST 1 /* arp request */
#define ARPOP_REPLY 2 /* arp reply */
#define ARPOP_REVREQUEST 3 /* rarp request */
#define ARPOP_REVREPLY 4 /* rarp reply */
#define ARPOP_INVREQUEST 8 /* InArp request */
#define ARPOP_INVREPLY 9 /* InArp reply */
/*
* The remaining fields are variable in size,
* according to the sizes above.
*/
#ifdef COMMENT_ONLY
uint8_t ar_sha[]; /* sender hardware address */
uint8_t ar_spa[]; /* sender protocol address */
uint8_t ar_tha[]; /* target hardware address */
uint8_t ar_tpa[]; /* target protocol address */
#endif
};
#endif /* end of include guard: ARP_H_ */
| Add a structure that defines ARP headers | Add a structure that defines ARP headers
| C | bsd-3-clause | cakturk/unet,cakturk/unet,cakturk/unet |
|
ba93087ebd43c0f7b3e980dc9e49a9313d9c9f01 | test/Analysis/malloc.c | test/Analysis/malloc.c | // RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-experimental-checks -analyzer-store=region -verify %s
#include <stdlib.h>
void f1() {
int *p = malloc(10);
return; // expected-warning{{Allocated memory never released. Potential memory leak.}}
}
void f2() {
int *p = malloc(10);
free(p);
free(p); // expected-warning{{Try to free a memory block that has been released}}
}
| // RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-experimental-checks -analyzer-store=region -verify %s
#include <stdlib.h>
void f1() {
int *p = malloc(10);
return; // expected-warning{{Allocated memory never released. Potential memory leak.}}
}
// THIS TEST CURRENTLY FAILS.
void f1_b() {
int *p = malloc(10);
}
void f2() {
int *p = malloc(10);
free(p);
free(p); // expected-warning{{Try to free a memory block that has been released}}
}
| Add test case that shows a leak we don't catch. | Add test case that shows a leak we don't catch.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@88683 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,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang |
9c0a2f00ec83264534269aab1b97dc7f78bd2a4d | testing/test_hashmap.c | testing/test_hashmap.c | #include <CUnit/CUnit.h>
#include <CUnit/Basic.h>
#include <utils/hashmap.h>
void test_hashmap_create(void) {
return;
}
int main(int argc, char **argv) {
CU_pSuite suite = NULL;
if(CU_initialize_registry() != CUE_SUCCESS) {
return CU_get_error();
}
// Init suite
suite = CU_add_suite("Hashmap", NULL, NULL);
if(suite == NULL) {
goto end;
}
// Add tests
if(CU_add_test(suite, "test of hashmap_create", test_hashmap_create) == NULL) { goto end; }
// Run tests
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
end:
CU_cleanup_registry();
return CU_get_error();
}
| #include <CUnit/CUnit.h>
#include <CUnit/Basic.h>
#include <utils/hashmap.h>
void test_hashmap_create(void) {
return;
}
void test_hashmap_free(void) {
return;
}
void test_hashmap_delete(void) {
return;
}
void test_hashmap_insert(void) {
return;
}
void test_hashmap_get(void) {
return;
}
void test_hashmap_iterator(void) {
return;
}
int main(int argc, char **argv) {
CU_pSuite suite = NULL;
if(CU_initialize_registry() != CUE_SUCCESS) {
return CU_get_error();
}
// Init suite
suite = CU_add_suite("Hashmap", NULL, NULL);
if(suite == NULL) {
goto end;
}
// Add tests
if(CU_add_test(suite, "Test for hashmap create", test_hashmap_create) == NULL) { goto end; }
if(CU_add_test(suite, "Test for hashmap delete operation", test_hashmap_delete) == NULL) { goto end; }
if(CU_add_test(suite, "Test for hashmap insert operation", test_hashmap_insert) == NULL) { goto end; }
if(CU_add_test(suite, "Test for hashmap get operation", test_hashmap_get) == NULL) { goto end; }
if(CU_add_test(suite, "Test for hashmap iterator", test_hashmap_iterator) == NULL) { goto end; }
if(CU_add_test(suite, "Test for hashmap free operation", test_hashmap_free) == NULL) { goto end; }
// Run tests
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
end:
CU_cleanup_registry();
return CU_get_error();
}
| Add some more test function stubs | Add some more test function stubs
| C | mit | pmjdebruijn/openomf,gdeda/openomf,omf2097/openomf,pmjdebruijn/openomf,omf2097/openomf,omf2097/openomf,gdeda/openomf,pmjdebruijn/openomf,gdeda/openomf |
ceec0a0fc3e0d263641ab546f84a2ff14a2b3adf | includes/sv-comp.c | includes/sv-comp.c | void __VERIFIER_error() { abort(); }
// Some files define __VERIFIER_assume, some declare as extern. What happens when redefined?
void __VERIFIER_assume(int expression) { if (!expression) { LOOP: goto LOOP; }; return; }
// #define __VERIFIER_nondet(X) X __VERIFIER_nondet_##X() { X val; return val; }
#define __VERIFIER_nondet2(X, Y) X __VERIFIER_nondet_##Y() { X val; return val; }
#define __VERIFIER_nondet(X) __VERIFIER_nondet2(X, X)
__VERIFIER_nondet2(_Bool, bool)
__VERIFIER_nondet(char)
__VERIFIER_nondet2(unsigned char, uchar)
// int __VERIFIER_nondet_int() { int val; return val; }
__VERIFIER_nondet(int)
__VERIFIER_nondet2(unsigned int, uint)
__VERIFIER_nondet(long)
__VERIFIER_nondet2(unsigned long, ulong)
// void* __VERIFIER_nondet_pointer() { void* val; return val; }
__VERIFIER_nondet2(void*, pointer) | void __VERIFIER_error() { abort(); }
// Some files define __VERIFIER_assume, some declare as extern. What happens when redefined?
void __VERIFIER_assume(int expression) { if (!expression) { LOOP: goto LOOP; }; return; }
// #define __VERIFIER_nondet(X) X __VERIFIER_nondet_##X() { X val; return val; }
#define __VERIFIER_nondet2(X, Y) X __VERIFIER_nondet_##Y() { X val; return val; }
#define __VERIFIER_nondet(X) __VERIFIER_nondet2(X, X)
__VERIFIER_nondet2(_Bool, bool)
__VERIFIER_nondet(char)
__VERIFIER_nondet2(unsigned char, uchar)
// int __VERIFIER_nondet_int() { int val; return val; }
__VERIFIER_nondet(int)
__VERIFIER_nondet2(unsigned int, uint)
__VERIFIER_nondet(long)
__VERIFIER_nondet2(unsigned long, ulong)
// void* __VERIFIER_nondet_pointer() { void* val; return val; }
__VERIFIER_nondet2(void*, pointer)
void __VERIFIER_atomic_begin() { } // TODO: use atomic marker in Goblint
void __VERIFIER_atomic_end() { } // TODO: use atomic marker in Goblint | Add empty definitions for __VERIFIER_atomic_begin and end | Add empty definitions for __VERIFIER_atomic_begin and end
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
4b42be91379a1fdf0262e099e061d5855291df5c | ecc.c | ecc.c | #include <stdio.h>
#include <stdlib.h>
// Chunk of a finite field element.
typedef unsigned char chunk;
// Number of chunks per element.
#define N 10
// A finite field element.
typedef struct { chunk v[N]; }* number;
// Helper macro.
#define FOR(i) for (int i = 0; i < N; i++)
number new_number() {
number n = malloc(sizeof(number));
FOR(i) {
n->v[i] = 0x00;
}
return n;
}
void print(char* label, number n) {
printf("%s: ", label);
for (int i = N - 1; i >= 0; i--) {
printf("%02x", n->v[i]);
}
printf("\n");
}
void add(number a, number b, number result) {
chunk carry = 0;
chunk sum;
FOR(i) {
sum = a->v[i] + b->v[i] + carry;
carry = sum < a->v[i] || (sum == a->v[i] && b->v[i] != 0);
result->v[i] = sum;
}
}
void sub(number a, number b, number result) {
chunk carry = 0;
chunk sum;
FOR(i) {
sum = a->v[i] - b->v[i] - carry;
carry = a->v[i] < b->v[i] || sum > a->v[i];
result->v[i] = sum;
}
}
int main() {
number a = new_number();
a->v[0] = 0x01;
number b = new_number();
b->v[0] = 0xFF;
b->v[1] = 0xFF;
number c = new_number();
print("a", a);
print("b", b);
add(a, b, c);
print("a+b", c);
sub(c, b, c);
print("a+b-b", c);
c->v[0] = 0x00;
print("c", c);
sub(c, a, c);
print("-a", c);
}
| Add finite field operations in c | Add finite field operations in c
| C | mit | boppreh/ecc,boppreh/ecc |
|
ebbc4230bee4c02e6b33bc523d746f9225b3082d | inc/microbit/MicroBitCustomConfig.h | inc/microbit/MicroBitCustomConfig.h | /**
* MicroBitCustomConfig.h
*
* This file is automatically included by the microbit DAL compilation
* process. Use this to define any custom configration options needed
* for your build of the micro:bit runtime.
*
* See microbit-dal/inc/MicroBitConfig.h for a complete list of options.
* Any options you define here will take prescedence over those defined there.
*/
#ifndef MICROBIT_CUSTOM_CONFIG_H
#define MICROBIT_CUSTOM_CONFIG_H
#define MICROBIT_HEAP_REUSE_SD 0
#define MICROBIT_BLE_ENABLED 0
#define MICROBIT_BLE_BLUEZONE 0
#define MICROBIT_BLE_DFU_SERVICE 0
#define MICROBIT_BLE_EVENT_SERVICE 0
#define MICROBIT_BLE_DEVICE_INFORMATION_SERVICE 0
#define MICROBIT_BLE_PAIRING_MODE 0
#endif
| /**
* MicroBitCustomConfig.h
*
* This file is automatically included by the microbit DAL compilation
* process. Use this to define any custom configration options needed
* for your build of the micro:bit runtime.
*
* See microbit-dal/inc/MicroBitConfig.h for a complete list of options.
* Any options you define here will take prescedence over those defined there.
*/
#ifndef MICROBIT_CUSTOM_CONFIG_H
#define MICROBIT_CUSTOM_CONFIG_H
#define MICROBIT_HEAP_REUSE_SD 0
#define MICROBIT_BLE_ENABLED 0
#define MICROBIT_BLE_BLUEZONE 0
#define MICROBIT_BLE_DFU_SERVICE 0
#define MICROBIT_BLE_EVENT_SERVICE 0
#define MICROBIT_BLE_DEVICE_INFORMATION_SERVICE 0
#define MICROBIT_BLE_PAIRING_MODE 0
#define MICROBIT_RADIO_ENABLED 0
#endif
| Disable the DAL's radio IRQ handler so we can use our own. | Disable the DAL's radio IRQ handler so we can use our own.
| C | mit | JoeGlancy/micropython,JoeGlancy/micropython,JoeGlancy/micropython |
3869a1728808fc9e075d0091bb03826fa6ed58b0 | drivers/scsi/qla2xxx/qla_version.h | drivers/scsi/qla2xxx/qla_version.h | /*
* QLogic Fibre Channel HBA Driver
* Copyright (c) 2003-2008 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.02.01-k8"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 2
#define QLA_DRIVER_PATCH_VER 1
#define QLA_DRIVER_BETA_VER 0
| /*
* QLogic Fibre Channel HBA Driver
* Copyright (c) 2003-2008 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.02.01-k9"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 2
#define QLA_DRIVER_PATCH_VER 1
#define QLA_DRIVER_BETA_VER 0
| Update version number to 8.02.01-k9. | [SCSI] qla2xxx: Update version number to 8.02.01-k9.
Signed-off-by: Andrew Vasquez <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
| C | mit | KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs |
15a3758dc9e1c9d862e46acdf607de70c302fa6a | drivers/scsi/qla2xxx/qla_version.h | drivers/scsi/qla2xxx/qla_version.h | /*
* QLogic Fibre Channel HBA Driver
* Copyright (c) 2003-2005 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.01.05-k4"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 1
#define QLA_DRIVER_PATCH_VER 5
#define QLA_DRIVER_BETA_VER 0
| /*
* QLogic Fibre Channel HBA Driver
* Copyright (c) 2003-2005 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.01.07-k1"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 1
#define QLA_DRIVER_PATCH_VER 7
#define QLA_DRIVER_BETA_VER 0
| Update version number to 8.01.07-k1. | [SCSI] qla2xxx: Update version number to 8.01.07-k1.
Signed-off-by: Andrew Vasquez <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
| C | mit | KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs |
2d18ac2cf8aa2503545d0bd4d3ff883c407ccd99 | src/assert.c | src/assert.c | static char rcsid[] = "$Id: H:/drh/idioms/book/RCS/except.doc,v 1.10 1997/02/21 19:43:55 drh Exp $";
#include "assert.h"
const Except_T Assert_Failed = { "Assertion failed" };
void (assert)(int e) {
assert(e);
}
| /**
* assert.c
*
* Copyright (C) 2017 Nickolas Burr <[email protected]>
*/
#include "assert.h"
const Except_T Assert_Failed = {
"Assertion failed"
};
void (assert)(int e) {
assert(e);
}
| Update formatting, remove CII vars | Update formatting, remove CII vars
| C | mit | nickolasburr/git-stashd,nickolasburr/git-stashd,nickolasburr/git-stashd |
48a21d9a1a91d1f4c15095ee848941df5bac0e8f | src/diskio.c | src/diskio.c | #include <stdlib.h>
#include <stdio.h>
#include "diskio.h"
char* loadDataFromDiskFile(char* fileName) {
FILE* diskFile = fopen(fileName, "rb");
if(diskFile == NULL)
return NULL;
char* diskData = (char*)malloc(sizeof(char) * DISK_SIZE);
if(!fgets(diskData, DISK_SIZE, diskFile)) {
if(diskFile)
fclose(diskFile);
free(diskData);
return NULL;
}
fclose(diskFile);
return diskData;
}
int saveDiskFile(char* fileName, char* data) {
FILE* diskFile = fopen(fileName, "wb");
if(!diskFile)
return -1;
if(!fwrite(data, sizeof(char), DISK_SIZE, diskFile)) {
fclose(diskFile);
return -1;
}
fclose(diskFile);
return 1;
}
void freeDiskData(char* diskData) {
free(diskData);
}
char* getSegmentData(char* data, int tracknum, int sectornum) {
return &data[
((tracknum & TRACK_ID_MASK) * TRACK_SIZE) +
((sectornum & SECTOR_ID_MASK) * SECTOR_SIZE)
];
}
| #include <stdlib.h>
#include <stdio.h>
#include "diskio.h"
char* loadDataFromDiskFile(char* fileName) {
FILE* diskFile = fopen(fileName, "rb");
if(diskFile == NULL)
return NULL;
char* diskData = (char*)malloc(sizeof(char) * DISK_SIZE);
/* TODO: Return null if bytes read is less than expected*/
if(!fread(diskData, sizeof(char), DISK_SIZE, diskFile)){
if(diskFile)
fclose(diskFile);
free(diskData);
return NULL;
}
fclose(diskFile);
return diskData;
}
int saveDiskFile(char* fileName, char* data) {
FILE* diskFile = fopen(fileName, "wb");
if(!diskFile)
return -1;
if(!fwrite(data, sizeof(char), DISK_SIZE, diskFile)) {
fclose(diskFile);
return -1;
}
fclose(diskFile);
return 1;
}
void freeDiskData(char* diskData) {
free(diskData);
}
char* getSegmentData(char* data, int tracknum, int sectornum) {
return &data[
((tracknum & TRACK_ID_MASK) * TRACK_SIZE) +
((sectornum & SECTOR_ID_MASK) * SECTOR_SIZE)
];
}
| Use correct file io function for binary reads | Use correct file io function for binary reads
| C | mit | drdanick/apricos-fs-manager |
01d189c2149e3a1bc84aef1e08d138aae553f51a | include/ethernet.h | include/ethernet.h | #ifndef ETHERNET_H_
#define ETHERNET_H_
#include <linux/if_ether.h>
struct eth_hdr
{
unsigned char dst_mac[6];
unsigned char src_mac[6];
unsigned short ethertype;
unsigned char* payload;
};
struct eth_hdr* init_eth_hdr(char* buf);
void print_eth_hdr(struct eth_hdr *ehdr);
#endif
| #ifndef ETHERNET_H_
#define ETHERNET_H_
#include <linux/if_ether.h>
struct eth_hdr
{
unsigned char dst_mac[6];
unsigned char src_mac[6];
unsigned short ethertype;
unsigned char payload[];
};
struct eth_hdr* init_eth_hdr(char* buf);
void print_eth_hdr(struct eth_hdr *ehdr);
#endif
| Fix wrong eth payload data type | Fix wrong eth payload data type
Declaring a pointer here and type-casting the buffer to
a eth struct just overwrites the pointer with the payloads contents!
Oops!
Declaring a flexible array member is better.
https://en.wikipedia.org/wiki/Flexible_array_member
| C | mit | saminiir/level-ip,saminiir/level-ip |
c8467aa2b596b499d07951e729aa7932001e3257 | src/imap/cmd-logout.c | src/imap/cmd-logout.c | /* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "commands.h"
int cmd_logout(struct client *client)
{
client_send_line(client, "* BYE Logging out");
if (client->mailbox != NULL) {
/* this could be done at client_disconnect() as well,
but eg. mbox rewrite takes a while so the waiting is
better to happen before "OK" message. */
mailbox_close(client->mailbox);
client->mailbox = NULL;
}
client_send_tagline(client, "OK Logout completed.");
client_disconnect(client);
return TRUE;
}
| /* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "commands.h"
int cmd_logout(struct client *client)
{
client_send_line(client, "* BYE Logging out");
o_stream_uncork(client->output);
if (client->mailbox != NULL) {
/* this could be done at client_disconnect() as well,
but eg. mbox rewrite takes a while so the waiting is
better to happen before "OK" message. */
mailbox_close(client->mailbox);
client->mailbox = NULL;
}
client_send_tagline(client, "OK Logout completed.");
client_disconnect(client);
return TRUE;
}
| Send the "* BYE Logging out" before closing mailbox. | Send the "* BYE Logging out" before closing mailbox.
--HG--
branch : HEAD
| C | mit | dscho/dovecot,dscho/dovecot,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jkerihuel/dovecot,jkerihuel/dovecot,jkerihuel/dovecot,jwm/dovecot-notmuch,dscho/dovecot,jwm/dovecot-notmuch,jkerihuel/dovecot,dscho/dovecot,dscho/dovecot,jkerihuel/dovecot,jwm/dovecot-notmuch |
ae9bf18bde6fd548f5e598cc33f2f99bbfb49d44 | source/target/siliconlabs/efm32gg/target_reset.c | source/target/siliconlabs/efm32gg/target_reset.c | /* CMSIS-DAP Interface Firmware
* Copyright (c) 2009-2013 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "RTL.h"
#include "debug_cm.h"
#include "target_reset.h"
#include "swd_host.h"
#include "DAP_Config.h"
void target_before_init_debug(void) {
return;
}
uint8_t target_unlock_sequence(void) {
return 1;
}
uint8_t target_set_state(TARGET_RESET_STATE state) {
return swd_set_target_state_hw(state);
}
uint8_t security_bits_set(uint32_t addr, uint8_t *data, uint32_t size) {
return 0;
}
| /* CMSIS-DAP Interface Firmware
* Copyright (c) 2009-2013 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "RTL.h"
#include "debug_cm.h"
#include "target_reset.h"
#include "swd_host.h"
#include "DAP_Config.h"
void target_before_init_debug(void) {
return;
}
uint8_t target_unlock_sequence(void) {
return 1;
}
uint8_t target_set_state(TARGET_RESET_STATE state) {
return swd_set_target_state_sw(state);
}
uint8_t security_bits_set(uint32_t addr, uint8_t *data, uint32_t size) {
return 0;
}
| Change the EFM32 reset type to a software reset | Change the EFM32 reset type to a software reset
Change the reset type from a hardware reset to a software reset.
It appears that hardware resets cause the debug logic to get reset
causing a failure in the initialization sequence. This needs to be
investigated further.
| C | apache-2.0 | sg-/DAPLink,sg-/DAPLink,sg-/DAPLink,google/DAPLink-port,google/DAPLink-port,google/DAPLink-port,google/DAPLink-port |
5439e60468398c955f2448df853a11a8e36d9dcd | link-grammar/dict-common/dict-impl.h | link-grammar/dict-common/dict-impl.h |
#include "link-includes.h"
// Already declared in link-includes.h
// const char * linkgrammar_get_dict_locale(Dictionary dict);
// const char * linkgrammar_get_version(void);
// const char * linkgrammar_get_dict_version(Dictionary dict);
void dictionary_setup_locale(Dictionary dict);
void dictionary_setup_defines(Dictionary dict);
void afclass_init(Dictionary dict);
bool afdict_init(Dictionary dict);
void affix_list_add(Dictionary afdict, Afdict_class *, const char *);
|
#include "link-includes.h"
#include "utilities.h"
// Already declared in link-includes.h
// const char * linkgrammar_get_dict_locale(Dictionary dict);
// const char * linkgrammar_get_version(void);
// const char * linkgrammar_get_dict_version(Dictionary dict);
void dictionary_setup_locale(Dictionary dict);
void dictionary_setup_defines(Dictionary dict);
void afclass_init(Dictionary dict);
bool afdict_init(Dictionary dict);
void affix_list_add(Dictionary afdict, Afdict_class *, const char *);
#ifdef __MINGW32__
int callGetLocaleInfoEx(LPCWSTR, LCTYPE, LPWSTR, int);
#endif /* __MINGW32__ */
| Add a missing prototype (callGetLocaleInfoEx()) | MinGW: Add a missing prototype (callGetLocaleInfoEx())
| C | lgpl-2.1 | ampli/link-grammar,ampli/link-grammar,ampli/link-grammar,ampli/link-grammar,linas/link-grammar,opencog/link-grammar,opencog/link-grammar,linas/link-grammar,linas/link-grammar,ampli/link-grammar,linas/link-grammar,opencog/link-grammar,ampli/link-grammar,opencog/link-grammar,opencog/link-grammar,linas/link-grammar,opencog/link-grammar,opencog/link-grammar,ampli/link-grammar,linas/link-grammar,opencog/link-grammar,linas/link-grammar,ampli/link-grammar,linas/link-grammar,linas/link-grammar,ampli/link-grammar,opencog/link-grammar |
5f0ef4eda80a6db44b091bb8693589ccba5544c6 | src/lib/marble/geodata/data/GeoDataTimeStamp_p.h | src/lib/marble/geodata/data/GeoDataTimeStamp_p.h | //
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2010 Harshit Jain <[email protected]>
//
#ifndef GEODATATIMESTAMPPRIVATE_H
#define GEODATATIMESTAMPPRIVATE_H
#include <QDateTime>
#include "GeoDataTypes.h"
#include <GeoDataTimeStamp.h>
namespace Marble
{
class GeoDataTimeStampPrivate
{
public:
QDateTime m_when;
GeoDataTimeStamp::TimeResolution m_resolution;
};
} // namespace Marble
#endif //GEODATATIMESTAMPPRIVATE_H
| //
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2010 Harshit Jain <[email protected]>
//
#ifndef GEODATATIMESTAMPPRIVATE_H
#define GEODATATIMESTAMPPRIVATE_H
#include <QDateTime>
#include "GeoDataTypes.h"
#include <GeoDataTimeStamp.h>
namespace Marble
{
class GeoDataTimeStampPrivate
{
public:
QDateTime m_when;
GeoDataTimeStamp::TimeResolution m_resolution;
GeoDataTimeStampPrivate();
};
GeoDataTimeStampPrivate::GeoDataTimeStampPrivate() :
m_resolution( GeoDataTimeStamp::SecondResolution )
{
// nothing to do
}
} // namespace Marble
#endif //GEODATATIMESTAMPPRIVATE_H
| Add missing initialization of time resolution | Add missing initialization of time resolution
| C | lgpl-2.1 | quannt24/marble,probonopd/marble,probonopd/marble,probonopd/marble,David-Gil/marble-dev,tucnak/marble,probonopd/marble,David-Gil/marble-dev,tzapzoor/marble,quannt24/marble,tzapzoor/marble,quannt24/marble,probonopd/marble,tucnak/marble,David-Gil/marble-dev,tzapzoor/marble,tzapzoor/marble,tucnak/marble,quannt24/marble,tzapzoor/marble,quannt24/marble,tucnak/marble,tzapzoor/marble,quannt24/marble,David-Gil/marble-dev,tucnak/marble,quannt24/marble,tucnak/marble,probonopd/marble,tucnak/marble,probonopd/marble,David-Gil/marble-dev,tzapzoor/marble,tzapzoor/marble,David-Gil/marble-dev |
b4baf13b85a2dff0525998cd3138d2433b25580b | Other/AardvarkDefines.h | Other/AardvarkDefines.h | //
// AardvarkDefines.h
// Aardvark
//
// Created by Dan Federman on 10/4/14.
// Copyright (c) 2014 Square, Inc. All rights reserved.
//
/**
Provides the ability to verify key paths at compile time.
If "keyPath" does not exist, a compile-time error will be generated.
Example:
// Verifies "isFinished" exists on "operation".
NSString *key = ARKKeyPath(operation, isFinished);
// Verifies "isFinished" exists on self.
NSString *key = ARKSelfKeyPath(isFinished);
*/
#define ARKKeyPath(object, keyPath) \
({ if (NO) { (void)((object).keyPath); } @#keyPath; })
#define ARKSelfKeyPath(keyPath) ARKKeyPath(self, keyPath)
/**
Throws a caught exception and returns "return_statement" if "condition" is false.
Example:
ARKCheckCondition(isProperlyConfigured, nil, @"Foo was not properly configured.");
*/
#define ARKCheckCondition(condition, result, desc, ...) \
do { \
if (!(condition)) { \
@try { \
NSAssert(condition, (desc), ##__VA_ARGS__); \
} @catch (NSException *exception) { \
NSLog(@"Aardvark API Misuse: %s %@", __PRETTY_FUNCTION__, exception.reason); \
return result;\
} \
} \
} while(0) | //
// AardvarkDefines.h
// Aardvark
//
// Created by Dan Federman on 10/4/14.
// Copyright (c) 2014 Square, Inc. All rights reserved.
//
/**
Provides the ability to verify key paths at compile time.
If "keyPath" does not exist, a compile-time error will be generated.
Example:
// Verifies "isFinished" exists on "operation".
NSString *key = ARKKeyPath(operation, isFinished);
// Verifies "isFinished" exists on self.
NSString *key = ARKSelfKeyPath(isFinished);
*/
#define ARKKeyPath(object, keyPath) \
({ if (NO) { (void)((object).keyPath); } @#keyPath; })
#define ARKSelfKeyPath(keyPath) ARKKeyPath(self, keyPath)
/**
Throws a caught exception and returns "return_statement" if "condition" is false.
Example:
ARKCheckCondition(isProperlyConfigured, nil, @"Foo was not properly configured.");
*/
#define ARKCheckCondition(condition, result, desc, ...) \
do { \
if (!(condition)) { \
@try { \
NSAssert(condition, (desc), ##__VA_ARGS__); \
} @catch (NSException *exception) { \
NSLog(@"Aardvark API Misuse: %s %@", __PRETTY_FUNCTION__, exception.reason); \
return result;\
} \
} \
} while(0)
| Add newline to end of file | Add newline to end of file
| C | apache-2.0 | square/Aardvark,square/Aardvark,mtxs007/Aardvark,square/Aardvark,tinyspeck/Aardvark,vamsirajendra/Aardvark |
44b3e6b16c70304cca687e7bc0bbd175f7400926 | include/stdbool.h | include/stdbool.h | #ifndef _UCC_STDBOOL_H
#define _UCC_STDBOOL_H
#define __bool_true_false_are_defined 1
typedef _Bool bool;
#define bool bool
#define false 0
#define true 1
#endif
| #ifndef _UCC_STDBOOL_H
#define _UCC_STDBOOL_H
#define __bool_true_false_are_defined 1
#define bool _Bool
#define false 0
#define true 1
#endif
| Change bool to a macro instead of typedef | Change bool to a macro instead of typedef
| C | mit | bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler |
f455dfb106916d855d59686fe16575c2ceb2cb2a | arch/arm/mach-shark/include/mach/io.h | arch/arm/mach-shark/include/mach/io.h | /*
* arch/arm/mach-shark/include/mach/io.h
*
* by Alexander Schulz
*
* derived from:
* arch/arm/mach-ebsa110/include/mach/io.h
* Copyright (C) 1997,1998 Russell King
*/
#ifndef __ASM_ARM_ARCH_IO_H
#define __ASM_ARM_ARCH_IO_H
#define PCIO_BASE 0xe0000000
#define IO_SPACE_LIMIT 0xffffffff
#define __io(a) __typesafe_io(PCIO_BASE + (a))
#define __mem_pci(addr) (addr)
#endif
| /*
* arch/arm/mach-shark/include/mach/io.h
*
* by Alexander Schulz
*
* derived from:
* arch/arm/mach-ebsa110/include/mach/io.h
* Copyright (C) 1997,1998 Russell King
*/
#ifndef __ASM_ARM_ARCH_IO_H
#define __ASM_ARM_ARCH_IO_H
#define PCIO_BASE 0xe0000000
#define IO_SPACE_LIMIT 0xffffffff
#define __io(a) __typesafe_io(PCIO_BASE + (a))
#define __mem_pci(addr) (addr)
#endif
| Fix up merge with the ARM tree | ASoC: Fix up merge with the ARM tree
The same change has been made with the final lines in slightly differnet
orders.
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>
| C | mit | KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas |
ce1c5ee0155b47403c63232a5e073929e6243897 | ruby/ext/bson/native.c | ruby/ext/bson/native.c | #include <ruby.h>
#include <stdint.h>
static VALUE rb_integer_to_bson(VALUE self)
{
const int32_t v = NUM2INT(self);
const char bytes[4] = { v & 255, (v >> 8) & 255, (v >> 16) & 255, (v >> 24) & 255 };
return rb_str_new(bytes, 4);
}
void Init_native()
{
VALUE bson = rb_const_get(rb_cObject, rb_intern("BSON"));
VALUE integer = rb_const_get(bson, rb_intern("Integer"));
rb_remove_method(integer, "to_bson");
rb_define_method(integer, "to_bson", rb_integer_to_bson, 0);
}
| #include <ruby.h>
#include <stdint.h>
static VALUE rb_integer_to_bson(VALUE self)
{
/* const int32_t v = NUM2INT(self); */
/* const char bytes[4] = { v & 255, (v >> 8) & 255, (v >> 16) & 255, (v >> 24) & 255 }; */
/* return rb_str_new(bytes, 4); */
}
void Init_native()
{
/* VALUE bson = rb_const_get(rb_cObject, rb_intern("BSON")); */
/* VALUE integer = rb_const_get(bson, rb_intern("Integer")); */
/* rb_remove_method(integer, "to_bson"); */
/* rb_define_method(integer, "to_bson", rb_integer_to_bson, 0); */
}
| Comment out the c for now | Comment out the c for now
| C | apache-2.0 | johnsimon/bson-ruby,agis-/bson-ruby,hudon/bson-ruby,mongodb/bson-ruby,mongodb/bson-ruby,mongodb/bson-ruby,estolfo/bson-ruby,ukblewis/bson-ruby,agis-/bson-ruby,johnsimon/bson-ruby,hudon/bson-ruby,ukblewis/bson-ruby,estolfo/bson-ruby,agis-/bson-ruby,ukblewis/bson-ruby,mongodb/bson-ruby,estolfo/bson-ruby,ukblewis/bson-ruby,hudon/bson-ruby,johnsimon/bson-ruby,estolfo/bson-ruby |
67d05f55509bf9bad5876e0d2dcd0a540543d199 | selftest.c | selftest.c | #include <string.h>
#include "iobuf/iobuf.h"
#include "msg/msg.h"
#include "str/str.h"
void NL(void) { obuf_putc(&outbuf, LF); }
void debugstr(const str* s)
{
obuf_puts(&outbuf, "len=");
obuf_putu(&outbuf, s->len);
obuf_puts(&outbuf, " size=");
obuf_putu(&outbuf, s->size);
if (s->s == 0)
obuf_puts(&outbuf, " s is NULL");
else {
obuf_puts(&outbuf, " s=");
obuf_putstr(&outbuf, s);
}
NL();
}
void debugstrfn(int result, const str* s)
{
obuf_puts(&outbuf, "result=");
obuf_puti(&outbuf, result);
obuf_putc(&outbuf, ' ');
debugstr(s);
}
void debugfn(int result)
{
obuf_puts(&outbuf, "result=");
obuf_puti(&outbuf, result);
NL();
}
#define MAIN void selftest(void)
MAIN;
int main(void)
{
selftest();
obuf_flush(&outbuf);
return 0;
}
| #include <string.h>
#include "iobuf/iobuf.h"
#include "msg/msg.h"
#include "str/str.h"
void NL(void) { obuf_putc(&outbuf, LF); }
void debugstr(const str* s)
{
obuf_puts(&outbuf, "len=");
obuf_putu(&outbuf, s->len);
obuf_puts(&outbuf, " size=");
obuf_putu(&outbuf, s->size);
if (s->s == 0)
obuf_puts(&outbuf, " s is NULL");
else {
obuf_puts(&outbuf, " s=");
obuf_putstr(&outbuf, s);
}
NL();
}
int debugstrfn(int result, const str* s)
{
obuf_puts(&outbuf, "result=");
obuf_puti(&outbuf, result);
obuf_putc(&outbuf, ' ');
debugstr(s);
return result;
}
int debugfn(int result)
{
obuf_puts(&outbuf, "result=");
obuf_puti(&outbuf, result);
NL();
return result;
}
#define MAIN void selftest(void)
MAIN;
int main(void)
{
selftest();
obuf_flush(&outbuf);
obuf_flush(&errbuf);
return 0;
}
| Return the result of debugged functions, and flush stderr on exit. | Return the result of debugged functions, and flush stderr on exit.
| C | lgpl-2.1 | bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs |
bd1ce049956272df99ec52598a2234afa32b3055 | Paystack/PublicHeaders/PSTCKTransactionParams.h | Paystack/PublicHeaders/PSTCKTransactionParams.h | //
// PSTCKTransactionParams.h
// Paystack
//
#import <Foundation/Foundation.h>
#import "PSTCKFormEncodable.h"
/**
* Representation of the transaction to perform on a card
*/
@interface PSTCKTransactionParams : NSObject<PSTCKFormEncodable>
@property (nonatomic, copy, nonnull) NSString *email;
@property (nonatomic) NSUInteger amount;
@property (nonatomic, copy, nullable) NSString *reference;
@property (nonatomic, copy, nullable) NSString *subaccount;
@property (nonatomic) NSInteger transaction_charge;
@property (nonatomic, copy, nullable) NSString *bearer;
@property (nonatomic, readonly, nullable) NSString *metadata;
@property (nonatomic, readonly, nullable) NSString *plan;
@property (nonatomic, readonly, nullable) NSString *currency;
- (nullable PSTCKTransactionParams *) setMetadataValue:(nonnull NSString*)value
forKey:(nonnull NSString*)key
error:(NSError * _Nullable __autoreleasing * _Nonnull) error;
- (nullable PSTCKTransactionParams *) setCustomFieldValue:(nonnull NSString*)value
displayedAs:(nonnull NSString*)display_name
error:(NSError * _Nullable __autoreleasing * _Nonnull) error;
@end
| //
// PSTCKTransactionParams.h
// Paystack
//
#import <Foundation/Foundation.h>
#import "PSTCKFormEncodable.h"
/**
* Representation of the transaction to perform on a card
*/
@interface PSTCKTransactionParams : NSObject<PSTCKFormEncodable>
@property (nonatomic, copy, nonnull) NSString *email;
@property (nonatomic) NSUInteger amount;
@property (nonatomic, copy, nullable) NSString *reference;
@property (nonatomic, copy, nullable) NSString *subaccount;
@property (nonatomic) NSInteger transaction_charge;
@property (nonatomic, copy, nullable) NSString *bearer;
@property (nonatomic, readonly, nullable) NSString *metadata;
@property (nonatomic, nullable) NSString *plan;
@property (nonatomic, nullable) NSString *currency;
- (nullable PSTCKTransactionParams *) setMetadataValue:(nonnull NSString*)value
forKey:(nonnull NSString*)key
error:(NSError * _Nullable __autoreleasing * _Nonnull) error;
- (nullable PSTCKTransactionParams *) setCustomFieldValue:(nonnull NSString*)value
displayedAs:(nonnull NSString*)display_name
error:(NSError * _Nullable __autoreleasing * _Nonnull) error;
@end
| Make sure plan and currency are not readonly | [fix] Make sure plan and currency are not readonly
| C | mit | PaystackHQ/paystack-ios,PaystackHQ/paystack-ios,PaystackHQ/paystack-ios,PaystackHQ/paystack-ios |
e0540dc80d92c82729dc8b40aeae20d3011dc46e | decl.h | decl.h | #ifndef DECL_H
#define DECL_H
#include <stdlib.h>
typedef enum DeclSpec {
DECL_SPEC_NONE = 0x0,
DECL_SPEC_FLOAT = 0x1,
DECL_SPEC_INT = 0x2,
DECL_SPEC_SIGNED = 0x4,
DECL_SPEC_UNSIGNED = 0x8,
DECL_SPEC_VOID = 0x10,
} DeclSpec;
typedef size_t DeclSpecs;
#endif
| #ifndef DECL_H
#define DECL_H
#include <stdint.h>
typedef enum DeclSpec {
DECL_SPEC_NONE = 0x0,
DECL_SPEC_FLOAT = 0x1,
DECL_SPEC_INT = 0x2,
DECL_SPEC_SIGNED = 0x4,
DECL_SPEC_UNSIGNED = 0x8,
DECL_SPEC_VOID = 0x10,
} DeclSpec;
typedef uint16_t DeclSpecs;
#endif
| Change type of DeclSpecs to uint16_t | Change type of DeclSpecs to uint16_t
Using size_t was a bit overkill.
| C | unlicense | InternetUnexplorer/Periapsis-CC |
8be89090023f91110dd9cabc7e716a85942abbe0 | ext/dlib/missing.h | ext/dlib/missing.h | #ifndef DLIB_MISSING_H
#define DLIB_MISSING_H
#include <ruby/ruby.h>
#if defined(__cplusplus)
extern "C" {
#if 0
} /* satisfy cc-mode */
#endif
#endif
#ifndef HAVE_RB_GET_KWARGS
int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *values);
#endif
#if defined(__cplusplus)
#if 0
{ /* satisfy cc-mode */
#endif
} /* extern "C" { */
#endif
#endif /* DLIB_MISSING_H */
| #ifndef DLIB_MISSING_H
#define DLIB_MISSING_H
#include <ruby/ruby.h>
#if defined(__cplusplus)
extern "C" {
#if 0
} /* satisfy cc-mode */
#endif
#endif
int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *values);
#if defined(__cplusplus)
#if 0
{ /* satisfy cc-mode */
#endif
} /* extern "C" { */
#endif
#endif /* DLIB_MISSING_H */
| Remove gard around of the prototype declaration of rb_get_kwargs for Ruby 2.1.x | Remove gard around of the prototype declaration of rb_get_kwargs for Ruby 2.1.x
| C | mit | mrkn/ruby-dlib,ruby-dlib/ruby-dlib,mrkn/ruby-dlib,ruby-dlib/ruby-dlib,ruby-dlib/ruby-dlib,ruby-dlib/ruby-dlib,mrkn/ruby-dlib,ruby-dlib/ruby-dlib,mrkn/ruby-dlib,mrkn/ruby-dlib,ruby-dlib/ruby-dlib,mrkn/ruby-dlib,ruby-dlib/ruby-dlib,ruby-dlib/ruby-dlib,mrkn/ruby-dlib,mrkn/ruby-dlib,ruby-dlib/ruby-dlib |
38b86922ff11a6b6ce4c44109e303195230c9483 | include/config/SkUserConfigManual.h | include/config/SkUserConfigManual.h | /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)
#define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)
#define SK_USE_FREETYPE_EMBOLDEN
// Disable these Ganesh features
#define SK_DISABLE_REDUCE_OPLIST_SPLITTING
// Check error is expensive. HWUI historically also doesn't check its allocations
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0
// Legacy flags
#define SK_IGNORE_GPU_DITHER
#define SK_SUPPORT_DEPRECATED_CLIPOPS
// Needed until we fix https://bug.skia.org/2440
#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
#define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
#define SK_SUPPORT_LEGACY_AA_CHOICE
#define SK_SUPPORT_LEGACY_AAA_CHOICE
#define SK_DISABLE_DAA // skbug.com/6886
// b/145995037
#define SK_LEGACY_WEBP_LOOP_COUNT
#endif // SkUserConfigManual_DEFINED
| /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)
#define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)
#define SK_USE_FREETYPE_EMBOLDEN
// Disable these Ganesh features
#define SK_DISABLE_REDUCE_OPLIST_SPLITTING
// Check error is expensive. HWUI historically also doesn't check its allocations
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0
// Legacy flags
#define SK_IGNORE_GPU_DITHER
#define SK_SUPPORT_DEPRECATED_CLIPOPS
// Needed until we fix https://bug.skia.org/2440
#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
#define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
#define SK_SUPPORT_LEGACY_AA_CHOICE
#define SK_SUPPORT_LEGACY_AAA_CHOICE
#define SK_DISABLE_DAA // skbug.com/6886
#endif // SkUserConfigManual_DEFINED
| Enable a WebP AID to show its animation one time | Enable a WebP AID to show its animation one time
Bug: 145995037
Test: I3d1032b5605c5b6ea64cee0cda91c2ba2a769da8
As described in https://skia-review.googlesource.com/c/skia/+/259161,
Skia has modified its interpretation of a WebP file's encoded loop
count to match Chromium and the latest WebP intent. This updates to the
new behavior.
Revert "Maintain the legacy behavior for WebP loop count"
This reverts commit c33df657a16fbc23df2b6ec1c38060060cd3608a.
Change-Id: I821744336bab9fd494d6666268c6c95b24b69909
| C | bsd-3-clause | aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia |
8ac7ff143a5bd654ce8092586f887a846a268805 | include/rtupdate.h | include/rtupdate.h | #ifndef _RTUPDATE_H_
#define _RTUPDATE_H_ 1
#define MAXPUPARR 100
#define MAXPUPS 20
#define NOPUPDATE 78787878 // hopefully never a real p-value!
/* For rtperf */
/* DJT: modified to work with JG's objlib.h */
typedef enum {
NONE,
ATTACK,
DECAY,
SUSTAIN,
RELEASE,
END
} EnvType;
GLOBAL int curtag; /* current note tag */
GLOBAL int tags_on; /* using note tags for rtupdates */
GLOBAL int tag_sem;
/* contains the values to be updated -- a recirculating array */
GLOBAL float pupdatevals[MAXPUPARR][MAXPUPS];
#endif
| #ifndef _RTUPDATE_H_
#define _RTUPDATE_H_ 1
#define MAXPUPARR 100
#define MAXPUPS 20
#define NOPUPDATE 78787878 // hopefully never a real p-value!
/* For rtperf */
/* DJT: modified to work with JG's objlib.h */
typedef enum {
NONE,
RISE,
SUSTAIN,
DECAY
} EnvType;
#ifndef GLOBAL
#define GLOBAL extern
#endif
GLOBAL int curtag; /* current note tag */
GLOBAL int tags_on; /* using note tags for rtupdates */
GLOBAL int tag_sem;
/* contains the values to be updated -- a recirculating array */
GLOBAL float pupdatevals[MAXPUPARR][MAXPUPS];
#endif
| Reset EnvType and changed objdefs.h | Reset EnvType and changed objdefs.h
| C | apache-2.0 | RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix |
2ee76a586066f76ded155a910c4065fbbe198032 | src/rosecommon/include/components/warpgate.h | src/rosecommon/include/components/warpgate.h | #pragma once
#include <cmath>
#include <tuple>
namespace Component {
struct Warpgate {
int16_t id;
float min_x;
float min_y;
float min_z;
float max_x;
float max_y;
float max_z;
static constexpr float character_size = 2000.f;
uint16_t dest_map;
static constexpr inline float squared(float x) { return x * x; }
std::tuple<float, float, float> get_center() const {
return {(max_x + min_x) / 2.f, (max_y + min_y) / 2.f, (max_z + min_z) / 2.f};
}
bool is_point_in(float x, float y, [[maybe_unused]] float z) {
float dist_squared = squared(character_size);
if (x < min_x) dist_squared -= squared(x - min_x);
else if (x > max_x) dist_squared -= squared(x - max_x);
if (y < min_y) dist_squared -= squared(y - min_y);
else if (y > max_y) dist_squared -= squared(y - max_y);
//if (z < min_z) dist_squared -= squared(z - min_z);
//else if (z > max_z) dist_squared -= squared(z - max_z);
return dist_squared > 0;
}
};
}
| #pragma once
#include <cmath>
#include <tuple>
namespace Component {
struct Warpgate {
int16_t id;
float min_x;
float min_y;
float min_z;
float max_x;
float max_y;
float max_z;
static constexpr float character_size = 200.f;
uint16_t dest_map;
static constexpr inline float squared(float x) { return x * x; }
std::tuple<float, float, float> get_center() const {
return {(max_x + min_x) / 2.f, (max_y + min_y) / 2.f, (max_z + min_z) / 2.f};
}
bool is_point_in(float x, float y, [[maybe_unused]] float z) {
float dist_squared = squared(character_size);
if (x < min_x) dist_squared -= squared(x - min_x);
else if (x > max_x) dist_squared -= squared(x - max_x);
if (y < min_y) dist_squared -= squared(y - min_y);
else if (y > max_y) dist_squared -= squared(y - max_y);
//if (z < min_z) dist_squared -= squared(z - min_z);
//else if (z > max_z) dist_squared -= squared(z - max_z);
return dist_squared > 0;
}
};
}
| Reduce character size to 2 units | Reduce character size to 2 units
| C | apache-2.0 | RavenX8/osIROSE-new,dev-osrose/osIROSE-new,RavenX8/osIROSE-new,dev-osrose/osIROSE-new,RavenX8/osIROSE-new,dev-osrose/osIROSE-new |
38fdeceb8c64ea45498275abaa15956f73712423 | src/app/contextBroker/version.h | src/app/contextBroker/version.h | #ifndef SRC_APP_CONTEXTBROKER_VERSION_H_
#define SRC_APP_CONTEXTBROKER_VERSION_H_
/*
*
* Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U
*
* This file is part of Orion Context Broker.
*
* Orion Context Broker is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Orion Context Broker is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
* General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Orion Context Broker. If not, see http://www.gnu.org/licenses/.
*
* For those usages not covered by this license please contact with
* iot_support at tid dot es
*
* Author: Ken Zangelin
*/
#define ORION_VERSION "0.21.0-nextç"
#endif // SRC_APP_CONTEXTBROKER_VERSION_H_
| #ifndef SRC_APP_CONTEXTBROKER_VERSION_H_
#define SRC_APP_CONTEXTBROKER_VERSION_H_
/*
*
* Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U
*
* This file is part of Orion Context Broker.
*
* Orion Context Broker is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Orion Context Broker is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
* General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Orion Context Broker. If not, see http://www.gnu.org/licenses/.
*
* For those usages not covered by this license please contact with
* iot_support at tid dot es
*
* Author: Ken Zangelin
*/
#define ORION_VERSION "0.21.0-next"
#endif // SRC_APP_CONTEXTBROKER_VERSION_H_
| FIX typo: 0.21-nextç -> 0.21.0-next | FIX typo: 0.21-nextç -> 0.21.0-next
| C | agpl-3.0 | telefonicaid/fiware-orion,fortizc/fiware-orion,yalp/fiware-orion,j1fig/fiware-orion,gavioto/fiware-orion,pacificIT/fiware-orion,McMutton/fiware-orion,fortizc/fiware-orion,Fiware/context.Orion,McMutton/fiware-orion,pacificIT/fiware-orion,fiwareulpgcmirror/fiware-orion,Fiware/data.Orion,pacificIT/fiware-orion,jmcanterafonseca/fiware-orion,fortizc/fiware-orion,jmcanterafonseca/fiware-orion,Fiware/context.Orion,j1fig/fiware-orion,Fiware/data.Orion,jmcanterafonseca/fiware-orion,fiwareulpgcmirror/fiware-orion,yalp/fiware-orion,fiwareulpgcmirror/fiware-orion,telefonicaid/fiware-orion,telefonicaid/fiware-orion,fortizc/fiware-orion,Fiware/data.Orion,gavioto/fiware-orion,j1fig/fiware-orion,yalp/fiware-orion,j1fig/fiware-orion,McMutton/fiware-orion,guerrerocarlos/fiware-orion,fiwareulpgcmirror/fiware-orion,telefonicaid/fiware-orion,McMutton/fiware-orion,gavioto/fiware-orion,gavioto/fiware-orion,McMutton/fiware-orion,McMutton/fiware-orion,Fiware/context.Orion,Fiware/data.Orion,jmcanterafonseca/fiware-orion,telefonicaid/fiware-orion,yalp/fiware-orion,fiwareulpgcmirror/fiware-orion,guerrerocarlos/fiware-orion,telefonicaid/fiware-orion,Fiware/context.Orion,guerrerocarlos/fiware-orion,fortizc/fiware-orion,pacificIT/fiware-orion,Fiware/data.Orion,McMutton/fiware-orion,j1fig/fiware-orion,yalp/fiware-orion,Fiware/context.Orion,jmcanterafonseca/fiware-orion,gavioto/fiware-orion,guerrerocarlos/fiware-orion,pacificIT/fiware-orion,jmcanterafonseca/fiware-orion,fiwareulpgcmirror/fiware-orion,fortizc/fiware-orion,Fiware/data.Orion,Fiware/context.Orion,guerrerocarlos/fiware-orion |
41ee268a0a7641835821d0d53e67e04b1c821f1a | sh4.h | sh4.h | #ifndef __sh4_h__
#define __sh4_h__
enum {
SH4_BASE = 0x4000,
Rm,
Rn,
FRm,
FRn,
i8,
i20,
Pr15, // [R15++]
Dn, // [--Rn]
Pn, // [Rn++]
dn, // [Rn]
dn0, // [Rn+R0]
d4n, // [Rn+d4]
d12n, // [Rn+d12]
Dm, // [--Rm]
Pm, // [Rm++]
dm, // [Rm]
dm0, // [Rm+R0]
d4m, // [Rm+d4]
d12m, // [Rm+d12]
dmp, // [Rm+PC]
d8g, // [GBR+d8]
dr0g, // [GBR+R0]
d8p, // [PC+d8]
j8,
j12,
_fT,
_fS,
_fM,
_fQ,
SIZE_FLOAT = 'f' << SIZE_SHIFT,
R0 = TYPE_REG+SIZE_DWORD,
R15 = TYPE_REG+SIZE_DWORD+15,
PC = TYPE_REG+SIZE_DWORD+16,
rMACH,
rMACL,
rPR,
rSGR,
rDSR,
rFPUL,
rA0,
rX0,
rX1,
rY0,
rY1,
rDBR,
rGBR,
rVBR,
rTBR,
rSSR,
rSR,
rSPC,
rMOD,
rRS,
rRE,
};
#endif
| Move SH4 definitions to header file | Move SH4 definitions to header file
| C | mit | jharg/tinydis |
|
e886106cb7bb55ac587aa09c2957ae63cef458eb | src/rtpp_debugon.h | src/rtpp_debugon.h | /*
* Copyright (c) 2019 Sippy Software, Inc., http://www.sippysoft.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
/* Do not include directly, droppen in automatically */
#include "rtpp_memdeb.h"
#include "rtpp_autoglitch.h"
| Add centralized header which would include all other debug headers (memdeb, glitching at the moment). | Add centralized header which would include all other debug
headers (memdeb, glitching at the moment).
| C | bsd-2-clause | sippy/rtpproxy,dsanders11/rtpproxy,sippy/rtpproxy,dsanders11/rtpproxy,sippy/rtpproxy,dsanders11/rtpproxy |
|
690ee200b01d8d94aadb7d47778ccc1cef92d097 | tests/regression/02-base/70-escape-unknown.c | tests/regression/02-base/70-escape-unknown.c | #include <pthread.h>
#include <assert.h>
int *p;
void *t_fun(void *arg) {
if (arg != NULL) {
*((int*)arg) = 42;
}
return NULL;
}
int main() {
pthread_t id, id2;
int *r; // unknown
int i = 5;
pthread_create(&id, NULL, t_fun, NULL); // enter multithreaded
p = r;
p = &i;
pthread_create(&id2, NULL, t_fun, p); // i should escape, even if p contains unknown
assert(i == 5); // UNKNOWN!
return 0;
} | Add test where address containing unknown should escape known | Add test where address containing unknown should escape known
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
4eac43e1548ee38d9ff3e1ce348090e4fb6170ed | src/runtime/buf_size.h | src/runtime/buf_size.h | #ifndef HALIDE_BUF_SIZE_H
#define HALIDE_BUF_SIZE_H
// TODO: in new buffer_t, add an inline method to do this and kill this file.
// Compute the total amount of memory we'd need to allocate on gpu to
// represent a given buffer (using the same strides as the host
// allocation).
WEAK size_t buf_size(const buffer_t *buf) {
size_t size = buf->elem_size;
for (size_t i = 0; i < sizeof(buf->stride) / sizeof(buf->stride[0]); i++) {
size_t positive_stride;
if (buf->stride[i] < 0) {
positive_stride = (size_t)-buf->stride[i];
} else {
positive_stride = (size_t)buf->stride[i];
}
size_t total_dim_size = buf->elem_size * buf->extent[i] * positive_stride;
if (total_dim_size > size) {
size = total_dim_size;
}
}
return size;
}
#endif // HALIDE_BUF_SIZE_H
| Add new file that was forgotten. | Add new file that was forgotten.
Former-commit-id: b3d410c04e682cdb096bc1211544b9cf6a7186bf | C | mit | darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide |
|
941fc625118da6210a2d666d596d7ca318110803 | elang/lir/emitters/code_buffer_user.h | elang/lir/emitters/code_buffer_user.h | // Copyright 2015 Project Vogue. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ELANG_LIR_EMITTERS_CODE_BUFFER_USER_H_
#define ELANG_LIR_EMITTERS_CODE_BUFFER_USER_H_
#include "base/basictypes.h"
namespace elang {
namespace lir {
class CodeBuffer;
struct Value;
//////////////////////////////////////////////////////////////////////
//
// CodeBufferUser
//
class CodeBufferUser {
protected:
explicit CodeBufferUser(CodeBuffer* code_buffer);
~CodeBufferUser();
void AssociateValue(Value value);
void Emit16(int data);
void Emit32(uint32_t data);
void Emit64(uint64_t data);
void Emit8(int data);
private:
CodeBuffer* const code_buffer_;
DISALLOW_COPY_AND_ASSIGN(CodeBufferUser);
};
} // namespace lir
} // namespace elang
#endif // ELANG_LIR_EMITTERS_CODE_BUFFER_USER_H_
| // Copyright 2015 Project Vogue. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ELANG_LIR_EMITTERS_CODE_BUFFER_USER_H_
#define ELANG_LIR_EMITTERS_CODE_BUFFER_USER_H_
#include "base/basictypes.h"
namespace elang {
namespace lir {
class CodeBuffer;
struct Value;
//////////////////////////////////////////////////////////////////////
//
// CodeBufferUser
//
class CodeBufferUser {
protected:
explicit CodeBufferUser(CodeBuffer* code_buffer);
~CodeBufferUser();
CodeBuffer* code_buffer() const { return code_buffer_; }
void AssociateValue(Value value);
void Emit16(int data);
void Emit32(uint32_t data);
void Emit64(uint64_t data);
void Emit8(int data);
private:
CodeBuffer* const code_buffer_;
DISALLOW_COPY_AND_ASSIGN(CodeBufferUser);
};
} // namespace lir
} // namespace elang
#endif // ELANG_LIR_EMITTERS_CODE_BUFFER_USER_H_
| Introduce |CodeBufferUser::code_buffer()| to use |CodeBuffer::EmitJump()| for 'br' instruction emitter. | elang/lir/emitters: Introduce |CodeBufferUser::code_buffer()| to use |CodeBuffer::EmitJump()| for 'br' instruction emitter.
| C | apache-2.0 | eval1749/elang,eval1749/elang,eval1749/elang,eval1749/elang,eval1749/elang |
0eaaa9f685cb0200d69f9df901828bb0baf959e5 | 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 *);
#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);
#endif | Add List Node destroy function declaration | Add List Node destroy function declaration
| C | mit | MaxLikelihood/CADT |
94ada1be3db0c968c4948074ee38144d98389e71 | test/Frontend/rewrite-includes-bom.c | test/Frontend/rewrite-includes-bom.c | // RUN: %clang -E -frewrite-includes -I %S/Inputs %s -o - | %clang -fsyntax-only -Xclang -verify -x c -
// expected-no-diagnostics
#include "rewrite-includes-bom.h"
| // RUN: grep '^\xEF\xBB\xBF' %S/Inputs/rewrite-includes-bom.h
// RUN: %clang_cc1 -E -frewrite-includes -I %S/Inputs %s -o - | %clang_cc1 -fsyntax-only -verify -x c - | not grep '\xEF\xBB\xBF'
// expected-no-diagnostics
#include "rewrite-includes-bom.h"
| Improve BOM test from r195877 | Improve BOM test from r195877
1) Use %clang_cc1 instead of the driver
2) Validate that the input contains a BOM
3) Validate that the BOM has been stripped from the output
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@195886 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang |
0c46e1fccad4e19eda5c380eb648324eb7c8a32e | src/common/file_manager_interface.h | src/common/file_manager_interface.h | #ifndef _FILE_MANAGER_INTERFACE_
#define _FILE_MANAGER_INTERFACE_
#include <string>
#include <cstdint>
class FileManagerInterface {
public:
virtual bool send(
const std::string & host,
const unsigned short host_port,
std::string & file_path,
uint64_t from = 0,
uint64_t to = -1) = 0;
virtual ~FileManagerInterface(){};
};
#endif // _FILE_MANAGER_INTERFACE_
| #ifndef _FILE_MANAGER_INTERFACE_
#define _FILE_MANAGER_INTERFACE_
#include <string>
#include <cstdint>
class FileManagerInterface {
public:
virtual uint64_t send(
const std::string & host,
const unsigned short host_port,
std::string & file_path,
uint64_t from = 0,
uint64_t to = -1) = 0;
virtual std::std::vector<uint64_t> getIds() = 0;
virtual ~FileManagerInterface(){};
};
#endif // _FILE_MANAGER_INTERFACE_
| Add getIds to file manager | Add getIds to file manager
| C | mit | Plamenod/P2P |
c1dcd68ee1100bf66f10e2461c0b1e98db3a7ba9 | lib/node_modules/@stdlib/strided/common/include/stdlib/strided_dtypes.h | lib/node_modules/@stdlib/strided/common/include/stdlib/strided_dtypes.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 for strided array data types.
*/
#ifndef STDLIB_STRIDED_DTYPES_H
#define STDLIB_STRIDED_DTYPES_H
enum STDLIB_STRIDED_DTYPES {
STDLIB_BOOL = 0,
STDLIB_INT8 = 1,
STDLIB_UINT8 = 2,
STDLIB_INT16 = 3,
STDLIB_UINT16 = 4,
STDLIB_INT32 = 5,
STDLIB_UINT32 = 6,
STDLIB_INT64 = 7,
STDLIB_UINT64 = 8,
STDLIB_INT128 = 9,
STDLIB_UINT128 = 10,
STDLIB_FLOAT16 = 20,
STDLIB_FLOAT32 = 21,
STDLIB_FLOAT64 = 22,
STDLIB_FLOAT128 = 23
};
#endif // !STDLIB_STRIDED_DTYPES_H
| Enumerate strided array data types | Enumerate strided array data types
| 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 |
|
05dd991df57aa4b918260912691cc0a1049044ae | 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 | C | bsd-3-clause | cartazio/language-c,cartazio/language-c,cartazio/language-c |
|
88a88431d2d22fd5f2ba1844670b7b67f58ad92f | templates/c/main.c | templates/c/main.c | #include <display.h>
/* Warning! C support in KnightOS is highly experimental. Your milage may vary. */
void main(void) {
SCREEN *screen;
get_lcd_lock();
screen = screen_allocate();
screen_clear(screen);
draw_string(screen, 0, 0, "Hello world!");
screen_draw(screen);
while (1);
}
| #include <display.h>
/* Warning! C support in KnightOS is highly experimental. Your mileage may vary. */
void main(void) {
SCREEN *screen;
get_lcd_lock();
screen = screen_allocate();
screen_clear(screen);
draw_string(screen, 0, 0, "Hello world!");
screen_draw(screen);
while (1);
}
| Fix typo in C template | Fix typo in C template
Thanks @klange
| C | mit | KnightOS/sdk,KnightOS/sdk,KnightOS/sdk |
7b421e3feaffdc8a7daaeb4f0da65cf23a7166c5 | bst.h | bst.h | #include <stdlib.h>
#ifndef __BST_H__
#define __BST_H__
struct BSTNode;
struct BST;
typedef struct BSTNode BSTNode;
typedef struct BST BST;
BST* BST_Create(void);
#endif | #include <stdlib.h>
#ifndef __BST_H__
#define __BST_H__
struct BSTNode;
struct BST;
typedef struct BSTNode BSTNode;
typedef struct BST BST;
BST* BST_Create(void);
BSTNode* BSTNode_Create(void* k);
#endif | Add BSTNode Create function declaration | Add BSTNode Create function declaration
| C | mit | MaxLikelihood/CADT |
a0f7873e71dd708b3193fffe35204f2f32fbde45 | program/test/vertigo_v2_config.h | program/test/vertigo_v2_config.h | //Vertigo v2.0 board setting
#define USE_FUTABA
#define USE_IMU_MPU9250
#define USE_ADS1246_MPX6115A
#define STM32F427X
| Add a mssissing file at previous commit | Add a mssissing file at previous commit
| C | mit | ming6842/firmware-new,fboris/firmware,UrsusPilot/firmware,fboris/firmware,fboris/firmware,UrsusPilot/firmware,ming6842/firmware,ming6842/firmware,ming6842/firmware-new,ming6842/firmware-new,UrsusPilot/firmware,ming6842/firmware |
|
8f91e164d1d23a3b0dc751bc0f9185af27dcb2c7 | os/gl/gl_context.h | os/gl/gl_context.h | // LAF OS Library
// Copyright (C) 2022 Igara Studio S.A.
// Copyright (C) 2015-2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef OS_GL_CONTEXT_INCLUDED
#define OS_GL_CONTEXT_INCLUDED
#pragma once
namespace os {
class GLContext {
public:
virtual ~GLContext() { }
virtual bool isValid() { return false; }
virtual bool createGLContext() { }
virtual void destroyGLContext() { }
virtual void makeCurrent() { }
virtual void swapBuffers() { }
};
} // namespace os
#endif
| // LAF OS Library
// Copyright (C) 2022 Igara Studio S.A.
// Copyright (C) 2015-2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef OS_GL_CONTEXT_INCLUDED
#define OS_GL_CONTEXT_INCLUDED
#pragma once
namespace os {
class GLContext {
public:
virtual ~GLContext() { }
virtual bool isValid() { return false; }
virtual bool createGLContext() { return false; }
virtual void destroyGLContext() { }
virtual void makeCurrent() { }
virtual void swapBuffers() { }
};
} // namespace os
#endif
| Fix GLContext::createGLContext() impl (must return a value) | Fix GLContext::createGLContext() impl (must return a value)
| C | mit | aseprite/laf,aseprite/laf |
0303c2c8b394679f28154451d59cfcf153487e71 | test/Driver/integrated-as.c | test/Driver/integrated-as.c | // RUN: %clang -### -c -save-temps -integrated-as %s 2>&1 | FileCheck %s
// CHECK: cc1as
// CHECK: -mrelax-all
// RUN: %clang -### -fintegrated-as -c -save-temps %s 2>&1 | FileCheck %s -check-prefix FIAS
// FIAS: cc1as
// RUN: %clang -### -fno-integrated-as -S %s 2>&1 \
// RUN: | FileCheck %s -check-prefix NOFIAS
// NOFIAS-NOT: cc1as
// NOFIAS: -cc1
// NOFIAS: -no-integrated-as
| // RUN: %clang -### -c -save-temps -integrated-as %s 2>&1 | FileCheck %s
// CHECK: cc1as
// CHECK: -mrelax-all
// RUN: %clang -### -fintegrated-as -c -save-temps %s 2>&1 | FileCheck %s -check-prefix FIAS
// FIAS: cc1as
// RUN: %clang -target none -### -fno-integrated-as -S %s 2>&1 \
// RUN: | FileCheck %s -check-prefix NOFIAS
// NOFIAS-NOT: cc1as
// NOFIAS: -cc1
// NOFIAS: -no-integrated-as
| Use a dummy target so the test passes when default target is for a toolchain implements useIntegratedAs() -> true | Use a dummy target so the test passes when default target is for a toolchain implements useIntegratedAs() -> true
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@338553 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang |
aca0e26e885f5996cc27c1bf8524a36da3c68431 | bpf/sockops/sockops_config.h | bpf/sockops/sockops_config.h | /*
* Copyright (C) 2018 Authors of Cilium
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef SOCK_OPS_MAP
#define SOCK_OPS_MAP cilium_sock_ops
#endif
#define SOCKOPS_MAP_SIZE 65535
| /*
* Copyright (C) 2018-2019 Authors of Cilium
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef SOCK_OPS_MAP
#define SOCK_OPS_MAP cilium_sock_ops
#endif
#define SOCKOPS_MAP_SIZE 65535
#ifndef CALLS_MAP
#define CALLS_MAP test_cilium_calls
#endif
| Fix sockops map name for testing | bpf: Fix sockops map name for testing
For testing purposes, this config file should contain the testing name
of the map which should be different from the static name used by the
Cilium agent.
Signed-off-by: Joe Stringer <[email protected]>
| C | apache-2.0 | cilium/cilium,tgraf/cilium,cilium/cilium,michi-covalent/cilium,michi-covalent/cilium,tgraf/cilium,tklauser/cilium,tgraf/cilium,cilium/cilium,michi-covalent/cilium,tklauser/cilium,tklauser/cilium,tklauser/cilium,michi-covalent/cilium,tgraf/cilium,cilium/cilium,michi-covalent/cilium,tgraf/cilium,cilium/cilium,tklauser/cilium,tgraf/cilium,cilium-team/cilium,cilium-team/cilium |
f418b2182b8dbae45906ded6b4aedc07ffb7d90c | ext/glib/glib.c | ext/glib/glib.c | #include <ruby.h>
#include <glib.h>
static VALUE utf8_size(VALUE self, VALUE string)
{
VALUE result;
Check_Type(string, T_STRING);
result = ULONG2NUM(g_utf8_strlen(StringValuePtr(string), RSTRING(string)->len));
return result;
}
static VALUE utf8_upcase(VALUE self, VALUE string)
{
VALUE result;
gchar *temp;
Check_Type(string, T_STRING);
temp = g_utf8_strup(StringValuePtr(string), RSTRING(string)->len);
result = rb_str_new2(temp);
return result;
}
static VALUE utf8_downcase(VALUE self, VALUE string)
{
VALUE result;
gchar *temp;
Check_Type(string, T_STRING);
temp = g_utf8_strdown(StringValuePtr(string), RSTRING(string)->len);
result = rb_str_new2(temp);
return result;
}
void
Init_glib()
{
VALUE mGlib;
mGlib = rb_define_module("Glib");
rb_define_method(mGlib, "utf8_size", utf8_size, 1);
rb_define_method(mGlib, "utf8_upcase", utf8_upcase, 1);
rb_define_method(mGlib, "utf8_downcase", utf8_downcase, 1);
}
| #include <ruby.h>
#include <glib.h>
static VALUE utf8_size(VALUE self, VALUE string)
{
VALUE result;
Check_Type(string, T_STRING);
result = ULONG2NUM(g_utf8_strlen(StringValuePtr(string), RSTRING(string)->len));
return result;
}
static VALUE utf8_upcase(VALUE self, VALUE string)
{
VALUE result;
gchar *temp;
Check_Type(string, T_STRING);
temp = g_utf8_strup(StringValuePtr(string), RSTRING(string)->len);
result = rb_str_new2(temp);
return result;
}
static VALUE utf8_downcase(VALUE self, VALUE string)
{
VALUE result;
gchar *temp;
Check_Type(string, T_STRING);
temp = g_utf8_strdown(StringValuePtr(string), RSTRING(string)->len);
result = rb_str_new2(temp);
return result;
}
void
Init_glib()
{
VALUE mGlib;
mGlib = rb_define_module("Glib");
rb_define_module_function(mGlib, "utf8_size", utf8_size, 1);
rb_define_module_function(mGlib, "utf8_upcase", utf8_upcase, 1);
rb_define_module_function(mGlib, "utf8_downcase", utf8_downcase, 1);
}
| Define the Glib functions as module functions. | Define the Glib functions as module functions.
| C | mit | Manfred/unichars,Manfred/unichars |
5be7b1cb2ca955b29e43536422ce6f81f5a790bd | Tests/testing_util.h | Tests/testing_util.h | #pragma once
#ifndef TESTING_UTIL_H
#define TESTING_UTIL_H 1
#include <Python.h>
/**
Use RAII to Py_XDECREF a pointer.
Inspired by std::unique_ptr.
*/
template <class T> class py_ptr {
private:
T* m_ptr;
public:
py_ptr() : m_ptr(nullptr) {}
py_ptr(T* ptr) : m_ptr(ptr) {}
~py_ptr() {
Py_XDECREF(m_ptr);
}
void reset(T* ptr) {
Py_XDECREF(m_ptr);
m_ptr = ptr;
}
T* get() {
return m_ptr;
}
T* operator->() {
return m_ptr;
}
};
/**
A concrete PyObject instance of py_ptr.
*/
class PyObject_ptr : public py_ptr<PyObject> {
public:
PyObject_ptr(PyObject *ptr) : py_ptr(ptr) {}
};
PyCodeObject* CompileCode(const char*);
#endif // !TESTING_UTIL_H
| #pragma once
#ifndef TESTING_UTIL_H
#define TESTING_UTIL_H 1
#include <Python.h>
/**
Use RAII to Py_XDECREF a pointer.
Inspired by std::unique_ptr.
*/
template <class T> class py_ptr {
private:
T* m_ptr;
public:
py_ptr() : m_ptr(nullptr) {}
py_ptr(T* ptr) : m_ptr(ptr) {}
py_ptr(const py_ptr& copy) {
m_ptr = copy.get();
Py_INCREF(m_ptr);
}
~py_ptr() {
Py_XDECREF(m_ptr);
}
void reset(T* ptr) {
Py_XDECREF(m_ptr);
m_ptr = ptr;
}
T* get() {
return m_ptr;
}
T* operator->() {
return m_ptr;
}
T* operator*() {
return m_ptr;
}
};
/**
A concrete PyObject instance of py_ptr.
*/
class PyObject_ptr : public py_ptr<PyObject> {
public:
PyObject_ptr(PyObject *ptr) : py_ptr(ptr) {}
};
PyCodeObject* CompileCode(const char*);
#endif // !TESTING_UTIL_H
| Add a copy constructor and * overload | Add a copy constructor and * overload
| C | mit | Microsoft/Pyjion,Microsoft/Pyjion,DinoV/Pyjion-1,DinoV/Pyjion-1,Microsoft/Pyjion,brettcannon/Pyjion,brettcannon/Pyjion,DinoV/Pyjion-1,Microsoft/Pyjion,DinoV/Pyjion-1,brettcannon/Pyjion |
1fd1905d4c7ef06723099f082b6cedfc50171c8d | kilo.c | kilo.c | #include <unistd.h>
int main(int argc, char *argv[])
{
char c;
// Read 1 byte at a time
while(read(STDIN_FILENO, &c, 1) == 1);
return 0;
}
| #include <ctype.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <termios.h>
struct termios orig_termios;
void enableRawMode();
void disableRawMode();
int main(int argc, char *argv[])
{
enableRawMode();
// Read 1 byte at a time
while(1){
char input = '\0'; // Input from user
read(STDIN_FILENO, &input, 1);
if(iscntrl(input)) {
printf("%d\r\n", input);
} else {
printf("%d ('%c')\r\n", input, input);
}
if(input == 'q') break;
}
return 0;
}
void enableRawMode(){
tcgetattr(STDIN_FILENO, &orig_termios);
atexit(disableRawMode);
struct termios raw;
tcgetattr(STDIN_FILENO,&raw);
// Flags to enable raw mode
raw.c_iflag &= ~(BRKINT | ICRNL | IXON | ISTRIP | INPCK);
raw.c_oflag &= ~(OPOST);
raw.c_cflag |= (CS8);
raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
//
raw.c_cc[VMIN] = 0; // Value sets minimum number of bytes of input needed bfore read() can return. Set so it returns right away
raw.c_cc[VTIME] = 1; // Maximum amount of time read waits to return, in tenths of seconds
tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw);
}
void disableRawMode(){
tcsetattr(STDERR_FILENO,TCSAFLUSH,&orig_termios);
}
| Enable and disable raw mode in terminal | Enable and disable raw mode in terminal
| C | bsd-2-clause | justinbarclay/tedit |
965b215fcf513150671168750f77f624dc369abe | src/proxy.h | src/proxy.h | // Copyright 2014 Toggl Desktop developers.
#ifndef SRC_PROXY_H_
#define SRC_PROXY_H_
#include <string>
#include "./types.h"
#include "Poco/Types.h"
namespace kopsik {
class Proxy {
public:
Proxy() :
host(""),
port(0),
username(""),
password("") {}
bool IsConfigured() const;
bool HasCredentials() const;
std::string String() const;
std::string host;
Poco::UInt16 port;
std::string username;
std::string password;
};
} // namespace kopsik
#endif // SRC_PROXY_H_
| // Copyright 2014 Toggl Desktop developers.
#ifndef SRC_PROXY_H_
#define SRC_PROXY_H_
#include <string>
#include "./types.h"
#include "Poco/Types.h"
namespace kopsik {
class Proxy {
public:
Proxy() :
host(""),
port(0),
username(""),
password("") {}
bool IsConfigured() const;
bool HasCredentials() const;
std::string String() const;
std::string host;
Poco::UInt64 port;
std::string username;
std::string password;
};
} // namespace kopsik
#endif // SRC_PROXY_H_
| Use same int 64 type | Use same int 64 type
| C | bsd-3-clause | codeman38/toggldesktop,codeman38/toggldesktop,codeman38/toggldesktop,codeman38/toggldesktop,codeman38/toggldesktop,codeman38/toggldesktop |
229a3770f699e8688d0d6c798920ac5a497ada44 | include/llvm/Transforms/Utils/BasicBlockUtils.h | include/llvm/Transforms/Utils/BasicBlockUtils.h | //===-- Transform/Utils/BasicBlockUtils.h - BasicBlock Utilities -*- C++ -*-==//
//
// This family of functions perform manipulations on basic blocks, and
// instructions contained within basic blocks.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TRANSFORMS_UTILS_BASICBLOCK_H
#define LLVM_TRANSFORMS_UTILS_BASICBLOCK_H
// FIXME: Move to this file: BasicBlock::removePredecessor, BB::splitBasicBlock
#include "llvm/BasicBlock.h"
class Instruction;
// ReplaceInstWithValue - Replace all uses of an instruction (specified by BI)
// with a value, then remove and delete the original instruction.
//
void ReplaceInstWithValue(BasicBlock::InstListType &BIL,
BasicBlock::iterator &BI, Value *V);
// ReplaceInstWithInst - Replace the instruction specified by BI with the
// instruction specified by I. The original instruction is deleted and BI is
// updated to point to the new instruction.
//
void ReplaceInstWithInst(BasicBlock::InstListType &BIL,
BasicBlock::iterator &BI, Instruction *I);
// ReplaceInstWithInst - Replace the instruction specified by From with the
// instruction specified by To. Note that this is slower than providing an
// iterator directly, because the basic block containing From must be searched
// for the instruction.
//
void ReplaceInstWithInst(Instruction *From, Instruction *To);
#endif
| //===-- Transform/Utils/BasicBlockUtils.h - BasicBlock Utilities -*- C++ -*-==//
//
// This family of functions perform manipulations on basic blocks, and
// instructions contained within basic blocks.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TRANSFORMS_UTILS_BASICBLOCK_H
#define LLVM_TRANSFORMS_UTILS_BASICBLOCK_H
// FIXME: Move to this file: BasicBlock::removePredecessor, BB::splitBasicBlock
#include "llvm/BasicBlock.h"
class Instruction;
// ReplaceInstWithValue - Replace all uses of an instruction (specified by BI)
// with a value, then remove and delete the original instruction.
//
void ReplaceInstWithValue(BasicBlock::InstListType &BIL,
BasicBlock::iterator &BI, Value *V);
// ReplaceInstWithInst - Replace the instruction specified by BI with the
// instruction specified by I. The original instruction is deleted and BI is
// updated to point to the new instruction.
//
void ReplaceInstWithInst(BasicBlock::InstListType &BIL,
BasicBlock::iterator &BI, Instruction *I);
// ReplaceInstWithInst - Replace the instruction specified by From with the
// instruction specified by To.
//
void ReplaceInstWithInst(Instruction *From, Instruction *To);
// RemoveSuccessor - Change the specified terminator instruction such that its
// successor #SuccNum no longer exists. Because this reduces the outgoing
// degree of the current basic block, the actual terminator instruction itself
// may have to be changed. In the case where the last successor of the block is
// deleted, a return instruction is inserted in its place which can cause a
// suprising change in program behavior if it is not expected.
//
void RemoveSuccessor(TerminatorInst *TI, unsigned SuccNum);
#endif
| Implement a new RemoveSuccessor function | Implement a new RemoveSuccessor function
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@3130 91177308-0d34-0410-b5e6-96231b3b80d8
| C | bsd-2-clause | chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm |
a634d931d606121d6384798ff90e0d07016e522c | include/sampleflow/filters/component_splitter.h | include/sampleflow/filters/component_splitter.h | // ---------------------------------------------------------------------
//
// Copyright (C) 2019 by the SampleFlow authors.
//
// This file is part of the SampleFlow library.
//
// The deal.II library is free software; you can use it, 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.
// The full text of the license can be found in the file LICENSE.md at
// the top level directory of deal.II.
//
// ---------------------------------------------------------------------
#ifndef SAMPLEFLOW_FILTERS_COMPONENT_SPLITTER_H
#define SAMPLEFLOW_FILTERS_COMPONENT_SPLITTER_H
#include <sampleflow/filter.h>
namespace SampleFlow
{
namespace Filters
{
template <typename InputType>
class ComponentSplitter : public Filter<InputType, typename InputType::value_type>
{
public:
ComponentSplitter (const unsigned int selected_component);
virtual
boost::optional<std::pair<InputType, AuxiliaryData> >
filter (InputType sample,
AuxiliaryData aux_data) override;
private:
const unsigned int selected_component;
};
template <typename InputType>
ComponentSplitter<InputType>::
ComponentSplitter (const unsigned int selected_component)
: selected_component(selected_component)
{}
template <typename InputType>
boost::optional<std::pair<InputType, AuxiliaryData> >
ComponentSplitter<InputType>::
filter (InputType sample,
AuxiliaryData aux_data)
{
return
{ std::move(sample[selected_component]), std::move(aux_data)};
}
}
}
#endif
| Add a component splitter filter. | Add a component splitter filter.
| C | lgpl-2.1 | bangerth/mcmc |
|
a9107c562553ccc7310be3774674cbbd77086201 | core/include/cudnn_utility.h | core/include/cudnn_utility.h | // The MIT License (MIT)
//
// Copyright (c) 2016 Northeastern University
//
// 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.
#ifndef CORE_INCLUDE_CUDNN_UTILITY_H_
#define CORE_INCLUDE_CUDNN_UTILITY_H_
#include "cudnn.h"
namespace dnnmark {
} // namespace dnnmark
#endif // CORE_INCLUDE_CUDNN_UTILITY_H_
| Add one empty header file | Add one empty header file
| C | mit | doody1986/DNNMark,doody1986/DNNMark,doody1986/DNNMark,doody1986/DNNMark |
|
f2adc842293ce4fe889309e16da706f321ff713d | bindings/perl/Champlain/champlain-perl.h | bindings/perl/Champlain/champlain-perl.h | #ifndef _CHAMPLAIN_PERL_H_
#include <clutter-perl.h>
#include <champlain/champlain.h>
#ifdef CHAMPLAINPERL_GTK
#include <champlain-gtk/champlain-gtk.h>
#endif
#include "champlain-autogen.h"
#endif /* _CHAMPLAIN_PERL_H_ */
| #ifndef _CHAMPLAIN_PERL_H_
#include <clutter-perl.h>
#include <champlain/champlain.h>
#ifdef CHAMPLAINPERL_GTK
#include <gtk2perl.h>
#include <champlain-gtk/champlain-gtk.h>
#endif
#include "champlain-autogen.h"
#endif /* _CHAMPLAIN_PERL_H_ */
| Revert "Don't include gtk2perl because it redeclares the Pango types" | Revert "Don't include gtk2perl because it redeclares the Pango types"
This reverts commit 421074211a234119276a6fdbb76d13d9f5bec9a4.
| C | lgpl-2.1 | GNOME/perl-Gtk2-Champlain,PabloCastellano/libchamplain,potyl/champlain,PabloCastellano/libchamplain,PabloCastellano/libchamplain,PabloCastellano/libchamplain,PabloCastellano/libchamplain,GNOME/libchamplain,StanciuMarius/Libchamplain-map-wrapping,StanciuMarius/Libchamplain-map-wrapping,StanciuMarius/Libchamplain-map-wrapping,Distrotech/libchamplain,Distrotech/libchamplain,GNOME/libchamplain,GNOME/perl-Gtk2-Champlain,potyl/champlain,Distrotech/libchamplain,Distrotech/libchamplain,GNOME/perl-Champlain,Distrotech/libchamplain,potyl/champlain,GNOME/perl-Champlain,potyl/champlain,StanciuMarius/Libchamplain-map-wrapping,StanciuMarius/Libchamplain-map-wrapping |
d32cc52fc99f4e4aafc893e13e0b801f0586cadb | chrome/browser/ui/panels/panel_browser_window_gtk.h | chrome/browser/ui/panels/panel_browser_window_gtk.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 CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_
#define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_
#include "chrome/browser/ui/gtk/browser_window_gtk.h"
class Panel;
class PanelBrowserWindowGtk : public BrowserWindowGtk {
public:
PanelBrowserWindowGtk(Browser* browser, Panel* panel);
virtual ~PanelBrowserWindowGtk() {}
// BrowserWindowGtk overrides
virtual void Init() OVERRIDE;
// BrowserWindow overrides
virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
protected:
// BrowserWindowGtk overrides
virtual bool GetWindowEdge(int x, int y, GdkWindowEdge* edge) OVERRIDE;
virtual bool HandleTitleBarLeftMousePress(
GdkEventButton* event,
guint32 last_click_time,
gfx::Point last_click_position) OVERRIDE;
virtual void SaveWindowPosition() OVERRIDE;
virtual void SetGeometryHints() OVERRIDE;
virtual bool UseCustomFrame() OVERRIDE;
private:
void SetBoundsImpl();
Panel* panel_;
DISALLOW_COPY_AND_ASSIGN(PanelBrowserWindowGtk);
};
#endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_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 CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_
#define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_
#include "chrome/browser/ui/gtk/browser_window_gtk.h"
class Panel;
class PanelBrowserWindowGtk : public BrowserWindowGtk {
public:
PanelBrowserWindowGtk(Browser* browser, Panel* panel);
virtual ~PanelBrowserWindowGtk() {}
// BrowserWindowGtk overrides
virtual void Init() OVERRIDE;
// BrowserWindow overrides
virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
protected:
// BrowserWindowGtk overrides
virtual bool GetWindowEdge(int x, int y, GdkWindowEdge* edge) OVERRIDE;
virtual bool HandleTitleBarLeftMousePress(
GdkEventButton* event,
guint32 last_click_time,
gfx::Point last_click_position) OVERRIDE;
virtual void SaveWindowPosition() OVERRIDE;
virtual void SetGeometryHints() OVERRIDE;
virtual bool UseCustomFrame() OVERRIDE;
private:
void SetBoundsImpl();
scoped_ptr<Panel> panel_;
DISALLOW_COPY_AND_ASSIGN(PanelBrowserWindowGtk);
};
#endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_
| Use scoped_ptr for Panel in PanelBrowserWindowGTK. | Use scoped_ptr for Panel in PanelBrowserWindowGTK.
BUG=None
TEST=Verified WindowOpenPanel test now hits Panel destructor.
Review URL: http://codereview.chromium.org/7120011
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@88154 0039d316-1c4b-4281-b951-d872f2087c98
| C | bsd-3-clause | adobe/chromium,adobe/chromium,adobe/chromium,ropik/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,yitian134/chromium,ropik/chromium,ropik/chromium,adobe/chromium,gavinp/chromium,gavinp/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,gavinp/chromium,gavinp/chromium,ropik/chromium,yitian134/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,ropik/chromium,adobe/chromium,ropik/chromium,yitian134/chromium,yitian134/chromium |
3e4aba119168140015b87dfabccd45b4275dcbd8 | test/lib/c/01-con-discon-success.c | test/lib/c/01-con-discon-success.c | #include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <mosquitto.h>
static int run = -1;
void on_connect(struct mosquitto *mosq, void *obj, int rc)
{
if(rc){
exit(1);
}else{
mosquitto_disconnect(mosq);
}
}
void on_disconnect(struct mosquitto *mosq, void *obj, int rc)
{
run = rc;
}
int main(int argc, char *argv[])
{
int rc;
struct mosquitto *mosq;
mosq = mosquitto_new("01-con-discon-success", true, NULL);
mosquitto_connect_callback_set(mosq, on_connect);
mosquitto_disconnect_callback_set(mosq, on_disconnect);
rc = mosquitto_connect(mosq, "localhost", 1888, 60);
while(run == -1){
mosquitto_loop(mosq, -1);
}
return run;
}
| #include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <mosquitto.h>
static int run = -1;
void on_connect(struct mosquitto *mosq, void *obj, int rc)
{
if(rc){
exit(1);
}else{
mosquitto_disconnect(mosq);
}
}
void on_disconnect(struct mosquitto *mosq, void *obj, int rc)
{
run = rc;
}
int main(int argc, char *argv[])
{
int rc;
struct mosquitto *mosq;
mosquitto_lib_init();
mosq = mosquitto_new("01-con-discon-success", true, NULL);
mosquitto_connect_callback_set(mosq, on_connect);
mosquitto_disconnect_callback_set(mosq, on_disconnect);
rc = mosquitto_connect(mosq, "localhost", 1888, 60);
while(run == -1){
mosquitto_loop(mosq, -1);
}
mosquitto_lib_cleanup();
return run;
}
| Call lib init/cleanup in C client test. | Call lib init/cleanup in C client test.
| C | bsd-3-clause | zlargon/mosquitto,zlargon/mosquitto,zlargon/mosquitto,zlargon/mosquitto,zlargon/mosquitto |
423355ecbff46ef0dddc5e7a48ae10af2a2d1bea | src/main/c/emulator/src/config.h | src/main/c/emulator/src/config.h | #ifndef CONFIG_H
#define CONFIG_H
//#define QEMU
#define SIM
#define OS_CALL 0xC0000000
#define DTB 0xC3000000
#endif
| #ifndef CONFIG_H
#define CONFIG_H
//#define QEMU
#define SIM
#ifndef OS_CALL
#define OS_CALL 0xC0000000
#endif
#ifndef DTB
#define DTB 0xC3000000
#endif
#endif
| Allow to set custom DTB/OS_CALL addresses | Allow to set custom DTB/OS_CALL addresses
Setting those from command line during compilation allows
to create a custom setup without the need of modifying the
sources.
| C | mit | SpinalHDL/VexRiscv,SpinalHDL/VexRiscv,SpinalHDL/VexRiscv,SpinalHDL/VexRiscv,SpinalHDL/VexRiscv |
ba7874bd648cf81182d4c36331525fc72944743a | include/config/SkUserConfigManual.h | include/config/SkUserConfigManual.h | /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)
#define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)
#define SK_USE_FREETYPE_EMBOLDEN
// Disable these Ganesh features
#define SK_DISABLE_REDUCE_OPLIST_SPLITTING
// Check error is expensive. HWUI historically also doesn't check its allocations
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0
// Staging flags
#define SK_LEGACY_PATH_ARCTO_ENDPOINT
#define SK_SUPPORT_STROKEANDFILL
// Needed until we fix https://bug.skia.org/2440
#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
#define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
#define SK_SUPPORT_LEGACY_AA_CHOICE
#define SK_SUPPORT_LEGACY_AAA_CHOICE
#define SK_DISABLE_DAA // skbug.com/6886
#endif // SkUserConfigManual_DEFINED
| /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#include <android/log.h>
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)
#define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)
#define SK_USE_FREETYPE_EMBOLDEN
// Disable these Ganesh features
#define SK_DISABLE_REDUCE_OPLIST_SPLITTING
// Check error is expensive. HWUI historically also doesn't check its allocations
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0
// Staging flags
#define SK_LEGACY_PATH_ARCTO_ENDPOINT
#define SK_SUPPORT_STROKEANDFILL
// Needed until we fix https://bug.skia.org/2440
#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
#define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
#define SK_SUPPORT_LEGACY_AA_CHOICE
#define SK_SUPPORT_LEGACY_AAA_CHOICE
#define SK_DISABLE_DAA // skbug.com/6886
#ifdef LOG_TAG
#undef LOG_TAG
#endif
#define LOG_TAG "skia"
#define SK_ABORT(...) __android_log_assert(nullptr, LOG_TAG, ##__VA_ARGS__)
#endif // SkUserConfigManual_DEFINED
| Print the message from SK_ABORT in stack traces | Print the message from SK_ABORT in stack traces
This will make debugging easier. Instead of using LOG_ALWAYS_FATAL, use
__android_log_assert (which the former uses internally) directly, since
SkQP can only access NDK APIs.
Depends on https://skia-review.googlesource.com/c/skia/+/521001.
Bug: 224771432
Test: manual
Change-Id: Ib9bec1e1d72169a18e6ad1ce8f9008a65dbe5a71
| C | bsd-3-clause | aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia |
a451476a98df41bf57a658d7d532e10c25158ea9 | Reducers/REDIterable.h | Reducers/REDIterable.h | // Copyright (c) 2014 Rob Rix. All rights reserved.
#import <Foundation/Foundation.h>
@protocol REDIterable <NSObject>
@property (readonly) id(^red_iterator)(void);
@end
| // Copyright (c) 2014 Rob Rix. All rights reserved.
#import <Foundation/Foundation.h>
/// A nullary block iterating the elements of a collection over successive calls.
///
/// \return The next object in the collection, or nil if it has iterated the entire collection.
typedef id (^REDIteratingBlock)(void);
/// A collection which can be iterated.
@protocol REDIterable <NSObject>
/// An iterator for this collection.
@property (readonly) REDIteratingBlock red_iterator;
@end
| Add a typedef for iterators. | Add a typedef for iterators.
| C | mit | policp/Reducers,robrix/Reducers |
41acb0a75b1ed5b4cf2feb74c64113a06a284e85 | React/Fabric/RCTFabricPlatformUIOperationManager.h | React/Fabric/RCTFabricPlatformUIOperationManager.h | /**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <memory>
#include <fabric/IFabricPlatformUIOperationManager.h>
@class RCTFabricPlatformUIOperationManager;
namespace facebook {
namespace react {
/**
* Connector class (from C++ to ObjC++) to allow FabricUIManager to invoke native UI operations/updates.
* UIKit-related impl doesn't live here, but this class gets passed to the FabricUIManager C++ impl directly.
*/
class RCTFabricPlatformUIOperationManagerConnector : public IFabricPlatformUIOperationManager {
public:
RCTFabricPlatformUIOperationManagerConnector();
~RCTFabricPlatformUIOperationManagerConnector();
void performUIOperation();
private:
void *self_;
RCTFabricPlatformUIOperationManager *manager_;
};
} // namespace react
} // namespace facebook
/**
* Actual ObjC++ implementation of the UI operations.
*/
@interface RCTFabricPlatformUIOperationManager : NSObject
- (void)performUIOperation;
@end
| /**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <memory>
#include <fabric/IFabricPlatformUIOperationManager.h>
@class RCTFabricPlatformUIOperationManager;
namespace facebook {
namespace react {
/**
* Connector class (from C++ to ObjC++) to allow FabricUIManager to invoke native UI operations/updates.
* UIKit-related impl doesn't live here, but this class gets passed to the FabricUIManager C++ impl directly.
*/
class RCTFabricPlatformUIOperationManagerConnector : public IFabricPlatformUIOperationManager {
public:
RCTFabricPlatformUIOperationManagerConnector();
virtual ~RCTFabricPlatformUIOperationManagerConnector();
void performUIOperation();
private:
void *self_;
RCTFabricPlatformUIOperationManager *manager_;
};
} // namespace react
} // namespace facebook
/**
* Actual ObjC++ implementation of the UI operations.
*/
@interface RCTFabricPlatformUIOperationManager : NSObject
- (void)performUIOperation;
@end
| Fix clang-6 compile error (virtual destructor) | Fix clang-6 compile error (virtual destructor)
Reviewed By: smeenai
Differential Revision: D7264312
fbshipit-source-id: f0567452127ceba6cfa13d05bb2a00a5af7aac05
| C | mit | myntra/react-native,javache/react-native,hoangpham95/react-native,facebook/react-native,facebook/react-native,exponentjs/react-native,javache/react-native,facebook/react-native,janicduplessis/react-native,javache/react-native,exponent/react-native,myntra/react-native,hoangpham95/react-native,hammerandchisel/react-native,myntra/react-native,hammerandchisel/react-native,exponentjs/react-native,janicduplessis/react-native,hammerandchisel/react-native,arthuralee/react-native,exponent/react-native,hammerandchisel/react-native,javache/react-native,arthuralee/react-native,hammerandchisel/react-native,janicduplessis/react-native,janicduplessis/react-native,myntra/react-native,pandiaraj44/react-native,exponentjs/react-native,myntra/react-native,pandiaraj44/react-native,myntra/react-native,facebook/react-native,hoangpham95/react-native,pandiaraj44/react-native,exponent/react-native,exponentjs/react-native,javache/react-native,arthuralee/react-native,facebook/react-native,exponentjs/react-native,arthuralee/react-native,exponentjs/react-native,exponent/react-native,myntra/react-native,myntra/react-native,hoangpham95/react-native,myntra/react-native,exponent/react-native,javache/react-native,exponent/react-native,facebook/react-native,pandiaraj44/react-native,arthuralee/react-native,pandiaraj44/react-native,javache/react-native,javache/react-native,facebook/react-native,hammerandchisel/react-native,pandiaraj44/react-native,hoangpham95/react-native,javache/react-native,exponent/react-native,exponentjs/react-native,janicduplessis/react-native,hammerandchisel/react-native,hoangpham95/react-native,exponent/react-native,facebook/react-native,exponentjs/react-native,facebook/react-native,hoangpham95/react-native,hammerandchisel/react-native,janicduplessis/react-native,hoangpham95/react-native,pandiaraj44/react-native,janicduplessis/react-native,pandiaraj44/react-native,janicduplessis/react-native |
6a989a7bb29ee5a16b6b059b61581cdc9458f765 | main.c | main.c | // Copyright 2016, Jeffrey E. Bedard
#include "xstatus.h"
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
static const char helptext[] =
"DESCRIPTION: Simple X toolbar for minimalistic"
" window managers.\n"
"USAGE: xstatus [-d DELAY][-f FILE][-h]\n"
"\t-d DELAY Set delay between status updates,"
" in seconds.\n"
"\t-f FILE Set FILE to be continuously polled and"
" displayed.\n"
"\t-h Print this usage information. \n"
"Copyright 2016, Jeffrey E. Bedard <[email protected]>\n"
"Project page: https://github.com/jefbed/xstatus\n";
int main(int argc, char ** argv)
{
char *filename=XSTATUS_STATUS_FILE;
uint8_t delay=1;
int opt;
while((opt = getopt(argc, argv, "d:f:h")) != -1) {
switch(opt) {
case 'd':
delay=atoi(optarg);
break;
case 'f':
filename=optarg;
break;
case 'h':
default:
write(2, helptext, sizeof(helptext));
exit(0);
}
}
run_xstatus(filename, delay);
}
| // Copyright 2016, Jeffrey E. Bedard
#include "xstatus.h"
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
static const char helptext[] =
"DESCRIPTION: Simple X toolbar for minimalistic"
" window managers.\n"
"USAGE: xstatus [-d DELAY][-f FILE][-h]\n"
"\t-d DELAY\tSet delay between status updates,"
" in seconds.\n"
"\t-f FILE\t\tSet FILE to be continuously polled and"
" displayed.\n"
"\t-h\t\tPrint this usage information.\n"
"Copyright 2016, Jeffrey E. Bedard <[email protected]>\n"
"Project page: https://github.com/jefbed/xstatus\n";
int main(int argc, char ** argv)
{
char *filename=XSTATUS_STATUS_FILE;
uint8_t delay=1;
int opt;
while((opt = getopt(argc, argv, "d:f:h")) != -1) {
switch(opt) {
case 'd':
delay=atoi(optarg);
break;
case 'f':
filename=optarg;
break;
case 'h':
default:
write(2, helptext, sizeof(helptext));
exit(0);
}
}
run_xstatus(filename, delay);
}
| Use tab characters in help text. | Use tab characters in help text.
| C | mit | jefbed/xstatus,jefbed/xstatus,jefbed/xstatus,jefbed/xstatus |
241540eb1c46593a93870e20efe6a694444b5f47 | test/Sema/overloadable-complex.c | test/Sema/overloadable-complex.c | // RUN: clang -fsyntax-only -verify %s
char *foo(float) __attribute__((__overloadable__)); // expected-note 3 {{candidate function}}
void test_foo_1(float fv, double dv, float _Complex fc, double _Complex dc) {
char *cp1 = foo(fv);
char *cp2 = foo(dv);
// Note: GCC and EDG reject these two, but they are valid C99 conversions
char *cp3 = foo(fc);
char *cp4 = foo(dc);
}
int *foo(float _Complex) __attribute__((__overloadable__)); // expected-note 3 {{candidate function}}
void test_foo_2(float fv, double dv, float _Complex fc, double _Complex dc) {
char *cp1 = foo(fv);
char *cp2 = foo(dv); // expected-error{{call to 'foo' is ambiguous; candidates are:}}
int *ip = foo(fc);
int *lp = foo(dc); // expected-error{{call to 'foo' is ambiguous; candidates are:}}
}
long *foo(double _Complex) __attribute__((__overloadable__)); // expected-note {{candidate function}}
void test_foo_3(float fv, double dv, float _Complex fc, double _Complex dc) {
char *cp1 = foo(fv);
char *cp2 = foo(dv); // expected-error{{call to 'foo' is ambiguous; candidates are:}}
int *ip = foo(fc);
long *lp = foo(dc);
}
char *promote_or_convert(double _Complex) __attribute__((__overloadable__)); // expected-note 2 {{candidate function}}
int *promote_or_convert(long double _Complex) __attribute__((__overloadable__)); // expected-note 2 {{candidate function}}
void test_promote_or_convert(float f, float _Complex fc) {
char *cp = promote_or_convert(fc); // expected-error{{call to 'promote_or_convert' is ambiguous; candidates are:}}
int *ip2 = promote_or_convert(f); // expected-error{{call to 'promote_or_convert' is ambiguous; candidates are:}}
}
char *promote_or_convert2(float) __attribute__((__overloadable__));
int *promote_or_convert2(double _Complex) __attribute__((__overloadable__));
void test_promote_or_convert2(float _Complex fc) {
int *cp = promote_or_convert2(fc);
}
char *promote_or_convert3(int _Complex) __attribute__((__overloadable__));
int *promote_or_convert3(long _Complex) __attribute__((__overloadable__));
void test_promote_or_convert3(short _Complex sc) {
char *cp = promote_or_convert3(sc);
}
| Add test for overloading with _Complex in C | Add test for overloading with _Complex in C
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@64347 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,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang |
|
d8f546320062c3c8848c1d50bf6a7e8ab3a673b0 | ffi-cdecl/mxcfb_kobo_decl.c | ffi-cdecl/mxcfb_kobo_decl.c | // standard Linux framebuffer headers
#include <linux/fb.h>
#include <linux/ioctl.h>
// specialized eink framebuffer headers
typedef unsigned int uint;
#include "include/mxcfb-kobo.h"
#include "cdecl.h"
cdecl_struct(mxcfb_rect)
cdecl_struct(mxcfb_alt_buffer_data)
cdecl_struct(mxcfb_update_data)
cdecl_const(MXCFB_SEND_UPDATE)
| // standard Linux framebuffer headers
#include <linux/fb.h>
#include <linux/ioctl.h>
// specialized eink framebuffer headers
typedef unsigned int uint;
#include "include/mxcfb-kobo.h"
#include "cdecl.h"
cdecl_struct(mxcfb_rect)
cdecl_struct(mxcfb_alt_buffer_data)
cdecl_struct(mxcfb_update_data)
cdecl_const(MXCFB_SEND_UPDATE)
/* Might come in handy one day... */
cdecl_const(MXCFB_WAIT_FOR_UPDATE_COMPLETE)
/* Aura */
cdecl_struct(mxcfb_update_data_org)
cdecl_const(MXCFB_SEND_UPDATE_ORG)
| Tweak the kobo mxcfb cdecl | Tweak the kobo mxcfb cdecl
| C | agpl-3.0 | frankyifei/koreader-base,apletnev/koreader-base,NiLuJe/koreader-base,Hzj-jie/koreader-base,houqp/koreader-base,houqp/koreader-base,Hzj-jie/koreader-base,NiLuJe/koreader-base,NiLuJe/koreader-base,frankyifei/koreader-base,Hzj-jie/koreader-base,Hzj-jie/koreader-base,Frenzie/koreader-base,apletnev/koreader-base,koreader/koreader-base,houqp/koreader-base,koreader/koreader-base,houqp/koreader-base,apletnev/koreader-base,Frenzie/koreader-base,frankyifei/koreader-base,frankyifei/koreader-base,koreader/koreader-base,NiLuJe/koreader-base,Frenzie/koreader-base,koreader/koreader-base,Frenzie/koreader-base,apletnev/koreader-base |
429d7cdce99df7b26eb6f15b819be98074f48695 | main.c | main.c | #include "js.h"
int
main(int argc, char **argv)
{
js_State *J;
int i;
J = js_newstate();
for (i = 1; i < argc; i++) {
js_loadfile(J, argv[1]);
// js_run(J);
}
js_close(J);
return 0;
}
| #include "js.h"
int
main(int argc, char **argv)
{
js_State *J;
int i;
J = js_newstate();
for (i = 1; i < argc; i++) {
js_loadfile(J, argv[i]);
// js_run(J);
}
js_close(J);
return 0;
}
| Fix typo so all arguments are loaded. | Fix typo so all arguments are loaded.
| C | isc | BOGY/mujs,lsm/mujs,earthling42/mujs,ccxvii/mujs,ccxvii/mujs,guiquanz/mujs,Frky/mujs,ccxvii/mujs,ccxvii/mujs,thurday/mujs,evanlabs/mujs |
b22f977bc4b4a8186bf236147b10982ccbbd2ad8 | LinkList_reverse_recursive.c | LinkList_reverse_recursive.c | #include <stdio.h>
#include <stdlib.h>
/* Linked List Implementation in C */
// This program aims at "Revering the Link List"
typedef struct node{
int data;
struct node *link;
} node;
node* head; //global variable
void insert_append(int x){
node* temp;
temp = (node*)malloc(sizeof(node));
temp->data = x;
temp->link=NULL;
if(head!=NULL){
node* temp_travel;
temp_travel =head;
while(temp_travel->link != NULL){
temp_travel = temp_travel->link;
}
temp_travel->link = temp;
return;
}
head =temp;
return;
}
void reverse(node *current){
if(current->link == NULL){
head = current;
return;
}
reverse(current->link);
node* temp;
temp = current->link;
temp->link= current;
current->link=NULL;
return;
}
//This is recursive print
void print(node* p){
if (p == NULL) {
return;
}
printf(" %d",p->data);
print(p->link);
return;
}
int main(){
head = NULL; //empty list
insert_append(1); //list is: 1
insert_append(2); //list is: 1 2
insert_append(3); //list is: 1 2 3
insert_append(4); //list is: 1 2 3 4
insert_append(5); //list is: 1 2 3 4 5
printf("list is:");
print(head);
printf("\n");
reverse(head); //list is : 5 4 3 2 1
printf("Reverse list is:");
print(head);
printf("\n");
return 0;
} | Add LinkList reverese using recursion and print using recursion | Add LinkList reverese using recursion and print using recursion
| C | mit | anaghajoshi/C_DataStructures_Algorithms |
|
403d61d1448eb8ee6a2ddc81865d9ebaf1ef73df | numpy/core/src/private/npy_import.h | numpy/core/src/private/npy_import.h | #ifndef NPY_IMPORT_H
#define NPY_IMPORT_H
#include <Python.h>
#include <assert.h>
/*! \brief Fetch and cache Python function.
*
* Import a Python function and cache it for use. The function checks if
* cache is NULL, and if not NULL imports the Python function specified by
* \a module and \a function, increments its reference count, and stores
* the result in \a cache. Usually \a cache will be a static variable and
* should be initialized to NULL. On error \a cache will contain NULL on
* exit,
*
* @param module Absolute module name.
* @param function Function name.
* @param cache Storage location for imported function.
*/
NPY_INLINE void
npy_cache_pyfunc(const char *module, const char *function, PyObject **cache)
{
if (*cache == NULL) {
PyObject *mod = PyImport_ImportModule(module);
if (mod != NULL) {
*cache = PyObject_GetAttrString(mod, function);
Py_DECREF(mod);
}
}
}
#endif
| Add inline C function to import and cache Python functions. | ENH: Add inline C function to import and cache Python functions.
A new inline function 'npy_cache_pyfunc' is provided for the common
operation of inporting and caching a Python function in static
variables. The intended usage is as follows.
int myfunc()
{
static PyObject *cache = NULL:
npy_cache_pyfunc("the.module.name", "function", &cache);
...
}
Errors are not recoverable, so checked with assert for debugging.
| C | bsd-3-clause | behzadnouri/numpy,BMJHayward/numpy,jonathanunderwood/numpy,bmorris3/numpy,tacaswell/numpy,behzadnouri/numpy,dwillmer/numpy,numpy/numpy,abalkin/numpy,gmcastil/numpy,mingwpy/numpy,pdebuyl/numpy,ahaldane/numpy,nbeaver/numpy,Linkid/numpy,WarrenWeckesser/numpy,BabeNovelty/numpy,mattip/numpy,bertrand-l/numpy,drasmuss/numpy,ekalosak/numpy,ESSS/numpy,WarrenWeckesser/numpy,musically-ut/numpy,mhvk/numpy,b-carter/numpy,dimasad/numpy,Srisai85/numpy,dimasad/numpy,ChanderG/numpy,dwillmer/numpy,pyparallel/numpy,rhythmsosad/numpy,ChristopherHogan/numpy,endolith/numpy,CMartelLML/numpy,sonnyhu/numpy,Yusa95/numpy,musically-ut/numpy,ddasilva/numpy,rudimeier/numpy,ekalosak/numpy,sinhrks/numpy,GrimDerp/numpy,seberg/numpy,felipebetancur/numpy,mathdd/numpy,ContinuumIO/numpy,KaelChen/numpy,abalkin/numpy,has2k1/numpy,rudimeier/numpy,pizzathief/numpy,endolith/numpy,MichaelAquilina/numpy,joferkington/numpy,anntzer/numpy,SiccarPoint/numpy,grlee77/numpy,ssanderson/numpy,Dapid/numpy,Yusa95/numpy,nguyentu1602/numpy,chiffa/numpy,ContinuumIO/numpy,grlee77/numpy,argriffing/numpy,chiffa/numpy,nbeaver/numpy,jakirkham/numpy,madphysicist/numpy,tynn/numpy,tacaswell/numpy,BMJHayward/numpy,b-carter/numpy,githubmlai/numpy,mingwpy/numpy,pbrod/numpy,jankoslavic/numpy,madphysicist/numpy,sinhrks/numpy,mathdd/numpy,empeeu/numpy,mathdd/numpy,shoyer/numpy,mwiebe/numpy,ddasilva/numpy,skwbc/numpy,mattip/numpy,jorisvandenbossche/numpy,leifdenby/numpy,drasmuss/numpy,anntzer/numpy,madphysicist/numpy,rhythmsosad/numpy,charris/numpy,AustereCuriosity/numpy,pbrod/numpy,ahaldane/numpy,jschueller/numpy,joferkington/numpy,Yusa95/numpy,solarjoe/numpy,solarjoe/numpy,jschueller/numpy,MSeifert04/numpy,dimasad/numpy,abalkin/numpy,jorisvandenbossche/numpy,githubmlai/numpy,simongibbons/numpy,KaelChen/numpy,MaPePeR/numpy,madphysicist/numpy,SunghanKim/numpy,cjermain/numpy,cjermain/numpy,SunghanKim/numpy,gmcastil/numpy,felipebetancur/numpy,jorisvandenbossche/numpy,GaZ3ll3/numpy,ssanderson/numpy,MaPePeR/numpy,njase/numpy,jankoslavic/numpy,kiwifb/numpy,githubmlai/numpy,Srisai85/numpy,jschueller/numpy,ahaldane/numpy,hainm/numpy,Anwesh43/numpy,sinhrks/numpy,shoyer/numpy,leifdenby/numpy,has2k1/numpy,rudimeier/numpy,dwillmer/numpy,groutr/numpy,WillieMaddox/numpy,mhvk/numpy,Anwesh43/numpy,Yusa95/numpy,drasmuss/numpy,solarjoe/numpy,rherault-insa/numpy,skwbc/numpy,mwiebe/numpy,anntzer/numpy,seberg/numpy,behzadnouri/numpy,ESSS/numpy,musically-ut/numpy,grlee77/numpy,mathdd/numpy,empeeu/numpy,kiwifb/numpy,jakirkham/numpy,pbrod/numpy,Eric89GXL/numpy,shoyer/numpy,ddasilva/numpy,ChanderG/numpy,SiccarPoint/numpy,ViralLeadership/numpy,trankmichael/numpy,charris/numpy,dwillmer/numpy,trankmichael/numpy,WarrenWeckesser/numpy,AustereCuriosity/numpy,rgommers/numpy,MSeifert04/numpy,pbrod/numpy,hainm/numpy,gfyoung/numpy,ESSS/numpy,rajathkumarmp/numpy,pizzathief/numpy,simongibbons/numpy,gfyoung/numpy,mattip/numpy,empeeu/numpy,WillieMaddox/numpy,SunghanKim/numpy,pizzathief/numpy,argriffing/numpy,tynn/numpy,endolith/numpy,BabeNovelty/numpy,bringingheavendown/numpy,endolith/numpy,rgommers/numpy,musically-ut/numpy,jonathanunderwood/numpy,jankoslavic/numpy,gfyoung/numpy,has2k1/numpy,skymanaditya1/numpy,pizzathief/numpy,Dapid/numpy,GaZ3ll3/numpy,jorisvandenbossche/numpy,joferkington/numpy,MichaelAquilina/numpy,kirillzhuravlev/numpy,rajathkumarmp/numpy,utke1/numpy,mhvk/numpy,charris/numpy,numpy/numpy,chatcannon/numpy,MSeifert04/numpy,ViralLeadership/numpy,kirillzhuravlev/numpy,cjermain/numpy,bmorris3/numpy,ChanderG/numpy,numpy/numpy,kiwifb/numpy,MaPePeR/numpy,Dapid/numpy,bertrand-l/numpy,cjermain/numpy,seberg/numpy,mhvk/numpy,nbeaver/numpy,chiffa/numpy,grlee77/numpy,bertrand-l/numpy,jonathanunderwood/numpy,mingwpy/numpy,stuarteberg/numpy,ContinuumIO/numpy,has2k1/numpy,BabeNovelty/numpy,grlee77/numpy,ekalosak/numpy,SiccarPoint/numpy,utke1/numpy,maniteja123/numpy,groutr/numpy,anntzer/numpy,Eric89GXL/numpy,felipebetancur/numpy,kirillzhuravlev/numpy,skymanaditya1/numpy,BMJHayward/numpy,groutr/numpy,stuarteberg/numpy,numpy/numpy,jankoslavic/numpy,ssanderson/numpy,joferkington/numpy,pbrod/numpy,MichaelAquilina/numpy,MSeifert04/numpy,shoyer/numpy,Anwesh43/numpy,bringingheavendown/numpy,sinhrks/numpy,njase/numpy,sonnyhu/numpy,hainm/numpy,madphysicist/numpy,rgommers/numpy,Eric89GXL/numpy,GaZ3ll3/numpy,seberg/numpy,mattip/numpy,WillieMaddox/numpy,simongibbons/numpy,BabeNovelty/numpy,rajathkumarmp/numpy,MSeifert04/numpy,bmorris3/numpy,pdebuyl/numpy,utke1/numpy,moreati/numpy,tacaswell/numpy,GrimDerp/numpy,AustereCuriosity/numpy,rhythmsosad/numpy,simongibbons/numpy,GrimDerp/numpy,ChristopherHogan/numpy,kirillzhuravlev/numpy,maniteja123/numpy,maniteja123/numpy,Srisai85/numpy,argriffing/numpy,jakirkham/numpy,ekalosak/numpy,rgommers/numpy,SunghanKim/numpy,pdebuyl/numpy,skymanaditya1/numpy,MaPePeR/numpy,githubmlai/numpy,hainm/numpy,mhvk/numpy,ChristopherHogan/numpy,rherault-insa/numpy,jschueller/numpy,b-carter/numpy,moreati/numpy,nguyentu1602/numpy,shoyer/numpy,chatcannon/numpy,sonnyhu/numpy,rherault-insa/numpy,jorisvandenbossche/numpy,WarrenWeckesser/numpy,pyparallel/numpy,njase/numpy,GrimDerp/numpy,moreati/numpy,jakirkham/numpy,chatcannon/numpy,WarrenWeckesser/numpy,stuarteberg/numpy,pdebuyl/numpy,ahaldane/numpy,CMartelLML/numpy,GaZ3ll3/numpy,KaelChen/numpy,Linkid/numpy,sonnyhu/numpy,ViralLeadership/numpy,bmorris3/numpy,pyparallel/numpy,CMartelLML/numpy,BMJHayward/numpy,stuarteberg/numpy,Srisai85/numpy,dimasad/numpy,leifdenby/numpy,rudimeier/numpy,bringingheavendown/numpy,KaelChen/numpy,rajathkumarmp/numpy,rhythmsosad/numpy,nguyentu1602/numpy,CMartelLML/numpy,felipebetancur/numpy,Linkid/numpy,simongibbons/numpy,tynn/numpy,nguyentu1602/numpy,MichaelAquilina/numpy,ahaldane/numpy,mwiebe/numpy,gmcastil/numpy,ChanderG/numpy,trankmichael/numpy,SiccarPoint/numpy,charris/numpy,Linkid/numpy,Eric89GXL/numpy,skymanaditya1/numpy,mingwpy/numpy,skwbc/numpy,empeeu/numpy,ChristopherHogan/numpy,jakirkham/numpy,Anwesh43/numpy,trankmichael/numpy,pizzathief/numpy |
|
6db7f401f8f04398f711bd042394504174547d19 | tests/regression/02-base/74-pcwd-deref-unknown-fp.c | tests/regression/02-base/74-pcwd-deref-unknown-fp.c | // PARAM: --disable sem.unknown_function.invalidate.globals --disable sem.unknown_function.spawn
// extracted from ddverify pcwd
// header declarations
struct file_operations {
void (*ioctl)();
};
struct miscdevice {
struct file_operations *fops;
};
struct cdev {
struct file_operations *ops;
};
// implementation stub
struct ddv_cdev {
struct cdev *cdevp;
};
#define MAX_CDEV_SUPPORT 1
struct cdev fixed_cdev[MAX_CDEV_SUPPORT];
struct ddv_cdev cdev_registered[MAX_CDEV_SUPPORT];
int cdev_add(struct cdev *p)
{
cdev_registered[0].cdevp = p;
return 0;
}
int misc_register(struct miscdevice *misc) {
fixed_cdev[0].ops = misc->fops;
return cdev_add(&fixed_cdev[0]);
}
void call_cdev_functions()
{
int cdev_no = 0;
if (cdev_registered[cdev_no].cdevp->ops->ioctl) {
(* cdev_registered[cdev_no].cdevp->ops->ioctl)();
}
}
// concrete program
void pcwd_ioctl() {
assert(1); // reachable
}
static const struct file_operations pcwd_fops = {
.ioctl = pcwd_ioctl
};
static struct miscdevice pcwd_miscdev = {
.fops = &pcwd_fops
};
int main() {
misc_register(&pcwd_miscdev);
void (*fp)(struct ddv_cdev*); // unknown function pointer
fp(&cdev_registered); // invalidates argument!
call_cdev_functions();
return 0;
}
| Add unsound dereferencing of unknown function pointer from ddverify pcwd | Add unsound dereferencing of unknown function pointer from ddverify pcwd
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
0db1fc1c5d71d4952975293647f087c22a265628 | ghighlighter/main.c | ghighlighter/main.c | #include <gtk/gtk.h>
#include "main-window.h"
int
main (int argc, char *argv[])
{
GtkWidget *window;
gtk_init(&argc, &argv);
window = main_window_create();
gtk_widget_show(window);
gtk_main();
return 0;
}
| #include <gtk/gtk.h>
#include "main-window.h"
int
main (int argc, char *argv[])
{
GtkWidget *window;
gtk_init(&argc, &argv);
window = main_window_create();
gtk_widget_show_all(window);
gtk_main();
return 0;
}
| Use gtk_widget_show_all instead of just show | Use gtk_widget_show_all instead of just show
| C | mit | chdorner/ghighlighter-c |
e8fb39c9a7aaa172a528142fb5b24aa03e224083 | inc/ArgParse/ArgParse.h | inc/ArgParse/ArgParse.h | /*
ArgParser - C++ Argument Parser reflecting the python module ArgParse.
Copyright (C) 2014-2015 Matthew Scott Krafczyk
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
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, see <http://www.gnu.org/licenses/>.
*/
#ifndef ARGPARSE_ArgParse_HDR
#define ARGPARSE_ArgParse_HDR
#include "ArgParse/Message.h"
#include "ArgParse/Option.h"
#include "ArgParse/ArgParser.h"
#endif
| /*
ArgParser - C++ Argument Parser reflecting the python module ArgParse.
Copyright (C) 2014-2015 Matthew Scott Krafczyk
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
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, see <http://www.gnu.org/licenses/>.
*/
#ifndef ARGPARSE_ArgParse_HDR
#define ARGPARSE_ArgParse_HDR
#include "ArgParse/Message.h"
#include "ArgParse/Argument.h"
#include "ArgParse/ArgParser.h"
#endif
| Change an old Option.h to Argument.h | Change an old Option.h to Argument.h
| C | mit | krafczyk/ArgParse,krafczyk/ArgParse |
de630eb49412f0ef25cb5a010efd6922a5c4d28b | common.h | common.h | #ifndef MLCD_COMMON_H
#define MLCD_COMMON_H
#define BYTE_TO_ASCII(byte) \
(byte & 0x80 ? '#' : ' '), \
(byte & 0x40 ? '#' : ' '), \
(byte & 0x20 ? '#' : ' '), \
(byte & 0x10 ? '#' : ' '), \
(byte & 0x08 ? '#' : ' '), \
(byte & 0x04 ? '#' : ' '), \
(byte & 0x02 ? '#' : ' '), \
(byte & 0x01 ? '#' : ' ')
#define MLCD_WIDTH 48
#define MLCD_HEIGHT 32
#define MLCD_BYTES ((MLCD_WIDTH * MLCD_HEIGHT) / 8)
#endif /* MLCD_COMMON_H */
| #ifndef MLCD_COMMON_H
#define MLCD_COMMON_H
#define BYTE_TO_ASCII(byte) \
(byte & 0x80 ? '1' : '0'), \
(byte & 0x40 ? '1' : '0'), \
(byte & 0x20 ? '1' : '0'), \
(byte & 0x10 ? '1' : '0'), \
(byte & 0x08 ? '1' : '0'), \
(byte & 0x04 ? '1' : '0'), \
(byte & 0x02 ? '1' : '0'), \
(byte & 0x01 ? '1' : '0')
#define MLCD_WIDTH 48
#define MLCD_HEIGHT 32
#define MLCD_BYTES ((MLCD_WIDTH * MLCD_HEIGHT) / 8)
#endif /* MLCD_COMMON_H */
| Fix asm generation with mlcd -a | Fix asm generation with mlcd -a
| C | bsd-2-clause | travispaul/mlcd |
45d03888d28f1126c051ec5a870dcb9829ad8d27 | ObjCBridge.h | ObjCBridge.h | //
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import "Konashi.h"
#import "Colorkit.h"
#import <EstimoteSDK/EstimoteSDK.h>
#import "ActionSheetPicker.h"
| //
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import <Konashi.h>
#import <Colorkit.h>
#import <EstimoteSDK/EstimoteSDK.h>
#import <ActionSheetPicker.h>
| Use <> instead of "" | Use <> instead of ""
""は、自作クラスの時に使用するらしい
| C | mit | karappo/PlayTheWheels,karappo/PlayTheWheels |
8fd0d0b7089303d141b08913bcf6a1f92469f754 | include/effects/SkStippleMaskFilter.h | include/effects/SkStippleMaskFilter.h | /*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkStippleMaskFilter_DEFINED
#define SkStippleMaskFilter_DEFINED
#include "SkMaskFilter.h"
/**
* Simple MaskFilter that creates a screen door stipple pattern
*/
class SkStippleMaskFilter : public SkMaskFilter {
public:
SkStippleMaskFilter() : INHERITED() {
}
virtual bool filterMask(SkMask* dst, const SkMask& src,
const SkMatrix& matrix,
SkIPoint* margin) SK_OVERRIDE;
// getFormat is from SkMaskFilter
virtual SkMask::Format getFormat() SK_OVERRIDE {
return SkMask::kA8_Format;
}
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkStippleMaskFilter);
protected:
SkStippleMaskFilter::SkStippleMaskFilter(SkFlattenableReadBuffer& buffer)
: SkMaskFilter(buffer) {
}
private:
typedef SkMaskFilter INHERITED;
};
#endif // SkStippleMaskFilter_DEFINED | /*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkStippleMaskFilter_DEFINED
#define SkStippleMaskFilter_DEFINED
#include "SkMaskFilter.h"
/**
* Simple MaskFilter that creates a screen door stipple pattern
*/
class SkStippleMaskFilter : public SkMaskFilter {
public:
SkStippleMaskFilter() : INHERITED() {
}
virtual bool filterMask(SkMask* dst, const SkMask& src,
const SkMatrix& matrix,
SkIPoint* margin) SK_OVERRIDE;
// getFormat is from SkMaskFilter
virtual SkMask::Format getFormat() SK_OVERRIDE {
return SkMask::kA8_Format;
}
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkStippleMaskFilter);
protected:
SkStippleMaskFilter(SkFlattenableReadBuffer& buffer)
: SkMaskFilter(buffer) {
}
private:
typedef SkMaskFilter INHERITED;
};
#endif // SkStippleMaskFilter_DEFINED
| Fix for compiler error in r4154 | Fix for compiler error in r4154
git-svn-id: e8541e15acce502a64c929015570ad1648e548cd@4155 2bbb7eff-a529-9590-31e7-b0007b416f81
| C | bsd-3-clause | Frankie-666/color-emoji.skia,Hankuo/color-emoji.skia,MatChung/color-emoji.skia,hbwhlklive/color-emoji.skia,Hankuo/color-emoji.skia,Frankie-666/color-emoji.skia,hbwhlklive/color-emoji.skia,Hankuo/color-emoji.skia,Hankuo/color-emoji.skia,hbwhlklive/color-emoji.skia,MatChung/color-emoji.skia,Hankuo/color-emoji.skia,Frankie-666/color-emoji.skia,MatChung/color-emoji.skia,MatChung/color-emoji.skia,Hankuo/color-emoji.skia,Frankie-666/color-emoji.skia,Frankie-666/color-emoji.skia,hbwhlklive/color-emoji.skia,hbwhlklive/color-emoji.skia,MatChung/color-emoji.skia,Frankie-666/color-emoji.skia,hbwhlklive/color-emoji.skia,MatChung/color-emoji.skia |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.