Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Use 'class' keyword for Target to treat file as C++ | /*
* target.h - input interface for Fetch module
* @author Pavel Kryukov pavel.kryukov@phystech.edu
* Copyright 2018 MIPT-MIPS
*/
#ifndef TARGET_H
#define TARGET_H
#include <infra/types.h>
/*
* Target is an input interface for Fetch module
* It contains
* * address where instruction should be fetched
* *... | /*
* target.h - input interface for Fetch module
* @author Pavel Kryukov pavel.kryukov@phystech.edu
* Copyright 2018 MIPT-MIPS
*/
#ifndef TARGET_H
#define TARGET_H
#include <infra/types.h>
/*
* Target is an input interface for Fetch module
* It contains
* * address where instruction should be fetched
* *... |
Use an unique ID for Crosswalk Extension IPC messages | // Copyright (c) 2013 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
#include "ipc/ipc_message_macros.h"
#define IPC_MESSAGE_START ExtensionMsgStart
IPC_MESSAGE_ROUTED2(XWalkViewHostMsg_PostMessage, //... | // Copyright (c) 2013 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
#include "ipc/ipc_message_macros.h"
// Note: it is safe to use numbers after LastIPCMsgStart since that limit
// is not relevant for e... |
Add more comment for library instance and remove unused internal header file. | /** @file
UEFI Runtime Services Table Library.
Copyright (c) 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license ... | /** @file
UEFI Runtime Services Table Library.
This library instance retrieve EFI_RUNTIME_SERVICES pointer from EFI system table
in library's constructor.
Copyright (c) 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available unde... |
Fix runtime_error is not a member of std | /*
* MenuRenderer.h
*
* Created on: Nov 18, 2016
* Author: msaun
*/
#ifndef MICKRENDERER_H_
#define MICKRENDERER_H_
#include <string>
#include "RuntimeException.h"
#include <SDL2/SDL.h>
#include <GL/glew.h>
#include <Rocket/Core.h>
#include <Rocket/Core/Input.h>
#include <Rocket/Debugger/Debugger.h>
#in... | /*
* MenuRenderer.h
*
* Created on: Nov 18, 2016
* Author: msaun
*/
#ifndef MICKRENDERER_H_
#define MICKRENDERER_H_
#include <stdexcept>
#include <string>
#include "RuntimeException.h"
#include <SDL2/SDL.h>
#include <GL/glew.h>
#include <Rocket/Core.h>
#include <Rocket/Core/Input.h>
#include <Rocket/Debu... |
Fix compil on MSVC + WIN32 | #ifndef MORTON_COMMON_H_
#define MORTON_COMMON_H_
#include <stdint.h>
#if _MSC_VER
#include <intrin.h>
#endif
inline bool findFirstSetBit32(const uint_fast32_t x, unsigned long* firstbit_location){
#if _MSC_VER
return _BitScanReverse(firstbit_location, x);
#elif __GNUC__
unsigned int pos = __builtin_ffs(x);
firstb... | #ifndef MORTON_COMMON_H_
#define MORTON_COMMON_H_
#include <stdint.h>
#if _MSC_VER
#include <intrin.h>
#endif
inline bool findFirstSetBit32(const uint_fast32_t x, unsigned long* firstbit_location){
#if _MSC_VER
return _BitScanReverse(firstbit_location, x);
#elif __GNUC__
unsigned int pos = __builtin_ffs(x);
firstb... |
Remove hard tabs in .h file | /*
* Copyright (c) 2012-2016 Israel Jacquez
* See LICENSE for details.
*
* Israel Jacquez <mrkotfw@gmail.com>
*/
#ifndef _VDP1_MAP_H_
#define _VDP1_MAP_H_
#include <scu-internal.h>
/* Macros specific for processor */
#define VDP1(x) (0x25D00000 + (x))
/* Helpers specific to this processor */
#define T... | /*
* Copyright (c) 2012-2016 Israel Jacquez
* See LICENSE for details.
*
* Israel Jacquez <mrkotfw@gmail.com>
*/
#ifndef _VDP1_MAP_H_
#define _VDP1_MAP_H_
#include <scu-internal.h>
/* Macros specific for processor */
#define VDP1(x) (0x25D00000 + (x))
/* Helpers specific to this processor */
#define T... |
Adjust test to fix bot error from r254927. | // RUN: %clang -target x86_64-unknown-linux -O2 %s -flto=thin -c -o %t.o
// RUN: llvm-lto -thinlto -o %t %t.o
// Ensure clang -cc1 give expected error for incorrect input type
// RUN: not %clang_cc1 -target x86_64-unknown-linux -O2 -o %t1.o %s -c -fthinlto-index=%t.thinlto.bc 2>&1 | FileCheck %s -check-prefix=CHECK-WA... | // RUN: %clang -target x86_64-unknown-linux -O2 %s -flto=thin -c -o %t.o
// RUN: llvm-lto -thinlto -o %t %t.o
// Ensure clang -cc1 give expected error for incorrect input type
// RUN: not %clang_cc1 -target x86_64-unknown-linux -O2 -o %t1.o %s -c -fthinlto-index=%t.thinlto.bc 2>&1 | FileCheck %s -check-prefix=CHECK-WA... |
Include member_keypair_TPM.h in omnibus include file. | /******************************************************************************
*
* 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... |
Set back the cursor and inputs visibility in the examples | #include <ConsoleControl.h>
#include <ConsoleControlUtility.h>
#include <ConsoleControlUI.h>
#include <BasicExamples.h>
int main() {
const char* choices[] = {
"Basic features",
"UI features",
"Exit",
};
const cc_MenuColors colors = {
BLACK,
CYAN,
BLACK,
WHITE,
BLACK,
CYAN,
BLACK
};
cc_Menu me... | #include <ConsoleControl.h>
#include <ConsoleControlUtility.h>
#include <ConsoleControlUI.h>
#include <BasicExamples.h>
int main() {
const char* choices[] = {
"Basic features",
"UI features",
"Exit",
};
const cc_MenuColors colors = {
BLACK,
CYAN,
BLACK,
WHITE,
BLACK,
CYAN,
BLACK
};
cc_Menu me... |
Test of rendering commands is now a bit more complex | /* $Id$ */
#include "GL/glc.h"
#include <stdio.h>
extern void my_init(void);
extern void my_fini(void);
void testQueso(void)
{
int ctx = 0;
int font = 0;
my_init();
ctx = glcGenContext();
glcContext(ctx);
glcAppendCatalog("/usr/lib/X11/fonts/Type1");
glcFontFace(glcNewF... | /* $Id$ */
#include "GL/glc.h"
#include <stdio.h>
extern void my_init(void);
extern void my_fini(void);
void testQueso(void)
{
int ctx = 0;
int font = 0;
my_init();
ctx = glcGenContext();
glcContext(ctx);
glcAppendCatalog("/usr/lib/X11/fonts/Type1");
glcFontFace(glcNewF... |
Remove controls header (moved to SettingsTab) | #pragma once
#include "../Controls/Controls.h"
#include "SettingsTab.h"
class OSD : public SettingsTab {
public:
OSD(HINSTANCE hInstance, LPCWSTR tabTemplate, LPCWSTR title = L"");
virtual void SaveSettings();
protected:
virtual void Initialize();
virtual void LoadSettings();
private:
/* Control... | #pragma once
#include "SettingsTab.h"
class OSD : public SettingsTab {
public:
OSD(HINSTANCE hInstance, LPCWSTR tabTemplate, LPCWSTR title = L"");
virtual void SaveSettings();
protected:
virtual void Initialize();
virtual void LoadSettings();
private:
/* Controls: */
ListView *_osdList;
... |
Fix newline at end of file | /*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of condi... | /*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of condi... |
Add code provided in class | #include <stdio.h>
#include <stdlib.h>
#include <pcap.h>
int main()
{
struct pcap_if *found_devices;
char errbuf[PCAP_ERRBUF_SIZE];
int success = 0;
success = pcap_findalldevs(&found_devices, errbuf);
if( success < 0 )
{
printf("something went wrong. can't open device\n");
}
if( found_devices != NULL )
{... | |
Add function to draw primitive circle | #ifndef _FAKE_LOCK_SCREEN_PATTERN_H_
#define _FAKE_LOCK_SCREEN_PATTERN_H_
#include <gtk/gtk.h>
#if !GTK_CHECK_VERSION(3, 0, 0)
typedef struct {
gdouble red;
gdouble green;
gdouble blue;
gdouble alpha;
} GdkRGBA;
#endif
#endif
| #ifndef _FAKE_LOCK_SCREEN_PATTERN_H_
#define _FAKE_LOCK_SCREEN_PATTERN_H_
#include <gtk/gtk.h>
#if !GTK_CHECK_VERSION(3, 0, 0)
typedef struct {
gdouble red;
gdouble green;
gdouble blue;
gdouble alpha;
} GdkRGBA;
#endif
void flsp_draw_circle(cairo_t *context,
gint x, gint y, gint radius,... |
Remove `HUBComponentIdentifier` import from umbrella header | /// Umbrella header for the Hub Framework
#import "HUBManager.h"
#import "HUBConnectivityStateResolver.h"
// JSON
#import "HUBJSONSchema.h"
#import "HUBViewModelJSONSchema.h"
#import "HUBComponentModelJSONSchema.h"
#import "HUBComponentImageDataJSONSchema.h"
#import "HUBJSONSchemaRegistry.h"
#import "HUBJSONPath.h"
#... | /// Umbrella header for the Hub Framework
#import "HUBManager.h"
#import "HUBConnectivityStateResolver.h"
// JSON
#import "HUBJSONSchema.h"
#import "HUBViewModelJSONSchema.h"
#import "HUBComponentModelJSONSchema.h"
#import "HUBComponentImageDataJSONSchema.h"
#import "HUBJSONSchemaRegistry.h"
#import "HUBJSONPath.h"
#... |
Add definition for testing bounds on array text | #! /usr/bin/tcc -run
// demonstate testmin testmax consistency with malloc
#include <string.h> // memcpy
#include <stdio.h> // printf
#include <stdlib.h> // malloc
#include <assert.h> // assert
typedef struct {ssize_t size; char *row; int count;} slot;
slot line;
slot *text;
int main(void)
{
leng = ... | #! /usr/bin/tcc -run
#include <string.h> // memcpy
#include <stdio.h> // printf
#include <stdlib.h> // malloc
#include <assert.h> // assert
#define textbound texndx = (int) (text + iy); \
assert(textmin <= texndx); \
assert(textmax >= texndx); ... |
Add Depthbuffer to precompiled header | #include <Ogre.h>
#include <OgreMeshFileFormat.h>
#include <OgreOptimisedUtil.h>
#include <OgrePredefinedControllers.h>
#ifdef WIN32
#include <OgreD3D9RenderSystem.h>
#include <OgreD3D9HLSLProgram.h>
#endif
#include <OgreOctreePlugin.h>
#include <OgreOctreeSceneManager.h>
#include <OgreCgPlugin.h>
#include <OgreCgPr... | #include <Ogre.h>
#include <OgreDepthBuffer.h>
#include <OgreMeshFileFormat.h>
#include <OgreOptimisedUtil.h>
#include <OgrePredefinedControllers.h>
#ifdef WIN32
#include <OgreD3D9RenderSystem.h>
#include <OgreD3D9HLSLProgram.h>
#endif
#include <OgreOctreePlugin.h>
#include <OgreOctreeSceneManager.h>
#include <OgreC... |
Change expecta equal() to accept any amount of argument | #import "Expecta.h"
EXPMatcherInterface(_equal, (id expected));
EXPMatcherInterface(equal, (id expected)); // to aid code completion
#define equal(expected) _equal(EXPObjectify((expected)))
| #import "Expecta.h"
EXPMatcherInterface(_equal, (id expected));
EXPMatcherInterface(equal, (id expected)); // to aid code completion
#define equal(...) _equal(EXPObjectify((__VA_ARGS__)))
|
Revert "e logs - the custom e log func breaks eina backtraces, so don't use it" | #include "e.h"
EINTERN int e_log_dom = -1;
EINTERN int
e_log_init(void)
{
e_log_dom = eina_log_domain_register("e", EINA_COLOR_WHITE);
return e_log_dom != -1;
}
EINTERN int
e_log_shutdown(void)
{
eina_log_domain_unregister(e_log_dom);
e_log_dom = -1;
return 0;
}
| #include "e.h"
EINTERN int e_log_dom = -1;
static const char *_names[] = {
"CRI",
"ERR",
"WRN",
"INF",
"DBG",
};
static void
_e_log_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc EINA_UNUSED, int line, const char *fmt, void *data EINA_UNUSED, va_list args)
{
co... |
Revert new test from 213993. | // RUN: %clang -target armv7-apple-darwin10 \
// RUN: -mno-global-merge -### -fsyntax-only %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-NGM < %t %s
// RUN: %clang -target arm64-apple-ios7 \
// RUN: -mno-global-merge -### -fsyntax-only %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-NGM < %t %s
// CHECK-NGM: "-... | // RUN: %clang -target armv7-apple-darwin10 \
// RUN: -mno-global-merge -### -fsyntax-only %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-NGM < %t %s
// RUN: %clang -target arm64-apple-ios7 \
// RUN: -mno-global-merge -### -fsyntax-only %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-NGM < %t %s
// CHECK-NGM: "-... |
Change world view distance to 3 | #pragma once
#include <boost/unordered_map.hpp>
#include "System.h"
#include "OpenSimplexNoise.h"
enum class ChunkStatus {
Generating,
Alive,
Dying,
Dead
};
typedef std::tuple<int64_t, int64_t, int64_t> ChunkKeyType;
typedef std::tuple<ChunkStatus, IDType> ChunkContainerType;
typedef boost::unordered_map<ChunkKe... | #pragma once
#include <boost/unordered_map.hpp>
#include "System.h"
#include "OpenSimplexNoise.h"
enum class ChunkStatus {
Generating,
Alive,
Dying,
Dead
};
typedef std::tuple<int64_t, int64_t, int64_t> ChunkKeyType;
typedef std::tuple<ChunkStatus, IDType> ChunkContainerType;
typedef boost::unordered_map<ChunkKe... |
Add test case for array and struct variable lvalue evaluation. | // RUN: clang -checker-simple -verify %s
struct s {};
void f(void) {
int a[10];
int (*p)[10];
p = &a;
(*p)[3] = 1;
struct s d;
struct s *q;
q = &d;
}
| |
Add test case for using mmintrin (and making sure that inlining is working with and without debug info). | // RUN: clang -triple i386-apple-darwin9 -emit-llvm -o %t %s &&
// RUN: grep define %t | count 1 &&
// RUN: clang -triple i386-apple-darwin9 -g -emit-llvm -o %t %s &&
// RUN: grep define %t | count 1
#include <mmintrin.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
int array[16] = { 0,1,2,3,4,5,6,7,8,9... | |
Add some file utility functions |
#pragma once
#include "ionTypes.h"
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <sstream>
using std::move;
using std::ifstream;
template <typename T, typename U>
U * ConditionalMapAccess(map<T, U *> & Map, T const Key)
{
auto Iterator... |
#pragma once
#include "ionTypes.h"
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <sstream>
using std::move;
using std::ifstream;
template <typename T, typename U>
U * ConditionalMapAccess(map<T, U *> & Map, T const Key)
{
auto Iterator... |
Fix comment at top of file to match file name. | /* File: connection.h
*
* Description: See "connection.c"
*
* Comments: See "notice.txt" for copyright and license information.
*
*/
#ifndef __MD5_H__
#define __MD5_H__
#include "psqlodbc.h"
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
#define MD5_ODBC
#define FRONTEND
#endif
#defi... | /* File: connection.h
*
* Description: See "md.h"
*
* Comments: See "notice.txt" for copyright and license information.
*
*/
#ifndef __MD5_H__
#define __MD5_H__
#include "psqlodbc.h"
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
#define MD5_ODBC
#define FRONTEND
#endif
#define MD5_PASSWD_LEN 35
/*... |
Add host info (add new files). | //===--- HostInfo.h - Host specific information -----------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | |
Solve Trinomial Triangle in c | #include <stdio.h>
#include <string.h>
unsigned long long memo[1000];
unsigned long long calculate_sum(unsigned long long line) {
if (memo[line] != 0) {
return memo[line];
}
if (line == 0) {
memo[line] = 1;
} else {
memo[line] = calculate_sum(line - 1) * 3;
}
return m... | |
Add BackupInfo class to public include header | //
// ObjectiveRocks.h
// ObjectiveRocks
//
// Created by Iska on 20/11/14.
// Copyright (c) 2014 BrainCookie. All rights reserved.
//
#import "RocksDB.h"
#import "RocksDBColumnFamily.h"
#import "RocksDBOptions.h"
#import "RocksDBReadOptions.h"
#import "RocksDBWriteOptions.h"
#import "RocksDBWriteBatch.h"
#import ... | //
// ObjectiveRocks.h
// ObjectiveRocks
//
// Created by Iska on 20/11/14.
// Copyright (c) 2014 BrainCookie. All rights reserved.
//
#import "RocksDB.h"
#import "RocksDBColumnFamily.h"
#import "RocksDBOptions.h"
#import "RocksDBReadOptions.h"
#import "RocksDBWriteOptions.h"
#import "RocksDBWriteBatch.h"
#import ... |
Rename our struct statvfs to struct ustatvfs to prevent libc name collision. | /*
* License: BSD-style license
* Copyright: Radek Podgorny <radek@podgorny.cz>,
* Bernd Schubert <bernd-schubert@gmx.de>
*/
#ifndef UNIONFS_H
#define UNIONFS_H
#define PATHLEN_MAX 1024
#define HIDETAG "_HIDDEN~"
#define METADIR ".unionfs/"
typedef struct {
char *path;
int fd; // used to prevent acciden... | /*
* License: BSD-style license
* Copyright: Radek Podgorny <radek@podgorny.cz>,
* Bernd Schubert <bernd-schubert@gmx.de>
*/
#ifndef UNIONFS_H
#define UNIONFS_H
#define PATHLEN_MAX 1024
#define HIDETAG "_HIDDEN~"
#define METADIR ".unionfs/"
typedef struct {
char *path;
int fd; // used to prevent acciden... |
Add more Ochoness to Bitcoin. | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_CONSENSUS_CONSENSUS_H
#define BITCOIN_CONSENSUS_CONSENSUS_H
/** ... | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Copyright (c) 2016 The Bitcoin Ocho developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_CONSENSUS_CONSE... |
Tweak the DejaGNU voodoo to match Bill's advice. | // RUN: $llvmgcc $test -c -o /dev/null |& \
// RUN: egrep {(14|15|22): warning:} | \
// RUN: wc -l | grep --quiet 3
// TARGET: *-*-darwin
// XFAIL: alpha|ia64|sparc
// END.
// Insist upon warnings for inappropriate weak attributes.
// Note the line numbers (14|15|22) embedded in the check.
// O.K.
extern int ext_weak_... | // RUN: $llvmgcc $test -c -o /dev/null |& \
// RUN: egrep {(14|15|22): warning:} | \
// RUN: wc -l | grep --quiet 3
// XTARGET: darwin
// XFAIL: *
// END.
// Insist upon warnings for inappropriate weak attributes.
// Note the line numbers (14|15|22) embedded in the check.
// O.K.
extern int ext_weak_import __attribute... |
Fix comment typo in test. | @import import_self.c;
#include "import-self-d.h"
// FIXME: This should not work; names from 'a' should not be visible here.
MyTypeA import_self_test_a;
// FIXME: This should work but does not; names from 'b' are not actually visible here.
//MyTypeC import_self_test_c;
MyTypeD import_self_test_d;
| // FIXME: This import has no effect, because the submodule isn't built yet, and
// we don't map an @import to a #include in this case.
@import import_self.c;
#include "import-self-d.h"
// FIXME: This should not work; names from 'a' should not be visible here.
MyTypeA import_self_test_a;
// FIXME: This should work but... |
Fix compile error under boost 1.38, caused by boost/random.hpp seed() | /**
* @file RandGenerator.h
* @brief generate random item ids
* @author Jun Jiang
* @date 2011-11-30
*/
#ifndef RAND_GENERATOR_H
#define RAND_GENERATOR_H
#include <util/ThreadModel.h>
#include <boost/random.hpp>
namespace sf1r
{
template<typename ValueType = int,
typename Distribution = boost::unifor... | /**
* @file RandGenerator.h
* @brief generate random item ids
* @author Jun Jiang
* @date 2011-11-30
*/
#ifndef RAND_GENERATOR_H
#define RAND_GENERATOR_H
#include <util/ThreadModel.h>
#include <boost/random.hpp>
namespace sf1r
{
template<typename ValueType = int,
typename Distribution = boost::unifor... |
Add the state definitions for Task. | #ifndef _TPOOL_TASK_BASE_H_
#define _TPOOL_TASK_BASE_H_
#include <boost/shared_ptr.hpp>
namespace tpool {
class TaskBase {
public:
typedef boost::shared_ptr<TaskBase> Ptr;
~TaskBase() {}
virtual void Do() = 0;
};
}
#endif
| #ifndef _TPOOL_TASK_BASE_H_
#define _TPOOL_TASK_BASE_H_
#include <boost/shared_ptr.hpp>
namespace tpool {
class TaskBase {
public:
typedef boost::shared_ptr<TaskBase> Ptr;
enum State {
INIT,
RUNNING,
FINISHED,
CANCELED,
};
~TaskBase() {}
virtual void Do() = 0;
... |
Add write memory barrier for aarch64 | /* Copyright (c) 2013, Linaro Limited
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/**
* @file
*
* ODP synchronisation
*/
#ifndef ODP_SYNC_H_
#define ODP_SYNC_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* Synchronise stores
*
* Ensures that all CPU store operations that pre... | /* Copyright (c) 2013, Linaro Limited
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/**
* @file
*
* ODP synchronisation
*/
#ifndef ODP_SYNC_H_
#define ODP_SYNC_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* Synchronise stores
*
* Ensures that all CPU store operations that pre... |
Update headers to match new printf | #ifndef KPUTS_H
#define KPUTS_H
#include "drivers/terminal.h"
void kputs(char* string);
void kprint_int(char* string, int i);
#endif
| #ifndef KPUTS_H
#define KPUTS_H
#include <stdarg.h>
#include "drivers/terminal.h"
void kputs(char* string);
void kprintf(char* string, ...);
#endif
|
Delete unused extern variable declared | #ifndef GRIDCELL_H
#define GRIDCELL_H
#include <gsl/gsl_rng.h>
/*
DATA STRUCTURES
*/
#define GC_NUM_STATES 4
typedef enum { DECIDUOUS,CONIFEROUS,TRANSITIONAL,MIXED} State;
typedef double StateData [GC_NUM_STATES];
typedef enum { MOORE, VONNE} NeighType;
extern State GC_POSSIBLE_STATES [GC_NUM_STATES]; // this... | #ifndef GRIDCELL_H
#define GRIDCELL_H
#include <gsl/gsl_rng.h>
/*
DATA STRUCTURES
*/
#define GC_NUM_STATES 4
typedef enum { DECIDUOUS,CONIFEROUS,TRANSITIONAL,MIXED} State;
typedef double StateData [GC_NUM_STATES];
typedef enum { MOORE, VONNE} NeighType;
typedef struct {
double meanTemp;
/*Task: list al... |
Set more rare GUI update | #ifndef GUICONSTANTS_H
#define GUICONSTANTS_H
/* Milliseconds between model updates */
static const int MODEL_UPDATE_DELAY = 500;
/* AskPassphraseDialog -- Maximum passphrase length */
static const int MAX_PASSPHRASE_SIZE = 1024;
/* CubitsGUI -- Size of icons in status bar */
static const int STATUSBAR_ICONSIZE = 16... | #ifndef GUICONSTANTS_H
#define GUICONSTANTS_H
/* Milliseconds between model updates */
static const int MODEL_UPDATE_DELAY = 5000;
/* AskPassphraseDialog -- Maximum passphrase length */
static const int MAX_PASSPHRASE_SIZE = 1024;
/* CubitsGUI -- Size of icons in status bar */
static const int STATUSBAR_ICONSIZE = 1... |
Add missing file for the MPI test. | #include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
int
main (int argc, char *argv[])
{
int rank, size, length;
char name[BUFSIZ];
MPI_Init (&argc, &argv);
MPI_Comm_rank (MPI_COMM_WORLD, &rank);
MPI_Comm_size (MPI_COMM_WORLD, &size);
MPI_Get_processor_name (name, &length);
printf ("%s: hello world ... | |
Add a basic implementation of class CycleTimer | // (C) Copyright 2017, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing,... | |
Fix ifdef for serial port header file | #ifndef TR_HUB_SERIAL_PORT_H
#define TR_HUB_SERIAL_PORT_H
#include <stdio.h> // Standard input/output definitions
#include <string.h> // String function definitions
#include <unistd.h> // UNIX standard function definitions
#include <fcntl.h> // File control definitions
#include <errno.h> // Error number d... | #ifndef TERARANGER_HUB_SERIAL_PORT_H
#define TERARANGER_HUB_SERIAL_PORT_H
#include <stdio.h> // Standard input/output definitions
#include <string.h> // String function definitions
#include <unistd.h> // UNIX standard function definitions
#include <fcntl.h> // File control definitions
#include <errno.h> /... |
Remove unused __VERIFIER_assert definition from nofun test | extern void __VERIFIER_error() __attribute__ ((__noreturn__));
extern int __VERIFIER_nondet_int();
void __VERIFIER_assert(int cond) {
if (!(cond)) {
ERROR: __VERIFIER_error();
}
return;
}
int main()
{
int x, y;
if (__VERIFIER_nondet_int())
{
x = 0;
y = 1;
}
else
... | extern void __VERIFIER_error() __attribute__ ((__noreturn__));
extern int __VERIFIER_nondet_int();
int main()
{
int x, y;
if (__VERIFIER_nondet_int())
{
x = 0;
y = 1;
}
else
{
x = 1;
y = 0;
}
// if (!(x + y == 1))
if (x + y != 1)
__VERIFIER_e... |
Add support for static lib | #ifndef QTYAML_GLOBAL_H
#define QTYAML_GLOBAL_H
#include <QtCore/QtGlobal>
#if defined(QTYAML_LIBRARY)
# define QTYAMLSHARED_EXPORT Q_DECL_EXPORT
#else
# define QTYAMLSHARED_EXPORT Q_DECL_IMPORT
#endif
#endif // QTYAML_GLOBAL_H
| #ifndef QTYAML_GLOBAL_H
#define QTYAML_GLOBAL_H
#include <QtCore/QtGlobal>
#ifdef YAML_DECLARE_STATIC
# define QTYAMLSHARED_EXPORT
#else
# ifdef QTYAML_LIBRARY
# define QTYAMLSHARED_EXPORT Q_DECL_EXPORT
# else
# define QTYAMLSHARED_EXPORT Q_DECL_IMPORT
# endif
#endif
#endif // QTYAML_GLOBAL_H
|
Add support for charset attribute and Latin1 encoding. | /* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (... | /* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (... |
Mark _slave_entry to never return | /*
* Copyright (c) 2012-2016
* See LICENSE for details.
*
* Israel Jacquez <mrkotfw@gmail.com
*/
#include <sys/cdefs.h>
#include <smpc/smc.h>
#include <cpu/instructions.h>
#include <cpu/frt.h>
#include <cpu/intc.h>
#include <cpu/map.h>
#include <cpu/slave.h>
static void _slave_entry(void);
static void _default... | /*
* Copyright (c) 2012-2016
* See LICENSE for details.
*
* Israel Jacquez <mrkotfw@gmail.com
*/
#include <sys/cdefs.h>
#include <smpc/smc.h>
#include <cpu/instructions.h>
#include <cpu/frt.h>
#include <cpu/intc.h>
#include <cpu/map.h>
#include <cpu/slave.h>
static void _slave_entry(void);
static void _defaul... |
Add definitions for the Dallas DS1742 RTC / non-volatile memory. | /*
* ds1742rtc.h - register definitions for the Real-Time-Clock / CMOS RAM
*
* Copyright (C) 1999-2001 Toshiba Corporation
* Copyright (C) 2003 Ralf Baechle (ralf@linux-mips.org)
*
* Permission is hereby granted to copy, modify and redistribute this code
* in terms of the GNU Library General Public License, Vers... | |
Use // not ; since this is C. | ; PR 1332
; RUN: %llvmgcc %s -S -o /dev/null
struct Z { int a:1; int :0; int c:1; } z;
| // PR 1332
// RUN: %llvmgcc %s -S -o /dev/null
struct Z { int a:1; int :0; int c:1; } z;
|
Remove TODO about making WrenchMenuObserver an inner class of WrenchMenu. | // Copyright 2013 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_VIEWS_TOOLBAR_WRENCH_MENU_OBSERVER_H_
#define CHROME_BROWSER_UI_VIEWS_TOOLBAR_WRENCH_MENU_OBSERVER_H_
// TODO(gbillock): Make t... | // Copyright 2013 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_VIEWS_TOOLBAR_WRENCH_MENU_OBSERVER_H_
#define CHROME_BROWSER_UI_VIEWS_TOOLBAR_WRENCH_MENU_OBSERVER_H_
class WrenchMenuObserver ... |
Sort includes 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... |
Define a potential header for interop functions | /*
* Copyright (c) 2016, Oracle and/or its affiliates.
*
* 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 ... | |
Implement a simple queue for network events | #pragma once
#include <mutex>
#include "throw_assert.h"
#include <pair>
#include <utility>
namespace Core {
// Simple multiple writer siingle reader queue implementation with infinite growth
template <class Collection>
class MWSRQueue {
public:
using T = Collection::value_type;
void push_back(T&& it) ... | |
Implement temperature program with a for loop | #include <stdio.h>
/* print Fahrenheit-Celsius table
for fahr = 0, 20, ..., 300
*/
int main(void)
{
float fahr, celsius;
int lower, upper, step;
lower = 0; // lower limit of temperature table
upper = 300; // upper limit
step = 20; // step size
printf("Fahrenheit-Celsius Table\n\n");
fahr =... | #include <stdio.h>
/* print Fahrenheit-Celsius table
for fahr = 0, 20, ..., 300
*/
// int main(void)
// {
// float fahr, celsius;
// int lower, upper, step;
// lower = 0; // lower limit of temperature table
// upper = 300; // upper limit
// step = 20; // step size
// printf("Fahrenheit-Celsiu... |
Fix export decoration of Lua module | #ifdef __cplusplus
extern "C" {
#endif
#include "lua.h"
#ifdef __cplusplus
}
#endif
#include "lualcm_lcm.h"
#include "lualcm_hash.h"
#include "lualcm_pack.h"
int luaopen_lcm_lcm(lua_State* L) {
ll_lcm_makemetatable(L);
ll_lcm_register_new(L);
return 1;
}
int luaopen_lcm__hash(lua_State* L) {
ll_hash_makemet... | #ifdef __cplusplus
extern "C" {
#endif
#include "lua.h"
#ifdef __cplusplus
}
#endif
#include "lualcm_lcm.h"
#include "lualcm_hash.h"
#include "lualcm_pack.h"
int luaopen_lcm_lcm(lua_State* L) {
ll_lcm_makemetatable(L);
ll_lcm_register_new(L);
return 1;
}
int luaopen_lcm__hash(lua_State* L) {
ll_hash_makemet... |
Correct bug : result is float, not integer | #ifndef TESTDATA_H
#define TESTDATA_H
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include "Node.h"
#include <vector>
namespace GEP
{
////////////////////////////////////////////////////////////
/// \brief TestData is data to tes... | #ifndef TESTDATA_H
#define TESTDATA_H
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include "Node.h"
#include <vector>
namespace GEP
{
////////////////////////////////////////////////////////////
/// \brief TestData is data to tes... |
Add CPU Hot Plug Data include file | /** @file
Definition for a structure sharing information for CPU hot plug.
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... | |
Add basic test for macro argument stringizer |
/*
name: TEST027
description: Test of cpp stringizer
output:
F2
G3 F2 main
{
\
A5 P p
A5 "68656C6C6F20697320626574746572207468616E20627965 'P :P
r A5 @K gK
}
*/
#define x(y) #y
int
main(void)
{
char *p;
p = x(hello) " is better than bye";
return *p;
}
| |
Add Loader and AVFoundation playback to clappr base header. | #ifndef Pods_Clappr_h
#define Pods_Clappr_h
#import <Foundation/Foundation.h>
#import <Clappr/Player.h>
#import <Clappr/CLPBaseObject.h>
#import <Clappr/CLPUIObject.h>
#import <Clappr/CLPContainer.h>
#import <Clappr/CLPPlayback.h>
#import <Clappr/CLPMediaControl.h>
#import <Clappr/CLPCore.h>
#import <Clappr/CLPPlayer... | #ifndef Pods_Clappr_h
#define Pods_Clappr_h
// System
#import <Foundation/Foundation.h>
//TODO To be excluded
#import <Clappr/Player.h>
// Core
#import <Clappr/CLPBaseObject.h>
#import <Clappr/CLPUIObject.h>
#import <Clappr/CLPContainer.h>
#import <Clappr/CLPPlayback.h>
#import <Clappr/CLPMediaControl.h>
#import <Cl... |
Purge tabs and fix a comment. | /*
* A solution to Exercise 2-3 in The C Programming Language (Second Edition).
*
* This file was written by Damien Dart, <damiendart@pobox.com>. This is free
* and unencumbered software released into the public domain. For more
* information, please refer to the accompanying "UNLICENCE" file.
*/
#include <stdin... | /*
* A solution to Exercise 2-10 in The C Programming Language (Second Edition).
*
* This file was written by Damien Dart, <damiendart@pobox.com>. This is free
* and unencumbered software released into the public domain. For more
* information, please refer to the accompanying "UNLICENCE" file.
*/
#include <stdi... |
Add a helper macro for simple async render thread invokes | #ifndef RENDERMANAGER_H
#define RENDERMANAGER_H
#include <QMutex>
#include <QQueue>
#include <QString>
#include <QThread>
#include <QWaitCondition>
#include <functional>
#include "renderdoc_replay.h"
struct IReplayRenderer;
class LambdaThread;
class RenderManager
{
public:
typedef std::function<void(IReplayRendere... | #ifndef RENDERMANAGER_H
#define RENDERMANAGER_H
#include <QMutex>
#include <QQueue>
#include <QString>
#include <QThread>
#include <QWaitCondition>
#include <functional>
#include "renderdoc_replay.h"
struct IReplayRenderer;
class LambdaThread;
// simple helper for the common case of 'we just need to run this on the ... |
Correct nonblocking receive of a value larger than 8 bytes. | /* go-rec-nb-big.c -- nonblocking receive of something big on a channel.
Copyright 2009 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file. */
#include <stdint.h>
#include <assert.h>
#include "channel.h"
_Bool
__go_receive_... | /* go-rec-nb-big.c -- nonblocking receive of something big on a channel.
Copyright 2009 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file. */
#include <stdint.h>
#include <assert.h>
#include "channel.h"
_Bool
__go_receive_... |
Fix issues with circular buffer | template<class T, size_t S>
class CircularBuffer {
public:
CircularBuffer() : index(0), count(0) {}
void push_item(T item) {
array[index + 1] = item;
index = (index + 1) % S;
count++;
}
T pop_item() {
if (count > 0) {
int old_index = index;
... | template<class T, size_t S>
class CircularBuffer {
public:
CircularBuffer() : index(0), count(0) {}
void push_item(T item) {
index = (index + 1) % S;
array[index] = item;
if (count < S) count++;
}
T pop_item() {
int old_index = index;
if (count > 0) {
... |
Implement some part of convex hull | #ifndef CONVEX_HULL_H
#define CONVEX_HULL_H
#endif | #ifndef CONVEX_HULL_H
#define CONVEX_HULL_H
#include <algorithm>
#include "Structure.h"
#include "Math/Vector2.h"
namespace ConvexHull
{
inline double Cross(const Vector2& O, const Vector2& A, const Vector2& B)
{
return (A.x - O.x) * (B.y - O.y) - (A.y - O.y) * (B.x - O.x);
}
inline std::vector<Corner*> Calcu... |
Add error code for failing query. | /*
* Copyright (C) 2010 Igalia S.L.
*
* Contact: Iago Toral Quiroga <itoral@igalia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; version 2.1 of
* the License, or (at your... | /*
* Copyright (C) 2010 Igalia S.L.
*
* Contact: Iago Toral Quiroga <itoral@igalia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; version 2.1 of
* the License, or (at your... |
Make this test not try to write on object file and test all of the output rather than just part of it. | // RUN: env QA_OVERRIDE_GCC3_OPTIONS="#+-Os +-Oz +-O +-O3 +-Oignore +a +b +c xb Xa Omagic ^-ccc-print-options " %clang x -O2 b -O3 2>&1 | FileCheck %s
// RUN: env QA_OVERRIDE_GCC3_OPTIONS="x-Werror +-mfoo" %clang -Werror %s -c 2>&1 | FileCheck %s -check-prefix=RM-WERROR
// FIXME: It seems doesn't work with gcc-driver... | // RUN: env QA_OVERRIDE_GCC3_OPTIONS="#+-Os +-Oz +-O +-O3 +-Oignore +a +b +c xb Xa Omagic ^-ccc-print-options " %clang x -O2 b -O3 2>&1 | FileCheck %s
// RUN: env QA_OVERRIDE_GCC3_OPTIONS="x-Werror +-mfoo" %clang -Werror %s -c -### 2>&1 | FileCheck %s -check-prefix=RM-WERROR
// CHECK-NOT: ###
// CHECK: Option 0 - Nam... |
Make this an empty file just with a comment in it. | #ifndef GNOME_PROPERTIES_H
#define GNOME_PROPERTIES_H
#include <libgnome/gnome-defs.h>
BEGIN_GNOME_DECLS
END_GNOME_DECLS
#endif
| /* This file is currently empty; I'm going to add new code here soon.
Oct 27 1998. Martin
*/
|
Remove llabs declaration from openlibm port |
#ifndef _OPENLIB_FINITE_H
#define _OPENLIB_FINITE_H
#include <sys/cdefs.h>
#define __BSD_VISIBLE 1
#include <../../build/extbld/third_party/lib/OpenLibm/install/openlibm_math.h>
static inline int finite(double x) {
return isfinite(x);
}
static inline int finitef(float x) {
return isfinite(x);
}
static inline i... |
#ifndef _OPENLIB_FINITE_H
#define _OPENLIB_FINITE_H
#include <sys/cdefs.h>
#define __BSD_VISIBLE 1
#include <../../build/extbld/third_party/lib/OpenLibm/install/openlibm_math.h>
static inline int finite(double x) {
return isfinite(x);
}
static inline int finitef(float x) {
return isfinite(x);
}
static inline i... |
Remove 'auto' from parameter list | // Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... | // Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... |
Solve TDA Rational in c | #include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
int16_t n, a, b, c, d, r, num, den, num_r, den_r, j;
char o, i;
scanf("%d", &n);
while (n--) {
scanf("%d %c %d %c %d %c %d", &a, &i, &b, &o, &c, &i, &d);
switch (o) {
case '+':
... | |
Add Dodge skill as temporary hack | #ifndef SKILLCOMPONENT_H_
#define SKILLCOMPONENT_H_
#include "entity/components/AttributeComponent.h"
/**
* Data structure to represent an Entity's skill.
*/
typedef struct
{
int ranks; ///< Current ranks in the skill
int xp; ///< Amount of XP earned towards next rank
} SkillComponent;
/**
* Enumeration for ide... | #ifndef SKILLCOMPONENT_H_
#define SKILLCOMPONENT_H_
#include "entity/components/AttributeComponent.h"
/**
* Data structure to represent an Entity's skill.
*/
typedef struct
{
int ranks; ///< Current ranks in the skill
int xp; ///< Amount of XP earned towards next rank
} SkillComponent;
/**
* Enumeration for ide... |
Switch Skia to the new sweep gradient impl | /*
* 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_GL_CUSTOM_SETUP_HEADER "gl/GrGLConfig_chrome.h"
#define GR_TEST_UTILS 1
#define SKIA_DLL... | /*
* 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_GL_CUSTOM_SETUP_HEADER "gl/GrGLConfig_chrome.h"
#define GR_TEST_UTILS 1
#define SKIA_DLL... |
Fix braindead pasto, caught by Matt Beaumont-Gay. | /* ===-- limits.h - stub SDK header for compiler-rt -------------------------===
*
* The LLVM Compiler Infrastructure
*
* This file is dual licensed under the MIT and the University of Illinois Open
* Source Licenses. See LICENSE.TXT for details.
*
* ===---------------------------------------... | /* ===-- limits.h - stub SDK header for compiler-rt -------------------------===
*
* The LLVM Compiler Infrastructure
*
* This file is dual licensed under the MIT and the University of Illinois Open
* Source Licenses. See LICENSE.TXT for details.
*
* ===---------------------------------------... |
Update version number to 1.55 | #pragma once
// const float in a header file can lead to duplication of the storage
// but I don't really care in this case. Just don't do it with a header
// that is included hundreds of times.
constexpr float kCurrentVersion = 1.54f;
// Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version
// ... | #pragma once
// const float in a header file can lead to duplication of the storage
// but I don't really care in this case. Just don't do it with a header
// that is included hundreds of times.
constexpr float kCurrentVersion = 1.55f;
// Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version
// ... |
Fix bug in shape yaml emit | #pragma once
#include "geometry.h"
#include "yaml_utils.h"
#include <vector>
#include <boost/shared_ptr.hpp>
#include <librevenge/librevenge.h>
namespace libpagemaker
{
class PMDPage
{
std::vector<boost::shared_ptr<PMDLineSet> > m_shapes;
public:
PMDPage() : m_shapes()
{ }
void addShape(boost::shared_ptr<PM... | #pragma once
#include "geometry.h"
#include "yaml_utils.h"
#include <vector>
#include <boost/shared_ptr.hpp>
#include <librevenge/librevenge.h>
namespace libpagemaker
{
class PMDPage
{
std::vector<boost::shared_ptr<PMDLineSet> > m_shapes;
public:
PMDPage() : m_shapes()
{ }
void addShape(boost::shared_ptr<PM... |
Revert some $OpenBSD$ additions about which there are doubts. | /* $OpenBSD: zopenbsd.c,v 1.4 2015/01/20 04:41:01 krw Exp $ */
#include <sys/types.h>
#include <sys/malloc.h>
#include <lib/libz/zutil.h>
/*
* Space allocation and freeing routines for use by zlib routines.
*/
void *
zcalloc(notused, items, size)
void *notused;
u_int items, size;
{
return mallocarray(ite... | #include <sys/types.h>
#include <sys/malloc.h>
#include <lib/libz/zutil.h>
/*
* Space allocation and freeing routines for use by zlib routines.
*/
void *
zcalloc(notused, items, size)
void *notused;
u_int items, size;
{
return mallocarray(items, size, M_DEVBUF, M_NOWAIT);
}
void
zcfree(notused, ptr)
... |
Use const reference for exception | //! \file WalkerException.h
#ifndef WALKEREXCEPTION_H
#define WALKEREXCEPTION_H
#include <stdexcept>
#include <string>
namespace WikiWalker
{
//! (base) class for exceptions in WikiWalker
class WalkerException : public std::runtime_error
{
public:
/*! Create a Walker exception with a message.
*
... | //! \file WalkerException.h
#ifndef WALKEREXCEPTION_H
#define WALKEREXCEPTION_H
#include <stdexcept>
#include <string>
namespace WikiWalker
{
//! (base) class for exceptions in WikiWalker
class WalkerException : public std::runtime_error
{
public:
/*! Create a Walker exception with a message.
*
... |
Fix forward declaration of HnswGraph. | // Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <cstdint>
namespace search::fileutil { class LoadedBuffer; }
namespace search::tensor {
class HnswGraph;
/**
* Implements loading of HNSW graph structure from binary format.
**/... | // Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <cstdint>
namespace search::fileutil { class LoadedBuffer; }
namespace search::tensor {
struct HnswGraph;
/**
* Implements loading of HNSW graph structure from binary format.
**... |
Make include file consistent with the rest of libstand. | /*-
* Copyright (c) 1998 Michael Smith.
* 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 cond... | /*-
* Copyright (c) 1998 Michael Smith.
* 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 cond... |
Fix import so it doesn't corrupt debug console | #ifdef AMPLITUDE_SSL_PINNING
//
// Amplitude+SSLPinning
// Amplitude
//
// Created by Allan on 3/11/15.
// Copyright (c) 2015 Amplitude. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Amplitude (SSLPinning)
@property (nonatomic, assign) BOOL sslPinningEnabled;
@end
#endif
| //
// Amplitude+SSLPinning
// Amplitude
//
// Created by Allan on 3/11/15.
// Copyright (c) 2015 Amplitude. All rights reserved.
//
@import Foundation;
#import "Amplitude.h"
@interface Amplitude (SSLPinning)
#ifdef AMPLITUDE_SSL_PINNING
@property (nonatomic, assign) BOOL sslPinningEnabled;
#endif
@end
|
Work from MacBook & PC | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define _Q(x) #x
#define Q(x) _Q(x)
#define print_calc(_a, _b, _op) printf("%2d "Q(_op)" %2d = %d\n", _a, _b, _a _op _b)
#define rand_num(x) rand() % x + 1
#define print_block(OP) \
_a1 = rand_num(20); \
_b1 = rand_num(20); \
print_calc(_a1, _b1, O... | |
Add experimental notice to global interceptor | /*
*
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | /*
*
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... |
Use 'unsigned:1' when we mean boolean options | #ifndef FETCH_PACK_H
#define FETCH_PACK_H
struct fetch_pack_args
{
const char *uploadpack;
int quiet;
int keep_pack;
int unpacklimit;
int use_thin_pack;
int fetch_all;
int verbose;
int depth;
int no_progress;
};
void setup_fetch_pack(struct fetch_pack_args *args);
struct ref *fetch_pack(const char *dest, in... | #ifndef FETCH_PACK_H
#define FETCH_PACK_H
struct fetch_pack_args
{
const char *uploadpack;
int unpacklimit;
int depth;
unsigned quiet:1,
keep_pack:1,
use_thin_pack:1,
fetch_all:1,
verbose:1,
no_progress:1;
};
void setup_fetch_pack(struct fetch_pack_args *args);
struct ref *fetch_pack(const char *dest, ... |
Add name method to custom tools | #ifndef QMLDESIGNER_ABSTRACTSINGLESELECTIONTOOL_H
#define QMLDESIGNER_ABSTRACTSINGLESELECTIONTOOL_H
#include "abstractformeditortool.h"
namespace QmlDesigner {
class QMLDESIGNERCORE_EXPORT AbstractCustomTool : public QmlDesigner::AbstractFormEditorTool
{
public:
AbstractCustomTool();
void selectedItemsChang... | #ifndef QMLDESIGNER_ABSTRACTSINGLESELECTIONTOOL_H
#define QMLDESIGNER_ABSTRACTSINGLESELECTIONTOOL_H
#include "abstractformeditortool.h"
namespace QmlDesigner {
class QMLDESIGNERCORE_EXPORT AbstractCustomTool : public QmlDesigner::AbstractFormEditorTool
{
public:
AbstractCustomTool();
void selectedItemsChang... |
Add mushcursor.box_idx, for Funge-98 only | // File created: 2011-09-02 23:36:23
#ifndef MUSHSPACE_CURSOR_H
#define MUSHSPACE_CURSOR_H
#include "space.all.h"
#define mushcursor MUSHSPACE_NAME(mushcursor)
// What kind of an area is the cursor in?
typedef enum MushCursorMode {
MushCursorMode_static,
MushCursorMode_dynamic,
MushCursorMode_bak,
} MushCursorMo... | // File created: 2011-09-02 23:36:23
#ifndef MUSHSPACE_CURSOR_H
#define MUSHSPACE_CURSOR_H
#include "space.all.h"
#define mushcursor MUSHSPACE_NAME(mushcursor)
// What kind of an area is the cursor in?
typedef enum MushCursorMode {
MushCursorMode_static,
MushCursorMode_dynamic,
MushCursorMode_bak,
} MushCursorMo... |
Change language to improve quality and update to new vocabulary. | testScreens: testReport: DeleteInspectionLocation
If [ tagTestSubjectLocation::_LtestSubjectLocation = "" ]
Halt Script
End If
If [ tagTestSubjectLocation::inUse = "t" ]
Show Custom Dialog [ Title: "!"; Message: "Deleting this set of test items is allowed after you delete all discoveries made during testing."; Buttons:... | testScreens: testReport: deleteInspectionLocation
If [ tagTestSubjectLocation::_LtestSubjectLocation = "" ]
Halt Script
End If
If [ tagTestSubjectLocation::inUse = "t" ]
Show Custom Dialog [ Message: "Delete all test results made in this test section before deleting it. To do this, click its green test button. Click on... |
Maintain the template string as an instance variable | // Copyright (c) 2015, Matthew Malensek.
// Distributed under the BSD 2-Clause License (see LICENSE.txt for details)
#pragma once
#include <Windows.h>
#include <unordered_map>
class Control;
class Dialog {
public:
Dialog();
Dialog(HWND parent, LPCWSTR dlgTemplate);
void AddControl(Control *control);
... | // Copyright (c) 2015, Matthew Malensek.
// Distributed under the BSD 2-Clause License (see LICENSE.txt for details)
#pragma once
#include <Windows.h>
#include <unordered_map>
class Control;
class Dialog {
public:
Dialog();
Dialog(HWND parent, LPCWSTR dlgTemplate);
void AddControl(Control *control);
... |
Remove prototypes for no longer existing functions | /*
* $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 m... | /*
* $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 *f... |
Add relational traces example where 1-clusters are needed | // SKIP PARAM: --set ana.activated[+] apron --set ana.path_sens[+] threadflag
extern int __VERIFIER_nondet_int();
#include <pthread.h>
#include <assert.h>
int g = 0;
int h = 0;
pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
pthread_mutex_lock(&A);
g = 16;
pthread_mutex_unlock(&A);
re... | |
Move the arrays out of the stack into global mem | #include "stdio.h"
#include "stdlib.h"
#define TRIALS 4
#define MATRIX_SIZE 1024
int main(int argc, char* argv[])
{
short A[MATRIX_SIZE][MATRIX_SIZE],
B[MATRIX_SIZE][MATRIX_SIZE],
C[MATRIX_SIZE][MATRIX_SIZE];
// Initalize array A and B with '1's
for (int i = 0; i < MATRIX_SIZE; ++i)
for (int k = ... | #include "stdio.h"
#include "stdlib.h"
#define TRIALS 4
#define MATRIX_SIZE 2048
short A[MATRIX_SIZE][MATRIX_SIZE],
B[MATRIX_SIZE][MATRIX_SIZE],
C[MATRIX_SIZE][MATRIX_SIZE] = {{0}};
int main(int argc, char* argv[])
{
// Initalize array A and B with '1's
for (int i = 0; i < MATRIX_SIZE; ++i)
for (int... |
Convert BUG() to use unreachable() | #ifndef _ASM_X86_BUG_H
#define _ASM_X86_BUG_H
#ifdef CONFIG_BUG
#define HAVE_ARCH_BUG
#ifdef CONFIG_DEBUG_BUGVERBOSE
#ifdef CONFIG_X86_32
# define __BUG_C0 "2:\t.long 1b, %c0\n"
#else
# define __BUG_C0 "2:\t.long 1b - 2b, %c0 - 2b\n"
#endif
#define BUG() \
do { \
asm volatile("1:\tud2\n" \
"... | #ifndef _ASM_X86_BUG_H
#define _ASM_X86_BUG_H
#ifdef CONFIG_BUG
#define HAVE_ARCH_BUG
#ifdef CONFIG_DEBUG_BUGVERBOSE
#ifdef CONFIG_X86_32
# define __BUG_C0 "2:\t.long 1b, %c0\n"
#else
# define __BUG_C0 "2:\t.long 1b - 2b, %c0 - 2b\n"
#endif
#define BUG() \
do { \
asm volatile("1:\tud2\n" \
"... |
Resolve naming conflict between Authenticate method name and enum name. | #ifndef USER_H
#define USER_H
#include <stdint.h>
#include <QString>
#include <QByteArray>
#include <QVector>
#include "../inc/pwentry.h"
class User
{
public:
enum AuthenticateFlag {
Authenticate = 0x0000,
Encrypt = 0x0001,
Decrypt = 0x0002
};
User();
User(QString u... | #ifndef USER_H
#define USER_H
#include <stdint.h>
#include <QString>
#include <QByteArray>
#include <QVector>
#include "../inc/pwentry.h"
class User
{
public:
enum AuthenticateFlag {
Auth = 0x0000,
Encrypt = 0x0001,
Decrypt = 0x0002
};
User();
User(QString username,
... |
Move by machine word size | #ifndef __STDARG_H
#define __STDARG_H
#include "sys/types.h"
typedef void *va_list;
#define va_start(l, arg) l = (void *)&arg
#define va_arg(l, type) (*(type *)(l += __WORDSIZE / 8))
#define va_end(l)
#endif
| #ifndef __STDARG_H
#define __STDARG_H
#include "sys/types.h"
typedef void *va_list;
#define va_start(l, arg) l = (void *)&arg
/*
* va_arg assumes arguments are promoted to
* machine-word size when pushed onto the stack
*/
#define va_arg(l, type) (*(type *)(l += sizeof *l))
#define va_end(l)
#endif
|
Add default values of variables | #ifndef COMPTONSPECTRUM
#define COMPTONSPECTRUM
#include "TH1F.h"
class spectrum
{
public:
spectrum(double initialEnergy, double resolution);
void setNumberOfEvents(const int events);
virtual TH1F* getHisto();
virtual void generateEvents();
protected:
double fInitialEnergy;
double fResolution;
int fEven... | #ifndef COMPTONSPECTRUM
#define COMPTONSPECTRUM
#include "TH1F.h"
class spectrum
{
public:
spectrum(double initialEnergy = 0, double resolution = 0);
void setNumberOfEvents(const int events);
virtual TH1F* getHisto();
virtual void generateEvents();
protected:
double fInitialEnergy = 0;
double fResolution ... |
Update gitignore and use typedef instead of struct | /*
* children.h - linked list for keeping node results
*
* author : Jeroen van der Heijden
* email : jeroen@transceptor.technology
* copyright : 2016, Transceptor Technology
*
* changes
* - initial version, 08-03-2016
* - refactoring, 17-06-2017
*/
#ifndef CLERI_CHILDREN_H_
#define CLERI_CHI... | /*
* children.h - linked list for keeping node results
*
* author : Jeroen van der Heijden
* email : jeroen@transceptor.technology
* copyright : 2016, Transceptor Technology
*
* changes
* - initial version, 08-03-2016
* - refactoring, 17-06-2017
*/
#ifndef CLERI_CHILDREN_H_
#define CLERI_CHI... |
Add operators for ScopedHandle when it is const | // LAF OS Library
// Copyright (C) 2019 Igara Studio S.A.
// Copyright (C) 2012-2013 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef OS_SCOPED_HANDLE_H_INCLUDED
#define OS_SCOPED_HANDLE_H_INCLUDED
#pragma once
namespace os {
template... | // LAF OS Library
// Copyright (C) 2019-2020 Igara Studio S.A.
// Copyright (C) 2012-2013 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef OS_SCOPED_HANDLE_H_INCLUDED
#define OS_SCOPED_HANDLE_H_INCLUDED
#pragma once
namespace os {
tem... |
Fix import statement in library briding header | //
// CardinalDebugToolkit.h
// CardinalDebugToolkit
//
// Created by Robin Kunde on 11/3/17.
// Copyright © 2017 Cardinal Solutions. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for CardinalDebugToolkit.
FOUNDATION_EXPORT double CardinalDebugToolkitVersionNumber;
//! Project versio... | //
// CardinalDebugToolkit.h
// CardinalDebugToolkit
//
// Created by Robin Kunde on 11/3/17.
// Copyright © 2017 Cardinal Solutions. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for CardinalDebugToolkit.
FOUNDATION_EXPORT double CardinalDebugToolkitVersionNumber;
//! Project versio... |
Add x0, y0 fields in class. | #ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <qwt_picker.h>
#include <qwt_plot_picker.h>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_enableSiz... | #ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <qwt_picker.h>
#include <qwt_plot_picker.h>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_enableSiz... |
Update library name to new bellagio library. | /*
* Copyright (C) 2007-2008 Nokia Corporation.
*
* Author: Felipe Contreras <felipe.contreras@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation
* version 2.1 of the Lic... | /*
* Copyright (C) 2007-2008 Nokia Corporation.
*
* Author: Felipe Contreras <felipe.contreras@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation
* version 2.1 of the Lic... |
Add function side-effect test cast. | // RUN: clang -checker-simple -verify %s
// RUN: clang -checker-simple -analyzer-store-region -verify %s
struct s {
int data;
int data_array[10];
};
typedef struct {
int data;
} STYPE;
void f(void) {
int a[10];
int (*p)[10];
p = &a;
(*p)[3] = 1;
struct s d;
struct s *q;
q = &d;
q->data = 3;
... | // RUN: clang -checker-simple -verify %s
// RUN: clang -checker-simple -analyzer-store-region -verify %s
struct s {
int data;
int data_array[10];
};
typedef struct {
int data;
} STYPE;
void g1(struct s* p);
void f(void) {
int a[10];
int (*p)[10];
p = &a;
(*p)[3] = 1;
struct s d;
struct s *q;
... |
Include stdint to get uint16_t | #include "config.h"
#include <msp430.h>
void delayMs(uint16_t ms);
static void
cpu_init(void) {
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
/* Set proper CPU clock speed */
DCOCTL = 0;
#if CPU_FREQ == 1
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;
#elif CPU_FREQ == 8
BCSCTL1 = CALBC1_8MHZ;
DC... | #include "config.h"
#include <msp430.h>
#include <stdint.h>
void delayMs(uint16_t ms);
static void
cpu_init(void) {
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
/* Set proper CPU clock speed */
DCOCTL = 0;
#if CPU_FREQ == 1
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;
#elif CPU_FREQ == 8
BCSCTL1 =... |
Apply patch for C standards compliance: "All declarations that refer to the same object or function shall have compatible type; otherwise, the behavior is undefined." (That's from ISO/IEC 9899:TC2 final committee draft, section 6.2.7.) | /* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (... | /* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.