Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Indent better than Videl :) | #include <stdio.h>
#include <stdlib.h>
#ifndef METADATA_H
#define METADATA_H
typedef struct Metadata
{
/**
* File's name.
*/
char md_name[255];
/**
* File's extension.
*/
char md_extension[10];
/**
* List of keywords to describe the file.
*/
char md_keywords[255];
/**
* Hash of t... | #include <stdio.h>
#include <stdlib.h>
#ifndef METADATA_H
#define METADATA_H
typedef struct Metadata
{
/**
* File's name.
*/
char md_name[255];
/**
* File's extension.
*/
char md_extension[10];
/**
* List of keywords to describe the file.
*/
char md_keywords[255];
... |
Move the import controls into a formal protocol | //
// NSManagedObject+JSONHelpers.h
//
// Created by Saul Mora on 6/28/11.
// Copyright 2011 Magical Panda Software LLC. All rights reserved.
//
#import <CoreData/CoreData.h>
extern NSString * const kMagicalRecordImportCustomDateFormatKey;
extern NSString * const kMagicalRecordImportDefaultDateFormatString;
extern... | //
// NSManagedObject+JSONHelpers.h
//
// Created by Saul Mora on 6/28/11.
// Copyright 2011 Magical Panda Software LLC. All rights reserved.
//
#import <CoreData/CoreData.h>
extern NSString * const kMagicalRecordImportCustomDateFormatKey;
extern NSString * const kMagicalRecordImportDefaultDateFormatString;
extern... |
Add ACPI CPU Data include file | /** @file
Definitions for CPU S3 data.
Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be fou... | |
Fix a warning about implicit function declaration. | ///
/// \file cleanup.h
/// \brief Functions to clean up memory
/// \defgroup cleanup Memory Cleanup
/// \brief Frees memory before loading
/// @{
///
#ifndef UVL_CLEANUP
#define UVL_CLEANUP
#include "types.h"
int uvl_cleanup_memory ();
int uvl_unload_all_modules ();
#endif
/// @}
| ///
/// \file cleanup.h
/// \brief Functions to clean up memory
/// \defgroup cleanup Memory Cleanup
/// \brief Frees memory before loading
/// @{
///
#ifndef UVL_CLEANUP
#define UVL_CLEANUP
#include "types.h"
int uvl_cleanup_memory ();
int uvl_unload_all_modules();
void uvl_pre_clean();
#endif
/// @}
|
Reimplement no-op version of DLOG to avoid C++ compiler warning | #pragma once
#include <iostream>
// The same as assert, but expression is always evaluated and result returned
#define CHECK(expr) (assert(expr), expr)
#if !defined(NDEBUG) // Debug
namespace dev
{
namespace evmjit
{
std::ostream& getLogStream(char const* _channel);
}
}
#define DLOG(CHANNEL) ::dev::evmjit::getLo... | #pragma once
#include <iostream>
// The same as assert, but expression is always evaluated and result returned
#define CHECK(expr) (assert(expr), expr)
#if !defined(NDEBUG) // Debug
namespace dev
{
namespace evmjit
{
std::ostream& getLogStream(char const* _channel);
}
}
#define DLOG(CHANNEL) ::dev::evmjit::getLo... |
Add simple test (proof of working) for double linked list api. | //tests for linked lists tasks from the "Cracking The Coding Interview".
#include <assert.h>
#include <stdbool.h>
int main()
{
assert(false && "First unit test");
return 0;
}
| //tests for linked lists tasks from the "Cracking The Coding Interview".
#include <assert.h>
#include <stdbool.h>
#include "../../c_double_linked_list/double_linked_list.h"
int main()
{
struct Node* h = initHeadNode(0);
printList(h);
clear(h);
return 0;
}
|
Add forgotten PBE epsilon header. | #ifndef PBEC_EPS_H
#define PBEC_EPS_H
#include "functional.h"
#include "constants.h"
#include "pw92eps.h"
#include "vwn.h"
namespace pbec_eps
{
template<class num, class T>
static num A(const num &eps, const T &u3)
{
using xc_constants::param_beta_gamma;
using xc_constants::param_gamma;
return param... | |
Update driver version to 5.04.00-k4 | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2013 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.04.00-k3"
| /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2013 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.04.00-k4"
|
Add common header - just has branch prediction hint macros for now | #pragma once
// Branch prediction hints
#define LIKELY(condition) __builtin_expect(static_cast<bool>(condition), 1)
#define UNLIKELY(condition) __builtin_expect(static_cast<bool>(condition), 0) | |
Solve Fuel Spent in c | #include <math.h>
#include <stdio.h>
int main() {
float h, s;
scanf("%f", &h);
scanf("%f", &s);
printf("%.3f\n", h * s / 12.0);
}
| |
Modify the adapter version number. | // Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in w... | // Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in w... |
Include device in the LDM headers | /*
* This file is part of linux-driver-management.
*
* Copyright © 2016-2017 Ikey Doherty
*
* linux-driver-management is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1
* of the ... | /*
* This file is part of linux-driver-management.
*
* Copyright © 2016-2017 Ikey Doherty
*
* linux-driver-management is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1
* of the ... |
Sort headers in alphabetical order | /**
* @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 a... | /**
* @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 a... |
Fix build on non-OSX due to missing parameter name. | /*
* consumer_sdl_osx.m -- An OS X compatibility shim for SDL
* Copyright (C) 2010 Ushodaya Enterprises Limited
* Author: Dan Dennedy
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundati... | /*
* consumer_sdl_osx.m -- An OS X compatibility shim for SDL
* Copyright (C) 2010 Ushodaya Enterprises Limited
* Author: Dan Dennedy
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundati... |
Fix issues pointed out in review | #ifndef CROWN_PLATFORM_GOVERNANCE_H
#define CROWN_PLATFORM_GOVERNANCE_H
#include "primitives/transaction.h"
#include "uint256.h"
#include <boost/function.hpp>
#include <vector>
namespace Platform
{
class Vote
{
public:
enum Value { abstain = 0, yes, no };
CTxIn voterId;
int64_t ... | #ifndef CROWN_PLATFORM_GOVERNANCE_H
#define CROWN_PLATFORM_GOVERNANCE_H
#include "primitives/transaction.h"
#include "uint256.h"
#include <boost/function.hpp>
#include <vector>
namespace Platform
{
class Vote
{
public:
enum Value { abstain = 0, yes, no };
CTxIn voterId;
int64_t ... |
Adjust testcase for recent DWARF printer changes. | // RUN: %clang -ccc-host-triple i386-apple-darwin10 -S -g -dA %s -o - | FileCheck %s
int global;
// CHECK: asciz "global" ## DW_AT_name
int main() { return 0;}
| // RUN: %clang -ccc-host-triple i386-apple-darwin10 -S -g -dA %s -o - | FileCheck %s
int global;
// CHECK: asciz "global" ## External Name
int main() { return 0;}
|
Add example for warning ranking. | // PARAM: --set ana.activated[+] "'region'"
#include<pthread.h>
#include<stdlib.h>
#include<stdio.h>
struct s {
int datum;
struct s *next;
} *A, *B;
struct s *new(int x) {
struct s *p = malloc(sizeof(struct s));
p->datum = x;
p->next = NULL;
return p;
}
pthread_mutex_t A_mutex = PTHREAD_MUTEX_INITIALIZER... | |
Change unsigned int to uint32_t. | static inline unsigned int hash_func_string(const char* key)
{
unsigned int hash = 0;
int c;
while ((c = *key++) != 0)
hash = c + (hash << 6) + (hash << 16) - hash;
return hash;
}
| static inline uint32_t hash_func_string(const char* key)
{
uint32_t hash = 0;
int c;
while ((c = *key++) != 0)
hash = c + (hash << 6) + (hash << 16) - hash;
return hash;
}
|
Fix 'unused variable' warning on fast build |
#include <stdio.h>
#include "../slice.h"
#include "../assert.h"
#include "../nelem.h"
int main( void )
{
int const xs[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
printf( "Testing subset slice...\n" );
int const ws[] = { SLICE( xs, 3, 4 ) };
ASSERT( NELEM( ws ) == 4,
ws[ 0 ] == xs[ 3 ],
... |
#include <stdio.h>
#include "../slice.h"
#include "../assert.h"
#include "../nelem.h"
int main( void )
{
int const xs[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
printf( "Testing subset slice...\n" );
int const ws[] = { SLICE( xs, 3, 4 ) };
ASSERT( NELEM( ws ) == 4,
ws[ 0 ] == xs[ 3 ],
... |
Fix include path for ofp_config.h | /* Copyright (c) 2015, ENEA Software AB
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _OFPI_CONFIG_H_
#define _OFPI_CONFIG_H_
#include "ofp_config.h"
#define ARP_SANITY_CHECK 1
#endif
| /* Copyright (c) 2015, ENEA Software AB
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _OFPI_CONFIG_H_
#define _OFPI_CONFIG_H_
#include "api/ofp_config.h"
#define ARP_SANITY_CHECK 1
#endif
|
Fix python link in release build. | #ifndef SOFAPYTHON_PYTHON_H
#define SOFAPYTHON_PYTHON_H
// This header simply includes Python.h, taking care of platform-specific stuff
// It should be included before any standard headers:
// "Since Python may define some pre-processor definitions which affect the
// standard headers on some systems, you must inclu... | #ifndef SOFAPYTHON_PYTHON_H
#define SOFAPYTHON_PYTHON_H
// This header simply includes Python.h, taking care of platform-specific stuff
// It should be included before any standard headers:
// "Since Python may define some pre-processor definitions which affect the
// standard headers on some systems, you must inclu... |
Use boost::atomic if C++ compiler older than 201103. | /*
*******************************************************************************
*
* Purpose: Utils. Atomic types helper.
*
*******************************************************************************
* Copyright Monstrenyatko 2014.
*
* Distributed under the MIT License.
* (See accompanying file LICENSE o... | /*
*******************************************************************************
*
* Purpose: Utils. Atomic types helper.
*
*******************************************************************************
* Copyright Monstrenyatko 2014.
*
* Distributed under the MIT License.
* (See accompanying file LICENSE o... |
Fix mismatched delete due to missing virtual destructor | //===-- RemarkParserImpl.h - Implementation details -------------*- C++/-*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | //===-- RemarkParserImpl.h - Implementation details -------------*- C++/-*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
Handle initialization of change detection variables in a more sane way. No more false positives of changes on startup. | #pragma once
#include <chrono>
#include <string>
enum class ref_src_t {
FILE,
AIRCRAFT,
PLUGIN,
USER_MSG,
BLACKLIST,
};
/// Superclass defining some common interface items for dataref and commandref.
class RefRecord {
protected:
std::string name;
ref_src_t source;
std::chrono::system... | #pragma once
#include <chrono>
#include <string>
enum class ref_src_t {
FILE,
AIRCRAFT,
PLUGIN,
USER_MSG,
BLACKLIST,
};
/// Superclass defining some common interface items for dataref and commandref.
class RefRecord {
protected:
std::string name;
ref_src_t source;
std::chrono::system... |
Add in the missing header. | /****************************************************************************
*
* Copyright (C) 2013 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistri... | |
Add the backend class/functions for using GIT within lumina-fm. | //===========================================
// Lumina-DE source code
// Copyright (c) 2016, Ken Moore
// Available under the 3-clause BSD license
// See the LICENSE file for full details
//===========================================
// This is the backend classe for interacting with the "git" utility
//=========... | |
Add testcase for incomplete call/return types for calls. | // RUN: clang -fsyntax-only -verify %s
struct foo; // expected-note 3 {{forward declaration of 'struct foo'}}
struct foo a();
void b(struct foo);
void c();
void func() {
a(); // expected-error{{return type of called function ('struct foo') is incomplete}}
b(*(struct foo*)0); // expected-error{{argument type 'str... | |
Include every single file in the vulkan update. | /*
*
* Copyright (c) 2016 The Khronos Group Inc.
* Copyright (c) 2016 Valve Corporation
* Copyright (c) 2016 LunarG, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.ap... | |
Convert BUG() to use unreachable() | #ifndef _ALPHA_BUG_H
#define _ALPHA_BUG_H
#include <linux/linkage.h>
#ifdef CONFIG_BUG
#include <asm/pal.h>
/* ??? Would be nice to use .gprel32 here, but we can't be sure that the
function loaded the GP, so this could fail in modules. */
#define BUG() do { \
__asm__ __volatile__( \
"call_pal %0 #... | #ifndef _ALPHA_BUG_H
#define _ALPHA_BUG_H
#include <linux/linkage.h>
#ifdef CONFIG_BUG
#include <asm/pal.h>
/* ??? Would be nice to use .gprel32 here, but we can't be sure that the
function loaded the GP, so this could fail in modules. */
#define BUG() do { \
__asm__ __volatile__( \
"call_pal %0 #... |
Update platforms/* with Eliot's fixes for 64-bit clean AsyncPlugin. | /* Header file for AsynchFile plugin */
/* module initialization/shutdown */
int asyncFileInit(void);
int asyncFileShutdown(void);
/*** Experimental Asynchronous File I/O ***/
typedef struct {
int sessionID;
void *state;
} AsyncFile;
int asyncFileClose(AsyncFile *f);
int asyncFileOpen(AsyncFile *f, long fileName... | /* Header file for AsynchFile plugin */
/* module initialization/shutdown */
int asyncFileInit(void);
int asyncFileShutdown(void);
/*** Experimental Asynchronous File I/O ***/
typedef struct {
int sessionID;
void *state;
} AsyncFile;
int asyncFileClose(AsyncFile *f);
int asyncFileOpen(AsyncFile *f, char *fileNam... |
Initialize the world state to zero | #include <badgewars.h>
#include <stdio.h>
/* Initialize the BadgeWars world */
void bw_init(struct bw_world *world)
{
puts("bw_init requested");
}
/* Run the BadgeWars world for a single instruction */
int bw_run(struct bw_world *world)
{
puts("bw_run requested");
return 0;
}
/* Receive a BadgeWars comma... | #include <badgewars.h>
#include <string.h>
/* Initialize the BadgeWars world */
void bw_init(struct bw_world *world)
{
memset(&world->core, 0, sizeof(world->core));
world->queue_head = world->queue_tail = 0;
}
/* Run the BadgeWars world for a single instruction */
int bw_run(struct bw_world *world)
{
retu... |
Add third_party/ prefix to ppapi include for checkdeps. | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_
#define WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_
#include "ppapi/c/pp_var.h"
#define PPB_PRIVATE_INTERFACE "PPB... | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_
#define WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_
#include "third_party/ppapi/c/pp_var.h"
#define PPB_PRIVATE_IN... |
Add TODO to replace ratpoison. | /* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Maps and raises the specified window id (integer).
*/
#include <X11/Xlib.h>
#include <stdlib.h>
int main(int argc, char** argv) {
if (a... | /* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Maps and raises the specified window id (integer).
*/
/* TODO: use XResizeWindow to do the +1 width ratpoison hack.
* And at this point, we... |
Remove debug print hook function |
#include <zephyr.h>
#include <init.h>
#include <posix/time.h>
#include <csp/csp_debug.h>
#include <logging/log.h>
LOG_MODULE_REGISTER(libcsp);
static void hook_func(csp_debug_level_t level, const char * format, va_list args) {
uint32_t args_num = log_count_args(format);
switch (level) {
case CSP_ERROR:
Z_LO... |
#include <zephyr.h>
#include <init.h>
#include <posix/time.h>
#include <csp/csp_debug.h>
#include <logging/log.h>
LOG_MODULE_REGISTER(libcsp);
}
static int libcsp_zephyr_init(const struct device * unused) {
struct timespec ts = {
.tv_sec = 946652400,
.tv_nsec = 0,
};
clock_settime(CLOCK_REALTIME, &ts);
r... |
Make the run loop and queue @public until we enhance the scheduler API | //
// AFNetworkEnvironment.h
// CoreNetworking
//
// Created by Keith Duncan on 05/01/2013.
// Copyright (c) 2013 Keith Duncan. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "CoreNetworking/AFNetwork-Macros.h"
/*!
\brief
Schedule environment for run loop and dispatch
*/
@interface AFNetwor... | //
// AFNetworkEnvironment.h
// CoreNetworking
//
// Created by Keith Duncan on 05/01/2013.
// Copyright (c) 2013 Keith Duncan. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "CoreNetworking/AFNetwork-Macros.h"
/*!
\brief
Schedule environment for run loop and dispatch
*/
@interface AFNetwor... |
Add detection for whatever silly protector new malware was using. | /*
* Header file for the definitions of packers/protectors
*
* Tim "diff" Strazzere <strazz@gmail.com>
*/
typedef struct {
char* name;
char* description;
char* filter;
char* marker;
} packer;
static packer packers[] = {
// APKProtect
{
"APKProtect v1->5",
"APKProtect generialized detection",
... | /*
* Header file for the definitions of packers/protectors
*
* Tim "diff" Strazzere <strazz@gmail.com>
*/
typedef struct {
char* name;
char* description;
char* filter;
char* marker;
} packer;
static packer packers[] = {
// APKProtect
{
"APKProtect v1->5",
"APKProtect generialized detection",
... |
Merge in types and items from type servers (/Zi) | //===- GUID.h ---------------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===- GUID.h ---------------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
Fix small but critical typo ... | #ifndef RELFILENODE_H
#define RELFILENODE_H
/*
* This is all what we need to know to find relation file.
* tblNode is identificator of tablespace and because of
* currently our tablespaces are equal to databases this is
* database OID. relNode is currently relation OID on creation
* but may be changed later if re... | #ifndef RELFILENODE_H
#define RELFILENODE_H
/*
* This is all what we need to know to find relation file.
* tblNode is identificator of tablespace and because of
* currently our tablespaces are equal to databases this is
* database OID. relNode is currently relation OID on creation
* but may be changed later if re... |
Add override keyword to overridden methods. | /*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty o... | /*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty o... |
Add square bracket opertator access. | //-----------------------------------------------------------------------------
// Element Access
//-----------------------------------------------------------------------------
template<class T>
T& matrix<T>::at( std::size_t row, std::size_t col ){
// TODO throw if out of bounds
return data_.at(row*cols_+col);
}
... | //-----------------------------------------------------------------------------
// Element Access
//-----------------------------------------------------------------------------
template<class T>
T& matrix<T>::at( std::size_t row, std::size_t col ){
// TODO throw if out of bounds
return data_.at(row*cols_+col);
}
... |
FIX Interface parameter for Entities | #ifndef SSPAPPLICATION_ENTITIES_STATICENTITY_H
#define SSPAPPLICATION_ENTITIES_STATICENTITY_H
#include "Entity.h"
class StaticEntity :
public Entity
{
private:
//Variables
public:
StaticEntity();
~StaticEntity();
int Initialize(int entityID, PhysicsComponent* pComp, GraphicsComponent* gComp, AIComponent* aiComp);... | #ifndef SSPAPPLICATION_ENTITIES_STATICENTITY_H
#define SSPAPPLICATION_ENTITIES_STATICENTITY_H
#include "Entity.h"
class StaticEntity :
public Entity
{
private:
//Variables
public:
StaticEntity();
~StaticEntity();
int Initialize(int entityID, PhysicsComponent* pComp, GraphicsComponent* gComp, AIComponent* aiComp =... |
Fix STARTS_WITH macro comparing 1 less character than needed | #ifndef UTIL_H
#define UTIL_H
/*** Utility functions ***/
#define ALLOC(type) ((type*) xmalloc(sizeof(type)))
void *xmalloc(size_t);
#define STARTS_WITH(x, y) (strncmp((x), (y), sizeof(y) - 1) == 0)
#endif /* UTIL_H */
| #ifndef UTIL_H
#define UTIL_H
/*** Utility functions ***/
#define ALLOC(type) ((type*) xmalloc(sizeof(type)))
void *xmalloc(size_t);
#define STARTS_WITH(x, y) (strncmp((x), (y), strlen(y)) == 0)
#endif /* UTIL_H */
|
Add source code documentation for the Comparator class | //
// RocksDBComparator.h
// ObjectiveRocks
//
// Created by Iska on 22/11/14.
// Copyright (c) 2014 BrainCookie. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSUInteger, RocksDBComparatorType)
{
RocksDBComparatorBytewiseAscending,
RocksDBComparatorBytewiseDescending,
RocksDBCompar... | //
// RocksDBComparator.h
// ObjectiveRocks
//
// Created by Iska on 22/11/14.
// Copyright (c) 2014 BrainCookie. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
An enum defining the built-in Comparators.
*/
typedef NS_ENUM(NSUInteger, RocksDBComparatorType)
{
/** @brief Orders the keys lexicogra... |
Add interface for a hash table implementation required for the next stages of the spell checker implementation. | #ifndef SPELLUTIL_H
#define SPELLUTIL_H
typedef struct spell_list_node {
struct spell_list_node *next;
void *data;
} spell_list_node;
spell_list_node *spell_list_init(void *);
int spell_list_add(spell_list_node **, void *);
void spell_list_free(spell_list_node **, void (*) (void *));
#endif
| #ifndef SPELLUTIL_H
#define SPELLUTIL_H
typedef struct spell_list_node {
struct spell_list_node *next;
void *data;
} spell_list_node;
typedef struct spell_hashtable {
char *key;
spell_list_node *val;
} spell_hashtable;
spell_list_node *spell_list_init(void *);
int spell_list_add(spell_list_node **, v... |
Remove `-?` to display help | #include "flags.h"
#include <stdio.h>
#include "laco.h"
#include "util.h"
static const char* version_matches[] = {"-v", "--version", NULL};
static const char* help_matches[] = {"-h", "-?", "--help", NULL};
/* Print off the current version of laco */
static void handle_version(LacoState* laco, const char** argume... | #include "flags.h"
#include <stdio.h>
#include "laco.h"
#include "util.h"
static const char* version_matches[] = {"-v", "--version", NULL};
static const char* help_matches[] = {"-h", "--help", NULL};
/* Print off the current version of laco */
static void handle_version(LacoState* laco, const char** arguments) {... |
Use division here, not modulo | #include <stdlib.h>
#include "ht.h"
#include "util/macros.h"
struct ht*
ht_init(
struct ht* ht,
size_t n
) {
if (ht) {
ht->buckets = calloc(n, sizeof(*ht->buckets));
ht->nbuckets = n;
}
return ht;
}
void
ht_destroy(
struct ht* ht
) {
if (ht) {
for (; ht->nbuckets ... | #include <stdlib.h>
#include "ht.h"
#include "util/macros.h"
struct ht*
ht_init(
struct ht* ht,
size_t n
) {
if (ht) {
ht->buckets = calloc(n, sizeof(*ht->buckets));
ht->nbuckets = n;
}
return ht;
}
void
ht_destroy(
struct ht* ht
) {
if (ht) {
for (; ht->nbuckets ... |
Add portability for windows OS | #include <stdio.h>
#include <stdlib.h>
#include <editline/readline.h>
#include <editline/history.h>
int main(int argc, char** argv) {
puts("zuzeelik [version: v0.0.0-0.0.2]");
puts("Press Ctrl+C to Exit \n");
/* Starting REPL */
while(1){
/* output from the prompt*/
char* input = readline("zuzeelik> ");
... | #include <stdio.h>
#include <stdlib.h>
/* if compiling in windows, compiling with this functions */
#ifdef _WIN32
#include <string.h>
static char buffer[2048];
/* fake readline functions */
char* readline(char* prompt) {
fputs(prompt, stdout);
fputs(buffer, 2048, stdin);
fgets(buffer, 2048, stdin);
char* ... |
Add options for yearly sst data, move some other stuff around a bit | C $Header$
C $Name$
c Ocean Exports
c -------------------
common /ocean_exports/ sst, sice, ksst, kice
_RL sst(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nsx,Nsy)
_RL sice(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nsx,Nsy)
integer ksst, kice
| C $Header$
C $Name$
c Ocean Parameters
c -------------------
common /ocean_params/sstclim,sstfreq,siceclim,sicefreq,ksst,kice
logical sstclim,sstfreq,siceclim,sicefreq
integer ksst, kice
c Ocean Exports
c -------------------
common /ocean_exports/ sst, sice
_RL sst(1-OLx:sNx+OLx,1-OLy:sN... |
Fix header includes to use local paths. | //
// sigen.h: global header file for user includes
// -----------------------------------
#pragma once
#include <sigen/types.h>
#include <sigen/dvb_defs.h>
#include <sigen/version.h>
#include <sigen/tstream.h>
#include <sigen/packetizer.h>
#include <sigen/utc.h>
#include <sigen/util.h>
#include <sigen/dump.h>
#inc... | //
// sigen.h: global header file for user includes
// -----------------------------------
#pragma once
#include "types.h"
#include "dvb_defs.h"
#include "version.h"
#include "tstream.h"
#include "packetizer.h"
#include "utc.h"
#include "util.h"
#include "dump.h"
#include "table.h"
#include "nit.h"
#include "bat.h"... |
Fix interval recalculation in the event that usleep is interrupted | #include <stdio.h>
#include <unistd.h>
#include <sys/time.h>
#include <stdint.h>
int
wait_a_while (useconds_t interval)
{
int num_times = 0;
int return_value = 1;
struct timeval start_time;
gettimeofday(&start_time, NULL);
uint64_t target = start_time.tv_sec * 1000000 + start_time.tv_usec + interval;
wh... | #include <stdio.h>
#include <unistd.h>
#include <sys/time.h>
#include <stdint.h>
int
wait_a_while (useconds_t interval)
{
int num_times = 0;
int return_value = 1;
struct timeval start_time;
gettimeofday(&start_time, NULL);
uint64_t target = start_time.tv_sec * 1000000 + start_time.tv_usec + interval;
wh... |
Add collatz C snippet that keeps track of highest value + total steps taken | #include <stdio.h>
#include <stdlib.h>
struct step_count {
long start;
long max;
size_t steps;
};
static
long r(long n, struct step_count* cnt)
{
printf("%ld\n", n);
//do not count last step, we're counting the initial call
//causing 63,728,127 to count 950 steps instead of expected 949
if... | |
Add ablity to look through named tables | #include "debugger.h"
#include <stdio.h>
#include <lua.h>
#include "laco.h"
void laco_print_debug_info(struct LacoState* laco,
const char* function_name) {
lua_State* L = laco_get_laco_lua_state(laco);
lua_Debug debug_info = {0};
lua_getfield(L, LUA_GLOBALSINDEX, function_name);
... | #include "debugger.h"
#include <lua.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "laco.h"
#include "util.h"
void laco_print_debug_info(struct LacoState* laco,
const char* function_name) {
int i;
char* namespace;
lua_State* L = laco_get_laco_lua_stat... |
Add library for github workflow | // Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in w... | // Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in w... |
Fix typo which used a mask for a logical-and | /*
* This file is part of GreatFET
*/
#include "usb_api_dac.h"
#include "usb.h"
#include "usb_queue.h"
#include "usb_endpoint.h"
#include <stddef.h>
#include <greatfet_core.h>
#include <dac.h>
#include <pins.h>
usb_request_status_t usb_vendor_request_dac_set(
usb_endpoint_t* const endpoint, const usb_transfer_st... | /*
* This file is part of GreatFET
*/
#include "usb_api_dac.h"
#include "usb.h"
#include "usb_queue.h"
#include "usb_endpoint.h"
#include <stddef.h>
#include <greatfet_core.h>
#include <dac.h>
#include <pins.h>
usb_request_status_t usb_vendor_request_dac_set(
usb_endpoint_t* const endpoint, const usb_transfer_st... |
Define CPP macro BOOLAN_TYPE_DEFINED when we define types BOOLEAN and BOOL_T, to avoid doing it twice. | #ifndef CONSTANTS_H
#define CONSTANTS_H
#if !defined(__STDC__) && !defined(__cplusplus)
#define const
#endif
/*
Set up a boolean variable type. Since this definition could conflict
with other reasonable definition of BOOLEAN, i.e. using an enumeration,
it is conditional.
*/
#ifndef BOOLEAN_TYPE_DEFINED
typedef i... | #ifndef CONSTANTS_H
#define CONSTANTS_H
#if !defined(__STDC__) && !defined(__cplusplus)
#define const
#endif
/*
Set up a boolean variable type. Since this definition could conflict
with other reasonable definition of BOOLEAN, i.e. using an enumeration,
it is conditional.
*/
#ifndef BOOLEAN_TYPE_DEFINED
typedef i... |
Fix compilation on OpenBSD (from Bernhard Leiner) | #ifndef XMMSC_SOCKETS_H
#define XMMSC_SOCKETS_H
#include <xmmsc/xmmsc_stdbool.h>
/* Windows */
#ifdef _MSC_VER
#include <Winsock2.h>
#include <Ws2tcpip.h>
typedef SOCKET xmms_socket_t;
typedef int socklen_t;
#define XMMS_EINTR WSAEINTR
#define XMMS_EAGAIN WSAEWOULDBLOCK
/* UNIX */
#else
#define SOCKET_ERROR (-1)
#d... | #ifndef XMMSC_SOCKETS_H
#define XMMSC_SOCKETS_H
#include <xmmsc/xmmsc_stdbool.h>
/* Windows */
#ifdef _MSC_VER
#include <Winsock2.h>
#include <Ws2tcpip.h>
typedef SOCKET xmms_socket_t;
typedef int socklen_t;
#define XMMS_EINTR WSAEINTR
#define XMMS_EAGAIN WSAEWOULDBLOCK
/* UNIX */
#else
#define SOCKET_ERROR (-1)
#d... |
Fix build error on Ubuntu 11.10, if systemtap is installed. | /* Copyright (c) 2008 Sun Microsystems, Inc.
Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in ... | /* Copyright (c) 2008 Sun Microsystems, Inc.
Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in ... |
Add verify.h to top-level include-all header. | /******************************************************************************
*
* Copyright 2017 Xaptum, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* h... | /******************************************************************************
*
* Copyright 2017 Xaptum, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* h... |
Check for newer popt, and include it in the needed libs. Give correct | #ifndef __GNOME_POPT_H__
#define __GNOME_POPT_H__ 1
#include "gnome-defs.h"
BEGIN_GNOME_DECLS
/* This is here because it does not have its own #ifdef __cplusplus */
#include <popt-gnome.h>
void gnomelib_register_popt_table(const struct poptOption *options,
const char *description);
poptContext gnomelib_pars... | #ifndef __GNOME_POPT_H__
#define __GNOME_POPT_H__ 1
#include "gnome-defs.h"
BEGIN_GNOME_DECLS
/* This is here because it does not have its own #ifdef __cplusplus */
#include <popt.h>
void gnomelib_register_popt_table(const struct poptOption *options,
const char *description);
poptContext gnomelib_parse_args... |
Fix a typo, that could cause a crash on mac. | // Copyright (c) 2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_PROXY_PROXY_RESOLVER_MAC_H_
#define NET_PROXY_PROXY_RESOLVER_MAC_H_
#pragma once
#include <string>
#include "googleurl/src/gurl.h"
#incl... | // Copyright (c) 2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_PROXY_PROXY_RESOLVER_MAC_H_
#define NET_PROXY_PROXY_RESOLVER_MAC_H_
#pragma once
#include <string>
#include "googleurl/src/gurl.h"
#incl... |
Fix build for unit test | #include "clar_libgit2.h"
#include "git2/clone.h"
static git_repository *g_repo;
#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT)
void test_online_badssl__expired(void)
{
cl_git_fail_with(GIT_ECERTIFICATE,
git_clone(&g_repo, "https://expired.badssl.com/fake.git", "./fake", NULL... | #include "clar_libgit2.h"
#include "git2/clone.h"
static git_repository *g_repo;
#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT)
static bool g_has_ssl = true;
#else
static bool g_has_ssl = false;
#endif
void test_online_badssl__expired(void)
{
if (!g_has_ssl)
cl_skip();
cl_git... |
Use !NDEBUG to detect Debug variant of build | //
// ogles_gpgpu project - GPGPU for mobile devices and embedded systems using OpenGL ES 2.0
//
// Author: Markus Konrad <post@mkonrad.net>, Winter 2014/2015
// http://www.mkonrad.net
//
// See LICENSE file in project repository root for the license.
//
#ifndef OGLES_GPGPU_COMMON_MACROS
#define OGLES_GPGPU_COMMON_MAC... | //
// ogles_gpgpu project - GPGPU for mobile devices and embedded systems using OpenGL ES 2.0
//
// Author: Markus Konrad <post@mkonrad.net>, Winter 2014/2015
// http://www.mkonrad.net
//
// See LICENSE file in project repository root for the license.
//
#ifndef OGLES_GPGPU_COMMON_MACROS
#define OGLES_GPGPU_COMMON_MAC... |
Remove unnecessary checking of size_t >= 0 | #ifndef INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_
#define INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_
#include "DLLDefines.h"
#include <vector>
#include <stddef.h>
/*
This algorithm "Quick Union With Path Compression" solves the dynamic connectivity problem.
Starting from an empty data struct... | #ifndef INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_
#define INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_
#include "DLLDefines.h"
#include <vector>
#include <stddef.h>
/*
This algorithm "Quick Union With Path Compression" solves the dynamic connectivity problem.
Starting from an empty data struct... |
Change maximum dimension of hepevt from 2000 to 4000 to be consistent between Pythia5 and 6. Note that this change implies a recompilation of jetset.f | /* @(#)root/eg:$Name$:$Id$ */
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* ... | /* @(#)root/eg:$Name: $:$Id: Hepevt.h,v 1.1.1.1 2000/05/16 17:00:47 rdm Exp $ */
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* ... |
Add List Insert function declaration | #include <stdlib.h>
#ifndef __LIST_H__
#define __LIST_H__
struct ListNode;
struct List;
typedef struct ListNode ListNode;
typedef struct List List;
List* List_Create(void);
void List_Destroy(List* l);
ListNode* ListNode_Create(void *);
void ListNode_Destroy(ListNode* n);
ListNode* List_Search(List* l, void* k, int (f)... | #include <stdlib.h>
#ifndef __LIST_H__
#define __LIST_H__
struct ListNode;
struct List;
typedef struct ListNode ListNode;
typedef struct List List;
List* List_Create(void);
void List_Destroy(List* l);
ListNode* ListNode_Create(void *);
void ListNode_Destroy(ListNode* n);
ListNode* List_Search(List* l, void* k, int (f)... |
Add Random to general header | #ifndef FMRCXX_FMRCXX_H_
#define FMRCXX_FMRCXX_H_
#include <fmrcxx/Iterator.h>
#include <fmrcxx/Range.h>
#include <fmrcxx/internal/StdMapIterator.h>
#include <fmrcxx/internal/StdContainerIterator.h>
namespace fmrcxx {
template <typename T, template <typename...> class Container, typename... TTs>
StdContainerIterator... | #ifndef FMRCXX_FMRCXX_H_
#define FMRCXX_FMRCXX_H_
#include <fmrcxx/Iterator.h>
#include <fmrcxx/Range.h>
#include <fmrcxx/Random.h>
#include <fmrcxx/internal/StdMapIterator.h>
#include <fmrcxx/internal/StdContainerIterator.h>
namespace fmrcxx {
template <typename T, template <typename...> class Container, typename..... |
Include condor_fix_string.h rather than just string.h | #include "_condor_fix_types.h"
#include "condor_fix_stdio.h"
#include <stdlib.h>
#include "condor_fix_unistd.h"
#include "condor_fix_limits.h"
#include <string.h>
#include <ctype.h>
#include <fcntl.h>
#include <errno.h>
| #include "_condor_fix_types.h"
#include "condor_fix_stdio.h"
#include <stdlib.h>
#include "condor_fix_unistd.h"
#include "condor_fix_limits.h"
#include "condor_fix_string.h"
#include <ctype.h>
#include <fcntl.h>
#include <errno.h>
|
Update Skia milestone to 107 | /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 106
#endif
| /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 107
#endif
|
Add new functor that inherits from base and has custom sigs. |
#ifndef __extendFunctor_
#define __extendFunctor_
template<class Functor, typename CSig, typename ESig>
struct ExtendedFunctor : public Functor
{
public:
typedef typename CSig::type ControlSignature;
typedef typename ESig::type ExecutionSignature;
};
#endif
| |
Include unincluded necessary header file. | #ifndef ROBOBO_H
#define ROBOBO_H
#include "main.h"
#include <string.h> // C strings to handle args
#include <sstream>
#endif | #ifndef ROBOBO_H
#define ROBOBO_H
#include "main.h"
#include "base.h"
#include <string.h> // C strings to handle args
#include <sstream>
#endif |
Change about the author url | //
// APIConstant.h
// PHPHub
//
// Created by Aufree on 9/30/15.
// Copyright (c) 2015 ESTGroup. All rights reserved.
//
#define APIAccessTokenURL [NSString stringWithFormat:@"%@%@", APIBaseURL, @"/oauth/access_token"]
#define QiniuUploadTokenIdentifier @"QiniuUploadTokenIdentifier"
#if DEBUG
#define APIBaseURL ... | //
// APIConstant.h
// PHPHub
//
// Created by Aufree on 9/30/15.
// Copyright (c) 2015 ESTGroup. All rights reserved.
//
#define APIAccessTokenURL [NSString stringWithFormat:@"%@%@", APIBaseURL, @"/oauth/access_token"]
#define QiniuUploadTokenIdentifier @"QiniuUploadTokenIdentifier"
#if DEBUG
#define APIBaseURL ... |
Set view property to strong for UIObjects. | #import "CLPBaseObject.h"
@interface CLPUIObject : CLPBaseObject
@property (nonatomic, readwrite) IBOutlet UIView *view;
- (instancetype)remove;
@end
| #import "CLPBaseObject.h"
@interface CLPUIObject : CLPBaseObject
@property (nonatomic, strong, readwrite) IBOutlet UIView *view;
- (instancetype)remove;
@end
|
Add the default source concept to NoteRepository | /* This file is part of Zanshin
Copyright 2014 Kevin Ottens <ervin@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License or (at your option) version... | /* This file is part of Zanshin
Copyright 2014 Kevin Ottens <ervin@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License or (at your option) version... |
Remove no longer used SkipEncodingUnusedStreams. | /*
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... | /*
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... |
Change repository urls to proper for this version | // Copyright (c) 2016-2020 The Karbowanec developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef UPDATE_H
#define UPDATE_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include ... | // Copyright (c) 2016-2020 The Karbowanec developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef UPDATE_H
#define UPDATE_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include ... |
Remove annoying "unreferenced function" warnings | #define BASE_SPEED_FULL 127
void base_set(int fr, int br, int bl, int fl);
void base_set(int power);
void dump_set(int x);
void lift_set(int x);
#define LCD_BUTTON_LEFT 1
#define LCD_BUTTON_CENTER 2
#define LCD_BUTTON_RIGHT 4
#define LCD_BUTTON_NONE 0
#define LCD_LINE_TOP 0
#define LCD_LINE_BOTTOM 1
... | #define BASE_SPEED_FULL 127
void base_set(int fr, int br, int bl, int fl);
void base_set(int power);
void dump_set(int x);
void lift_set(int x);
#define LCD_BUTTON_LEFT 1
#define LCD_BUTTON_CENTER 2
#define LCD_BUTTON_RIGHT 4
#define LCD_BUTTON_NONE 0
#define LCD_LINE_TOP 0
#define LCD_LINE_BOTTOM 1
... |
Change "unsigned int" -> "uint" for better GLSL compatibility | #define ATTR_POS 0
#define ATTR_UV 1
#define ATTR_COLOR 2
#define TEXUNIT_TEMP 0
#define TEXUNIT_COLOR 1
#define TEXUNIT_AREATEX 2
#define TEXUNIT_SEARCHTEX 3
#define TEXUNIT_EDGES 4
#define TEXUNIT_BLEND 5
#ifdef __cplusplus
struct Globals
#else // __cplusplus
layout(binding = 0, std140) uniform Globals
... | #define ATTR_POS 0
#define ATTR_UV 1
#define ATTR_COLOR 2
#define TEXUNIT_TEMP 0
#define TEXUNIT_COLOR 1
#define TEXUNIT_AREATEX 2
#define TEXUNIT_SEARCHTEX 3
#define TEXUNIT_EDGES 4
#define TEXUNIT_BLEND 5
#ifdef __cplusplus
struct Globals
#else // __cplusplus
layout(binding = 0, std140) uniform Globals
... |
Remove exception specifier from RandomNumberGenerator::randomize | /*************************************************
* RandomNumberGenerator Header File *
* (C) 1999-2008 Jack Lloyd *
*************************************************/
#ifndef BOTAN_RANDOM_NUMBER_GENERATOR__
#define BOTAN_RANDOM_NUMBER_GENERATOR__
#include <botan/exceptn.h>
namesp... | /*************************************************
* RandomNumberGenerator Header File *
* (C) 1999-2008 Jack Lloyd *
*************************************************/
#ifndef BOTAN_RANDOM_NUMBER_GENERATOR__
#define BOTAN_RANDOM_NUMBER_GENERATOR__
#include <botan/exceptn.h>
namesp... |
Set database encoding to UTF8. | #include "pg_query.h"
#include "pg_query_internal.h"
const char* progname = "pg_query";
void pg_query_init(void)
{
MemoryContextInit();
}
| #include "pg_query.h"
#include "pg_query_internal.h"
#include <mb/pg_wchar.h>
const char* progname = "pg_query";
void pg_query_init(void)
{
MemoryContextInit();
SetDatabaseEncoding(PG_UTF8);
}
|
Add test for special characters in macro definition |
/*
name: TEST032
description: test special characters @ and $ in macro definitions
output:
F3 I
G4 F3 main
{
\
A6 P p
A6 "54686973206973206120737472696E672024206F722023206F72202323616E64206974206973206F6B2021 'P :P
r A6 #P0 !I
}
*/
#define M1(x) "This is a string $ or # or ##" ## #x
int
main(void)
{
char *p = M1(... | |
Set removed item's prev/next pointers to NULL. | #ifndef LLIST_H
#define LLIST_H
/* Doubly linked list */
#define DLLIST_PREPEND(list, item) STMT_START { \
(item)->prev = NULL; \
(item)->next = *(list); \
if (*(list) != NULL) (*(list))->prev = (item); \
*(list) = (item); \
} STMT_END
#define DLLIST_REMOVE(list, item) STMT_START { \
if ((item)->prev == NULL) \... | #ifndef LLIST_H
#define LLIST_H
/* Doubly linked list */
#define DLLIST_PREPEND(list, item) STMT_START { \
(item)->prev = NULL; \
(item)->next = *(list); \
if (*(list) != NULL) (*(list))->prev = (item); \
*(list) = (item); \
} STMT_END
#define DLLIST_REMOVE(list, item) STMT_START { \
if ((item)->prev == NULL) \... |
Define EIGEN_USE_THREADS only if it is not defined yet | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
Create separate Solver Analyzer class | //
// Sudoku 9by9 Solver and Analyzer
//
#include "Sudoku9by9Board.h"
class Sudoku9by9SolverAnalyzer
{
private:
Sudoku9by9Board *board_ptr;
int number_of_solutions;
public:
Sudoku9by9SolverAnalyzer();
Sudoku9by9SolverAnalyzer(Sudoku9by9Board *board_ptr);
bool NextTryOrBackTrack(int i, int j, bool backtrack);
vo... | |
Add depth hold mode to enum | #ifndef CONTROL_MODE_ENUM_H
#define CONTROL_MODE_ENUM_H
namespace ControlModes
{
enum ControlMode
{
OPEN_LOOP = 0,
SIXDOF = 1,
RPY_DEPTH = 2
};
}
typedef ControlModes::ControlMode ControlMode;
#endif
| #ifndef CONTROL_MODE_ENUM_H
#define CONTROL_MODE_ENUM_H
namespace ControlModes
{
enum ControlMode
{
OPEN_LOOP = 0,
SIXDOF = 1,
RPY_DEPTH = 2,
DEPTH_HOLD = 3
};
}
typedef ControlModes::ControlMode ControlMode;
#endif
|
Create fidnArgs to replace CombinatorArgs | #include <type_traits>
namespace WSTM
{
//!{
/**
* Finds the given type in the given pack of arguments. This is useful for having variadic
* argument lists for functions. To have variadic arguments in a function just make the function
* a template and take a parameter pack of arguments. Then use fin... | |
Set the default bit width to 32. | /* Configuration for the mruby-bignum gem */
#ifndef MRB_BIGNUM_CONF_H
#define MRB_BIGNUM_CONF_H
/* Size of a Bignum digit: 16, 32 or 64 */
/* If not defined, this is the same size as a Fixnum */
/* To use MRB_BIGNUM_BIT == 64, the compiler must support unsigned __int128 */
#define MRB_BIGNUM_BIT 64
/* Define to en... | /* Configuration for the mruby-bignum gem */
#ifndef MRB_BIGNUM_CONF_H
#define MRB_BIGNUM_CONF_H
/* Size of a Bignum digit: 16, 32 or 64 */
/* If not defined, this is the same size as a Fixnum */
/* To use MRB_BIGNUM_BIT == 64, the compiler must support unsigned __int128 */
#define MRB_BIGNUM_BIT 32
/* Define to en... |
Fix compilation of the ABI test on 64 bit architectures |
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <orc/orc.h>
#include <stdio.h>
int main (int argc, char *argv[])
{
int offset;
int expected_offset;
int error = 0;
offset = ((int) ((unsigned char *) &((OrcProgram*) 0)->code_exec));
if (sizeof(void *) == 4) {
expected_offset = 8360;
} else... |
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <orc/orc.h>
#include <stdio.h>
int main (int argc, char *argv[])
{
long offset;
int expected_offset;
int error = 0;
offset = ((long) ((unsigned char *) &((OrcProgram*) 0)->code_exec));
if (sizeof(void *) == 4) {
expected_offset = 8360;
} el... |
Use stdint.h for unsigned integer typedefs | #ifndef _ARDUINO_COMPAT_H
#define _ARDUINO_COMPAT_H
#include <stdio.h>
#include <stdlib.h>
//#include <sys/types.h>
//#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>
#include <string.h>
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
typedef bool boolean;
... | #ifndef _ARDUINO_COMPAT_H
#define _ARDUINO_COMPAT_H
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
//#include <sys/types.h>
//#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>
#include <string.h>
typedef bool boolean;
//#define uint8_t unsigned char
#define FILE_READ O_RDONLY
#define FILE_WRI... |
Add moduleid and instance id | /* Copyright (C) 2015 Joakim Plate
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is... | /* Copyright (C) 2015 Joakim Plate
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is... |
Fix test on PS4 which defaults to gnu99 which does not emit the expected warnings. | // RUN: %clang_analyze_cc1 %s -verify \
// RUN: -analyzer-checker=security.insecureAPI
void builtin_function_call_crash_fixes(char *c) {
__builtin_strncpy(c, "", 6); // expected-warning{{Call to function 'strncpy' is insecure as it does not provide security checks introduced in the C11 standard.}}
__builtin_mems... | // RUN: %clang_analyze_cc1 %s -verify \
// RUN: -analyzer-checker=security.insecureAPI
// RUN: %clang_analyze_cc1 %s -verify -std=gnu11 \
// RUN: -analyzer-checker=security.insecureAPI
// RUN: %clang_analyze_cc1 %s -verify -std=gnu99 \
// RUN: -analyzer-checker=security.insecureAPI
void builtin_function_call_cra... |
Enable all test suites except the manual folder hierarchy one | #include <stdlib.h>
#include <check.h>
Suite* eas_daemon_suite (void);
Suite* eas_autodiscover_suite (void);
Suite* eas_libeasmail_suite (void);
Suite* eas_libeascal_suite (void);
Suite* eas_libeassync_suite (void);
Suite* eas_libeascon_suite (void);
Suite* eas_folderhierarchy_suite (void);
int main (void)
{
int ... | #include <stdlib.h>
#include <check.h>
Suite* eas_daemon_suite (void);
Suite* eas_autodiscover_suite (void);
Suite* eas_libeasmail_suite (void);
Suite* eas_libeascal_suite (void);
Suite* eas_libeassync_suite (void);
Suite* eas_libeascon_suite (void);
Suite* eas_folderhierarchy_suite (void);
int main (void)
{
int ... |
Set the MAX_RECURSION macro to 99 instead of 1 | #ifndef _SELECTIVE_H
#define _SELECTIVE_H
#include "psyco.h"
#include "codemanager.h"
#define FUN_BOUND -1
#define MAX_RECURSION 1
EXTERNVAR PyObject* funcs;
EXTERNVAR int ticks;
EXTERNFN int do_selective(void *, PyFrameObject *, int, PyObject *);
#endif
| #ifndef _SELECTIVE_H
#define _SELECTIVE_H
#include "psyco.h"
#include "codemanager.h"
#define FUN_BOUND -1
#define MAX_RECURSION 99
EXTERNVAR PyObject* funcs;
EXTERNVAR int ticks;
EXTERNFN int do_selective(void *, PyFrameObject *, int, PyObject *);
#endif
|
Add missing include (mostly for good practice as it's currently included transitively anyway) | /**
* Energy reading for an ODROID with INA231 power sensors, using ioctl on
* device files instead of sysfs.
*
* @author Connor Imes
* @date 2015-10-14
*/
#ifndef _ENERGYMON_ODROID_IOCTL_H_
#define _ENERGYMON_ODROID_IOCTL_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include "energymon.h"
int... | /**
* Energy reading for an ODROID with INA231 power sensors, using ioctl on
* device files instead of sysfs.
*
* @author Connor Imes
* @date 2015-10-14
*/
#ifndef _ENERGYMON_ODROID_IOCTL_H_
#define _ENERGYMON_ODROID_IOCTL_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <inttypes.h>
#include <stddef.h>
#incl... |
Set about dialog title through static const variable | #include <gtk/gtk.h>
GtkWidget *
gh_about_dialog_create ()
{
GtkWidget *dialog;
dialog = gtk_about_dialog_new ();
return dialog;
}
| #include <gtk/gtk.h>
GtkWidget *
gh_about_dialog_create ()
{
GtkWidget *dialog;
dialog = gtk_about_dialog_new ();
static gchar const *title = "About ghighlighter";
gtk_window_set_title (GTK_WINDOW (dialog), title);
return dialog;
}
|
Add removed TCE type definitions back. | typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;
#define __EMBEDDED_PROFILE__ 1
#undef cles_khr_int64
#define cl_khr_fp16
#undef cl_khr_fp64
typedef uint size_t;
typedef int ptrdiff_t;
typedef int intptr_t;
typedef uint uintptr_t;
| |
Add proper import for NIOperations | //
// Copyright 2011-2014 NimbusKit
//
// 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 t... | //
// Copyright 2011-2014 NimbusKit
//
// 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 t... |
Remove test scrolling code from idle_process | #include <logging.h>
#include <cedille/pmm.h>
#include <cedille/heap.h>
extern uint32_t _kernel_start,_kernel_end;
void vmm_init();
void kprocess_init();
void timing_system_engine_reportstatustoconsole();
void kernel_doperiodic(int force, int tick);
int kernel_idle_process() {
int i = 0;
for(;;) {
// Attempt to r... | #include <logging.h>
#include <cedille/pmm.h>
#include <cedille/heap.h>
extern uint32_t _kernel_start,_kernel_end;
void vmm_init();
void kprocess_init();
void timing_system_engine_reportstatustoconsole();
void kernel_doperiodic(int force, int tick);
int kernel_idle_process() {
for(;;) {
// Attempt to reschedule ot... |
Simplify error handling for missing/unknown numerals | #include <string.h>
#include "roman_convert_to_int.h"
int roman_convert_to_int(const char *numeral)
{
if (!numeral)
{
return -1;
}
const char first_letter = *numeral;
switch (first_letter)
{
case 'I':
return 1;
case 'V':
return 5;
case 'X':
return 10;
case 'L':
return 50;
case 'C':
re... | #include <string.h>
#include "roman_convert_to_int.h"
int roman_convert_to_int(const char *numeral)
{
const char first_letter = numeral ? *numeral : '?';
switch (first_letter)
{
case 'I':
return 1;
case 'V':
return 5;
case 'X':
return 10;
case 'L':
return 50;
case 'C':
return 100;
case '... |
Add failing test without threadescape | // PARAM: --set ana.activated "['base','mallocWrapper','threadflag']"
#include <pthread.h>
int g = 10;
void* t(void *v) {
int* p = (int*) v;
*p = 4711;
}
int main(void){
int l = 42;
pthread_t tid;
pthread_create(&tid, NULL, t, (void *)&l);
pthread_join(tid, NULL);
assert(l==42); //UNKNOWN!
return 0... | |
Update fields checksum (no changes, order only) | /*
Copyright (C) 2021 The Falco 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, s... | /*
Copyright (C) 2021 The Falco 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, s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.