Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Clean up smyrna files: remove unnecessary globals modify libraries not to rely on code in cmd/smyrna remove static declarations from .h files remove unnecessary libraries mark unused code and clean up warnings | #ifndef TOPVIEWDEFS_H
#define TOPVIEWDEFS_H
#include "smyrnadefs.h"
#include "gui.h"
#include "tvnodes.h"
#include "glcompset.h"
#endif
| /* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (c) 1994-2004 AT&T Corp... |
Fix clang-format with different clang-format version | /*
* Copyright (C) 2018 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | /*
* Copyright (C) 2018 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... |
Fix warning about initialization order (GCC/Clang, -Wreorder) | #ifndef SOCKS5UDPREQUESTMESSAGE_H
#define SOCKS5UDPREQUESTMESSAGE_H
#include <QHostAddress>
#include "SocksProtocolMessage.h"
class Socks5UDPRequestMessage : public SocksProtocolMessage
{
public:
Socks5UDPRequestMessage(QHostAddress dst, quint16 dstPort, QByteArray data, quint8 fragID=0);
Socks5UDPRequestMes... | #ifndef SOCKS5UDPREQUESTMESSAGE_H
#define SOCKS5UDPREQUESTMESSAGE_H
#include <QHostAddress>
#include "SocksProtocolMessage.h"
class Socks5UDPRequestMessage : public SocksProtocolMessage
{
public:
Socks5UDPRequestMessage(QHostAddress dst, quint16 dstPort, QByteArray data, quint8 fragID=0);
Socks5UDPRequestMes... |
Add top level MSR include file | /** @file
MSR Definitions.
Provides defines for Machine Specific Registers(MSR) indexes. Data structures
are provided for MSRs that contain one or more bit fields. If the MSR value
returned is a single 32-bit or 64-bit value, then a data structure is not
provided for that MSR.
Copyright (c) 2016,... | |
Make the error message consistent with all of the other languages | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
void swap(char *i, char *j) {
char saved = *i;
*i = *j;
*j = saved;
}
void generate_permutations(char* a, int n) {
if (n == 0) {
printf("%s\n", a);
} else {
for (int i = 0; i < n; i++) {
generate_permutations(a,... | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
void swap(char *i, char *j) {
char saved = *i;
*i = *j;
*j = saved;
}
void generate_permutations(char* a, int n) {
if (n == 0) {
printf("%s\n", a);
} else {
for (int i = 0; i < n; i++) {
generate_permutations(a,... |
Update the driver version to 8.07.00.16-k. | /*
* QLogic Fibre Channel HBA Driver
* Copyright (c) 2003-2014 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.07.00.08-k"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 7
#define QLA_DRIVER_PATCH_VER 0
#defi... | /*
* QLogic Fibre Channel HBA Driver
* Copyright (c) 2003-2014 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.07.00.16-k"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 7
#define QLA_DRIVER_PATCH_VER 0
#defi... |
Add function recv and send | int initial_connection(char *ip_addr, int port) {
int socket_desc;
struct sockaddr_in server;
//Create socket
socket_desc = socket(AF_INET , SOCK_STREAM , 0);
if (socket_desc == -1)
{
puts("Could not create socket");
return 1;
}
server.sin_addr.s_addr = inet_addr(ip_ad... | int initial_connection(char *ip_addr, int port) {
int socket_desc;
struct sockaddr_in server;
//Create socket
socket_desc = socket(AF_INET , SOCK_STREAM , 0);
if (socket_desc == -1)
{
puts("Could not create socket");
return 1;
}
server.sin_addr.s_addr = inet_addr(ip_ad... |
Use the copyright character for the about dialogs | /* $Id$ */
static char const _copyright[] =
"Copyright (c) 2006-2013 Pierre Pronchery <khorben@defora.org>";
/* This file is part of DeforaOS Desktop Mailer */
static char const _license[] =
"This program is free software: you can redistribute it and/or modify\n"
"it under the terms of the GNU General Public License as... | /* $Id$ */
static char const _copyright[] =
"Copyright © 2006-2013 Pierre Pronchery <khorben@defora.org>";
/* This file is part of DeforaOS Desktop Mailer */
static char const _license[] =
"This program is free software: you can redistribute it and/or modify\n"
"it under the terms of the GNU General Public License as p... |
Increment head and tail properly. | #include "packet_queue.h"
#include "error.h"
#include "radio.h"
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
uint32_t packet_queue_init(packet_queue_t * queue)
{
queue->head = 0;
queue->tail = 0;
return SUCCESS;
}
bool packet_queue_is_empty(packet_queue_t * queue)
{
return queue->he... | #include "packet_queue.h"
#include "error.h"
#include "radio.h"
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
uint32_t packet_queue_init(packet_queue_t * queue)
{
queue->head = 0;
queue->tail = 0;
return SUCCESS;
}
bool packet_queue_is_empty(packet_queue_t * queue)
{
return queue->he... |
Update target page url of MtConnect04S | /**
* @file mtconnect04s.c
* @brief board ID for the MtM MtConnect04S developments board
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use th... | /**
* @file mtconnect04s.c
* @brief board ID for the MtM MtConnect04S developments board
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use th... |
Add helper function Queue Full implementation | #include "queue.h"
struct Queue
{
size_t head;
size_t tail;
size_t size;
void** e;
};
Queue* Queue_Create(size_t n)
{
Queue* q = (Queue *)malloc(sizeof(Queue));
q->size = n;
q->head = q->tail = 1;
q->e = (void **)malloc(sizeof(void*) * (n + 1));
return q;
}
int Queue_Empty(Queue* q)
{
return (q->head == q-... | #include "queue.h"
struct Queue
{
size_t head;
size_t tail;
size_t size;
void** e;
};
Queue* Queue_Create(size_t n)
{
Queue* q = (Queue *)malloc(sizeof(Queue));
q->size = n;
q->head = q->tail = 1;
q->e = (void **)malloc(sizeof(void*) * (n + 1));
return q;
}
int Queue_Empty(Queue* q)
{
return (q->head == q-... |
Add example of signal handling | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "parsing.h"
#include "shutility.h"
int main(int argc, char **argv)
{
int status = 1;
int read;
size_t len;
char *buffer = NULL;
printf("----- C O N S O L E\t S I M U L A T I O N -----\n\n");
while (s... | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include "parsing.h"
#include "shutility.h"
/*
void sig_handler(int signo)
{
if (signo == SIGUSR1)
printf("Received SIGUSR1\n");
else if (signo == SIGTERM)
printf("Received SIGTERM\n");
else if (signo == SIGINT)
printf("Receive... |
Enumerate possible values for cells. | #include <stdlib.h>
/**
* @author: Hendrik Werner
*/
#define BOARD_HEIGHT 50
#define BOARD_WIDTH 50
typedef struct Position {
int row;
int col;
} Position;
int main() {
return EXIT_SUCCESS;
}
| #include <stdlib.h>
/**
* @author: Hendrik Werner
*/
#define BOARD_HEIGHT 50
#define BOARD_WIDTH 50
typedef struct Position {
int row;
int col;
} Position;
typedef enum Cell {
EMPTY
,SNAKE
,FOOD
} Cell;
int main() {
return EXIT_SUCCESS;
}
|
Use new API on empty tests | #include "test_parser_p.h"
void empty_success(void **state) {
grammar_t *grammar = grammar_init(
non_terminal("Start"),
rule_init("Start", empty()), 1);
parse_t *result = parse("hello", grammar);
assert_non_null(result);
assert_int_equal(result->length, 0);
assert_int_equal(result->n_children, 0);
}... | #include "test_parser_p.h"
void empty_success(void **state) {
grammar_t *grammar = grammar_init(
non_terminal("Start"),
rule_init("Start", empty()), 1);
parse_result_t *result = parse("hello", grammar);
assert_non_null(result);
parse_t *suc = result->data.result;
assert_int_equal(suc->length, 0);
... |
Test writing to temp file and making a snapshot | #include <glib.h>
#include <glib/gstdio.h>
#include <uuid/uuid.h>
#include <wizbit/file.h>
char *work_dir = "/tmp/wizbittest";
int main()
{
system ("rm -rf /tmp/wizbittest");
mkdir (work_dir,0700);
chdir (work_dir);
{
struct wiz_file *file;
wiz_vref vref;
FILE *fp;
file = wiz_file_open(WIZ_FILE_NEW, 0... | #include <glib.h>
#include <glib/gstdio.h>
#include <uuid/uuid.h>
#include <wizbit/file.h>
char *work_dir = "/tmp/wizbittest";
int main()
{
system ("rm -rf /tmp/wizbittest");
mkdir (work_dir,0700);
chdir (work_dir);
{
struct wiz_file *file;
wiz_vref vref;
FILE *fp;
file = wiz_file_open(WIZ_FILE_NEW, 0... |
Test code to simplify error | #include <stdio.h>
#include <stdlib.h>
typedef struct State State;
struct State
{
char c;
State *out;
};
typedef struct List List;
struct List
{
State *s;
};
State *State_new(char c, State *out)
{
State *s;
s = malloc(sizeof(*s));
s->c = c;
s->out = out;
return s;
}
void *List_new(State **outpp)
{
... | |
Add some definitions required for parsing map data | #ifndef GAMEMAPS_PARSER_H
#define GAMEMAPS_PARSER_H
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
///
/// Parses content of the map header file.
///
/// \return `true` if successful, `false` otherwise
///
bool parse_map_header(
uint8_t *header, ///< [in] The content of the map heade... | #ifndef GAMEMAPS_PARSER_H
#define GAMEMAPS_PARSER_H
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
///
/// A structure representing a plane
///
typedef struct {
uint16_t *data; ///< Plane data
size_t length; ///< The length of the plane data
} plane_t;
///
/// A structure representing a leve... |
Fix warning about implicit declaration of _wtoi() | #include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <windows.h>
#define URL "https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505\
(v=vs.85).aspx"
#define VERSION "0.1.0"
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPSTR lpCmdLine,
int nCmdShow)
{
... | #undef __STRICT_ANSI__
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <windows.h>
#define URL "https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505\
(v=vs.85).aspx"
#define VERSION "0.1.0"
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPSTR lpCmdLine,
... |
Include VOKKeyPathHelper.h as a module header | //
// VOKManagedObjectMapperMacros.h
// Vokoder
//
// Copyright © 2016 Vokal.
//
#ifndef VOKManagedObjectMapperMacros_h
#define VOKManagedObjectMapperMacros_h
#import "VOKManagedObjectMap.h"
#import <VOKKeyPathHelper.h>
/**
* Creates a map with the default date mapper.
*
* @param inputKeyPath The ... | //
// VOKManagedObjectMapperMacros.h
// Vokoder
//
// Copyright © 2016 Vokal.
//
#ifndef VOKManagedObjectMapperMacros_h
#define VOKManagedObjectMapperMacros_h
#import "VOKManagedObjectMap.h"
#import <VOKUtilities/VOKKeyPathHelper.h>
/**
* Creates a map with the default date mapper.
*
* @param inputKeyPath ... |
Split int arrays into 4 smaller int arrays | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
int* toInt(char * s, int len){
int * arr = malloc(sizeof(char) * len);
int i = 0;
for(i = 0; i < len; i++) {
arr[i] = s[i] - '0';
}
return arr;
}
int main(int argc, char *argv[]) {
int n1_len = strlen(argv[1]);
int n2_len = strlen(argv[2]);
int ... | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
int* toInt(char * s, int len){
int * arr = malloc(sizeof(int) * len);
int i = 0;
for(i = 0; i < len; i++) {
arr[i] = s[i] - '0';
}
return arr;
}
int** getabcd(int *arr1, int *arr2, int len1, int len2){
int i,j;
int *a = malloc(sizeof(int*) * (len1... |
Fix wrong success check in runtime cli | #include <stdio.h>
#include <string.h>
#include <time.h>
#include <orbit/orbit.h>
int main(int argc, const char** argv) {
if(argc < 2) {
fprintf(stderr, "error: no input module file.\n");
return -1;
}
OrbitVM* vm = orbit_vmNew();
if(orbit_vmInvoke(vm, argv[1], "main")) {
... | #include <stdio.h>
#include <string.h>
#include <time.h>
#include <orbit/orbit.h>
int main(int argc, const char** argv) {
if(argc < 2) {
fprintf(stderr, "error: no input module file.\n");
return -1;
}
OrbitVM* vm = orbit_vmNew();
if(!orbit_vmInvoke(vm, argv[1], "main")) {
... |
Add initial MonoIC compiler file | // MonoIC compiler
#ifndef IV_BREAKER_MONO_IC_H_
#define IV_BREAKER_MONO_IC_H_
namespace iv {
namespace lv5 {
namespace breaker {
class MonoIC {
};
} } } // namespace iv::lv5::breaker
#endif // IV_BREAKER_MONO_IC_H_
| |
Add a utility header that makes it easy to link in the right set of targets for various purposes. | //===- TargetSelect.h - Target Selection & Registration -------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | |
Update C support header files | #ifndef __IDRIS_DIRECTORY_H
#define __IDRIS_DIRECTORY_H
char* idris2_currentDirectory();
int idris2_changeDir(char* dir);
int idris2_createDir(char* dir);
void* idris2_openDir(char* dir);
void idris2_dirClose(void* d);
char* idris2_nextDirEntry(void* d);
#endif
| #ifndef __IDRIS_DIRECTORY_H
#define __IDRIS_DIRECTORY_H
char* idris2_currentDirectory();
int idris2_changeDir(char* dir);
int idris2_createDir(char* dir);
void* idris2_openDir(char* dir);
void idris2_closeDIr(void* d);
int idris2_removeDir(char* path);
char* idris2_nextDirEntry(void* d);
#endif
|
Remove -Wunused-private-field from pragma for gcc <= 4 | // Copyright 2012-2013 Samplecount S.L.
//
// 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 agr... | // Copyright 2012-2013 Samplecount S.L.
//
// 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 agr... |
Fix struct if-expression test warning | // RUN: %check -e %s
main()
{
struct A
{
int i;
} a, b, c;
a = b ? : c; // CHECK: error: struct involved in if-expr
}
| // RUN: %check -e %s
main()
{
struct A
{
int i;
} a, b, c;
a = b ? : c; // CHECK: error: struct involved in ?:
}
|
Fix wrong case bug causing compile error on unix platforms | #ifndef __ResourceEdit_H
#define __ResourceEdit_H
#include "midasLogAware.h"
#include "midasResourceDescTable.h"
#include <QObject>
class midasDatabaseProxy;
class QTableWidgetItem;
namespace mdo {
class Community;
class Collection;
class Item;
class Bitstream;
};
class ResourceEdit : public QObject, public... | #ifndef __ResourceEdit_H
#define __ResourceEdit_H
#include "midasLogAware.h"
#include "MidasResourceDescTable.h"
#include <QObject>
class midasDatabaseProxy;
class QTableWidgetItem;
namespace mdo {
class Community;
class Collection;
class Item;
class Bitstream;
};
class ResourceEdit : public QObject, public... |
Remove unused attribute max from int_factors. | /*
* This file is part of libFirm.
* Copyright (C) 2012 University of Karlsruhe.
*/
/**
* @file
* @brief Compute an estimate of basic block executions.
* @author Adam M. Szalkowski
* @date 28.05.2006
*/
#ifndef FIRM_ANA_EXECFREQ_T_H
#define FIRM_ANA_EXECFREQ_T_H
#include "execfreq.h"
void i... | /*
* This file is part of libFirm.
* Copyright (C) 2012 University of Karlsruhe.
*/
/**
* @file
* @brief Compute an estimate of basic block executions.
* @author Adam M. Szalkowski
* @date 28.05.2006
*/
#ifndef FIRM_ANA_EXECFREQ_T_H
#define FIRM_ANA_EXECFREQ_T_H
#include "execfreq.h"
void i... |
Test results have an end date. | // L3TestResult.h
// Created by Rob Rix on 2012-11-12.
// Copyright (c) 2012 Rob Rix. All rights reserved.
#import <Foundation/Foundation.h>
@interface L3TestResult : NSObject
+(instancetype)testResultWithName:(NSString *)name startDate:(NSDate *)startDate;
@property (strong, nonatomic) L3TestResult *parent; // ... | // L3TestResult.h
// Created by Rob Rix on 2012-11-12.
// Copyright (c) 2012 Rob Rix. All rights reserved.
#import <Foundation/Foundation.h>
@interface L3TestResult : NSObject
+(instancetype)testResultWithName:(NSString *)name startDate:(NSDate *)startDate;
@property (strong, nonatomic) L3TestResult *parent; // ... |
Add example interfaces to test a bunch of new stuff (c++ subclassing, class parameter handling) | /* -*- C++ -*- */
#ifndef FOO_H_
# define FOO_H_
#include <string>
int print_something(const char *message);
int print_something_else(const char *message2);
class SomeObject
{
std::string m_prefix;
public:
SomeObject (std::string const prefix)
: m_prefix (prefix) {}
int add_prefix (std::s... | // -*- Mode: C++; c-file-style: "stroustrup"; indent-tabs-mode:nil; -*-
#ifndef FOO_H_
# define FOO_H_
#include <string>
// Yes, this code is stupid, I know; it is only meant as an example!
int print_something(const char *message);
int print_something_else(const char *message2);
class Foo
{
std::string m_... |
Use my_sleep instead of nanosleep for portability | /* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in t... | /* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in t... |
Make GPIO_Pin_t type work by including firestorm.h | #ifndef _GPIO_H
#define _GPIO_H
#include <unistd.h>
#include "tock.h"
#define GPIO_DRIVER_NUM 1
#ifdef __cplusplus
extern "C" {
#endif
// GPIO pin enum is defined externally in platform headers
enum GPIO_Pin_enum;
typedef enum GPIO_Pin_enum GPIO_Pin_t;
typedef enum {
PullUp=0,
PullDown,
PullNone,
} GPIO_Inpu... | #ifndef _GPIO_H
#define _GPIO_H
#include <unistd.h>
#include "tock.h"
#include "firestorm.h"
#define GPIO_DRIVER_NUM 1
#ifdef __cplusplus
extern "C" {
#endif
// GPIO pin enum is defined externally in platform headers
enum GPIO_Pin_enum;
typedef enum GPIO_Pin_enum GPIO_Pin_t;
typedef enum {
PullUp=0,
PullDown,
... |
Fix tests 01/35: Any int != 0 evaluates to true | // PARAM: --enable ana.int.interval --disable ana.int.def_exc --disable ana.int.enums
void main(){
int n = 7;
for (; n; n--) {
assert(n==1); // UNKNOWN!
}
int i;
if(i-1){
assert(i==2); // UNKNOWN
}
return;
}
| // PARAM: --enable ana.int.interval --disable ana.int.def_exc --disable ana.int.enums
void main(){
int n = 7;
for (; n; n--) {
assert(n==1); // UNKNOWN!
}
int i;
if(i-1){
assert(i==2); // UNKNOWN!
}
return;
}
|
Check the reverse of an IP | #include "config.h"
#ifdef HAVE_LIBSSL
#include <openssl/ssl.h>
#include <openssl/rand.h>
#include <openssl/err.h>
#endif /* HAVE_LIBSSL */
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#in... | |
Update precompiled header -- added defines | // precompiled header
/*
*
* Author: septimomend (Ivan Chapkailo)
*
* 27.06.2017
*
*/
#define _DEFAULT_SOURCE
#define _BSD_SOURCE
#define _GNU_SOURCE
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <sys/i... | // precompiled header
/*
*
* Author: septimomend (Ivan Chapkailo)
*
* 27.06.2017
*
*/
#define _DEFAULT_SOURCE
#define _BSD_SOURCE
#define _GNU_SOURCE
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <iostream>
#include <stdarg.h>
#include <cstdlib>
#include <string>
#include <sys/ioc... |
Add new classes to LinkDef | #ifdef __CINT__
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class AliBODY;
#pragma lin... | #ifdef __CINT__
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class AliBODY;
#pragma lin... |
Add RadioHead TCP node 'driver' skeleton | /*
* This file is part of the KNOT Project
*
* Copyright (c) 2015, CESAR. 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... | |
Remove access to mat server | /* Remote access
-- Copyright (C) 2011, 2012, 2013 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- 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
--
-- ... | |
Add ability to remove the floating modifier | #include "strings.h"
#include "sway/commands.h"
#include "sway/config.h"
#include "sway/input/keyboard.h"
struct cmd_results *cmd_floating_modifier(int argc, char **argv) {
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "floating_modifier", EXPECTED_AT_LEAST, 1))) {
return error;
}
uint32_t mod =... | #include "strings.h"
#include "sway/commands.h"
#include "sway/config.h"
#include "sway/input/keyboard.h"
struct cmd_results *cmd_floating_modifier(int argc, char **argv) {
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "floating_modifier", EXPECTED_AT_LEAST, 1))) {
return error;
}
if (strcasecmp... |
Update docs to reflect that the root prefs aren’t opposed to shipit state | //
// SQRLInstaller+Private.h
// Squirrel
//
// Created by Justin Spahr-Summers on 2013-11-19.
// Copyright (c) 2013 GitHub. All rights reserved.
//
#import "SQRLInstaller.h"
// A preferences key for the URL where the target bundle has been moved before
// installation.
//
// This is stored in preferences, rather... | //
// SQRLInstaller+Private.h
// Squirrel
//
// Created by Justin Spahr-Summers on 2013-11-19.
// Copyright (c) 2013 GitHub. All rights reserved.
//
#import "SQRLInstaller.h"
// A preferences key for the URL where the target bundle has been moved before
// installation.
//
// This is stored in preferences to prev... |
Fix variable declaration non-conformant to C89 | #include <stdio.h>
void print_fib(int n)
{
int a = 0;
int b = 1;
while (a < n)
{
printf("%d ", a);
int old_a = a;
a = b;
b = old_a + b;
}
}
int main()
{
print_fib(500);
printf("\n");
return 0;
}
| #include <stdio.h>
void print_fib(int n)
{
int a = 0;
int b = 1;
while (a < n)
{
int old_a = a;
printf("%d ", a);
a = b;
b = old_a + b;
}
}
int main()
{
print_fib(500);
printf("\n");
return 0;
}
|
Add support for specifying tid print level | #pragma once
#include <string_view>
namespace tid {
enum level : int {
parent = -1,
normal = 0,
detail = 1,
pedant = 2,
};
constexpr std::string_view level2sv(level l) noexcept {
switch(l) {
case normal: return "normal";
case detail: return "... | |
Improve documentation of Future status codes. | /*
* #%L
* %%
* Copyright (C) 2011 - 2017 BMW Car IT GmbH
* %%
* 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 requir... | /*
* #%L
* %%
* Copyright (C) 2011 - 2017 BMW Car IT GmbH
* %%
* 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 requir... |
Add missing include of string | /*
*
* Copyright 2018 Asylo 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 2018 Asylo 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... |
Include signal.h instead of sys/signal.h in the test case. | #include <sys/signal.h>
#include <stdio.h>
#include <unistd.h>
void handler_usr1 (int i)
{
puts ("got signal usr1");
}
void handler_alrm (int i)
{
puts ("got signal ALRM");
}
int main ()
{
int i = 0;
signal (SIGUSR1, handler_usr1);
signal (SIGALRM, handler_alrm);
puts ("Put breakpoint here");
while ... | #include <signal.h>
#include <stdio.h>
#include <unistd.h>
void handler_usr1 (int i)
{
puts ("got signal usr1");
}
void handler_alrm (int i)
{
puts ("got signal ALRM");
}
int main ()
{
int i = 0;
signal (SIGUSR1, handler_usr1);
signal (SIGALRM, handler_alrm);
puts ("Put breakpoint here");
while (i++... |
Fix warning (struct forward-declared as class). | #ifndef SkEdgeBuilder_DEFINED
#define SkEdgeBuilder_DEFINED
#include "SkChunkAlloc.h"
#include "SkRect.h"
#include "SkTDArray.h"
class SkEdge;
class SkEdgeClipper;
class SkPath;
class SkEdgeBuilder {
public:
SkEdgeBuilder();
int build(const SkPath& path, const SkIRect* clip, int shiftUp);
SkEdge** ... | #ifndef SkEdgeBuilder_DEFINED
#define SkEdgeBuilder_DEFINED
#include "SkChunkAlloc.h"
#include "SkRect.h"
#include "SkTDArray.h"
struct SkEdge;
class SkEdgeClipper;
class SkPath;
class SkEdgeBuilder {
public:
SkEdgeBuilder();
int build(const SkPath& path, const SkIRect* clip, int shiftUp);
SkEdge**... |
Implement a GetAddress method that returns the address of the value data member | // @(#)root/meta:$Id$
// Author: Bianca-Cristina Cristescu 09/07/13
/*************************************************************************
* Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* ... | // @(#)root/meta:$Id$
// Author: Bianca-Cristina Cristescu 09/07/13
/*************************************************************************
* Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* ... |
Change uuid to char* from int for Windows | /* $Id: wUuid.h,v 1.1.2.2 2012/03/20 11:15:17 emmapollock Exp $
*
* OpenMAMA: The open middleware agnostic messaging API
* Copyright (C) 2011 NYSE Inc.
*
* 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... | /* $Id: wUuid.h,v 1.1.2.2 2012/03/20 11:15:17 emmapollock Exp $
*
* OpenMAMA: The open middleware agnostic messaging API
* Copyright (C) 2011 NYSE Inc.
*
* 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... |
Add cleaned up example where mine and mutex-* differ | // Copied & modified from 13/28.
#include <pthread.h>
#include <assert.h>
int g;
pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
pthread_mutex_lock(&A);
pthread_mutex_lock(&B);
g++;
pthread_mutex_unlock(&B); // Write Mine influence: [[g, B... | |
Mark a failing symbolizer test as XFAIL | // REQUIRES: x86_64-linux
// RUN: %host_cc -O0 -g %s -o %t 2>&1
// RUN: %t 2>&1 | llvm-symbolizer -print-source-context-lines=5 -obj=%t | FileCheck %s
#include <stdio.h>
int inc(int a) {
return a + 1;
}
int main() {
printf("%p\n", inc);
return 0;
}
// CHECK: inc
// CHECK: print_context.c:7
// CHECK: 5 : #inc... | // REQUIRES: x86_64-linux
// RUN: %host_cc -O0 -g %s -o %t 2>&1
// RUN: %t 2>&1 | llvm-symbolizer -print-source-context-lines=5 -obj=%t | FileCheck %s
//
// See PR31870 for more details on the XFAIL
// XFAIL: avr
#include <stdio.h>
int inc(int a) {
return a + 1;
}
int main() {
printf("%p\n", inc);
return 0;
}
... |
Fix from Yutaka Tanida <yutaka@marin.or.jp> | #define JMP_BUF
#define HAS_TEST_AND_SET
typedef unsigned char slock_t;
#ifndef O_DIROPEN
#define O_DIROPEN 0x100000 /* should be in sys/fcntl.h */
#endif
| #define JMP_BUF
#define HAS_TEST_AND_SET
typedef unsigned char slock_t;
#ifndef O_DIROPEN
#define O_DIROPEN 0x100000 /* should be in sys/fcntl.h */
#endif
#define tzname _tzname /* should be in time.h?*/
#define USE_POSIX_TIME
#define HAVE_INT_TIMEZONE /* has int _timezone */
|
Fix printf warning when long long is 128-bit. | #include <inttypes.h>
#include <stdio.h>
int main()
{
uint64_t rflags;
__asm__ __volatile__ ("pushf; popq %0" : "=g" (rflags) ::"memory");
printf("rFLAGS: %016llx\n", rflags);
#define BIT(name, number) \
printf("\t%s: %d\n", name, rflags & (1 << number) ? 1 : 0)
const char* bits[] = {
"CF",
"Reserved (1)",
... | #include <inttypes.h>
#include <stdio.h>
int main()
{
uint64_t rflags;
__asm__ __volatile__ ("pushf; popq %0" : "=g" (rflags) ::"memory");
printf("rFLAGS: %016llx\n", (unsigned long long)rflags);
#define BIT(name, number) \
printf("\t%s: %d\n", name, rflags & (1 << number) ? 1 : 0)
const char* bits[] = {
"CF",... |
Stop using Chrome config options. | /*
* 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 SK_BUILD... | /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT ... |
Solve Average 1 in c | #include <stdio.h>
int main() {
float a, b;
scanf("%f", &a);
scanf("%f", &b);
printf("MEDIA = %.5f\n", (a * 3.5 + b * 7.5) / 11.0);
return 0;
}
| |
Use clang++-3.5 compatible initializer_list constructor | //=== SelectorExtras.h - Helpers for checkers using selectors -----*- C++ -*-=//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //=== SelectorExtras.h - Helpers for checkers using selectors -----*- C++ -*-=//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
Move some globals to globals.h. | /* To avoid recursion in certain includes */
#ifndef _RTDEFS_H_
#define _RTDEFS_H_ 1
#define MAXCHANS 4
#define MAX_INPUT_FDS 128
#define AUDIO_DEVICE 9999999
/* definition of input file desc struct used by rtinput */
typedef struct inputdesc {
char filename[1024];
int fd;
int refcount;
#ifdef USE_SNDLIB
short he... | /* To avoid recursion in certain includes */
#ifndef _RTDEFS_H_
#define _RTDEFS_H_ 1
#define MAXCHANS 4
#define MAX_INPUT_FDS 128
#define AUDIO_DEVICE 9999999
/* definition of input file desc struct used by rtinput */
typedef struct inputdesc {
char filename[1024];
int fd;
int refcount;
#ifdef USE_SNDLIB
short he... |
Exclude header on emulator build, not test build | /* Copyright 2019 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.
*/
#ifndef __CROS_EC_DRIVER_FINGERPRINT_FPSENSOR_H_
#define __CROS_EC_DRIVER_FINGERPRINT_FPSENSOR_H_
#if defined(HAVE_PRIVATE) && !defined(TEST_BUILD... | /* Copyright 2019 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.
*/
#ifndef __CROS_EC_DRIVER_FINGERPRINT_FPSENSOR_H_
#define __CROS_EC_DRIVER_FINGERPRINT_FPSENSOR_H_
#if defined(HAVE_PRIVATE) && !defined(EMU_BUILD)... |
Add List Node Retrieve 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* k);
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* k);
void* ListNode_Retrieve(ListNode* n);
void ListNode_Destroy(ListNode* n);
ListNode... |
Update version number to 8.01.05-k3. | /*
* QLogic Fibre Channel HBA Driver
* Copyright (c) 2003-2005 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.01.05-k2"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 1
#define QLA_DRIVER_PATCH_VER 5
#define... | /*
* QLogic Fibre Channel HBA Driver
* Copyright (c) 2003-2005 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.01.05-k3"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 1
#define QLA_DRIVER_PATCH_VER 5
#define... |
Fix compiler warnings under F16/GCC 4.6.2 | /*
* db.h
*
* Copyright (C) 2011 OpenTech Labs
* Andrew Clayton <andrew@opentechlabs.co.uk>
* Released under the GNU General Public License (GPL) version 3.
* See COPYING
*/
#ifndef _DB_H_
#define _DB_H_
/* For Tokyocabinet (user sessions) */
#include <tcutil.h>
#include <tctdb.h>
#include <stdbool.h>
#inc... | /*
* db.h
*
* Copyright (C) 2011 OpenTech Labs
* Andrew Clayton <andrew@opentechlabs.co.uk>
* Released under the GNU General Public License (GPL) version 3.
* See COPYING
*/
#ifndef _DB_H_
#define _DB_H_
/* For Tokyocabinet (user sessions) */
#include <tcutil.h>
#include <tctdb.h>
#include <stdbool.h>
#inc... |
Fix for "implicit declaration of function 'ARGS_NONE' is invalid" error | #include "mruby.h"
#include "mruby/value.h"
static mrb_value longsize(mrb_state *mrb, mrb_value self)
{
uint8_t size = (uint8_t)sizeof(long);
return mrb_fixnum_value(size);
}
/* ruby calls this to load the extension */
void mrb_mruby_rubyffi_compat_gem_init(mrb_state *mrb)
{
struct RClass *mod = mrb_define_m... | #include "mruby.h"
#include "mruby/value.h"
static mrb_value longsize(mrb_state *mrb, mrb_value self)
{
uint8_t size = (uint8_t)sizeof(long);
return mrb_fixnum_value(size);
}
/* ruby calls this to load the extension */
void mrb_mruby_rubyffi_compat_gem_init(mrb_state *mrb)
{
struct RClass *mod = mrb_define_m... |
Fix the build on Win32 by making linkage of various symbols consistent again. | /* string_funcs.h
* Copyright (C) 2001-2003, The Perl Foundation.
* SVN Info
* $Id$
* Overview:
* This is the api header for the string subsystem
* Data Structure and Algorithms:
* History:
* Notes:
* References:
*/
#ifndef PARROT_STRING_PRIMITIVES_H_GUARD
#define PARROT_STRING_PRIMITIVES_H_GU... | /* string_funcs.h
* Copyright (C) 2001-2003, The Perl Foundation.
* SVN Info
* $Id$
* Overview:
* This is the api header for the string subsystem
* Data Structure and Algorithms:
* History:
* Notes:
* References:
*/
#ifndef PARROT_STRING_PRIMITIVES_H_GUARD
#define PARROT_STRING_PRIMITIVES_H_GU... |
Add solution for test of tentative declarations |
/*
name: TEST038
description: Basic test for tentative definitions
output:
*/
int x;
int x = 0;
int x;
int main();
void *
foo()
{
return &main;
}
int
main()
{
x = 0;
return x;
}
|
/*
name: TEST038
description: Basic test for tentative definitions
output:
test038.c:45: error: redeclaration of 'x'
G1 I x
(
#I0
)
F2 I E
X3 F2 main
F4 P E
G5 F4 foo
{
\
r X3 'P
}
G3 F2 main
{
\
G1 #I0 :I
r G1
}
*/
int x;
int x = 0;
int x;
int main();
void *
foo()
{
return &main;
}
int
main()
{
x = 0;
retu... |
Add roundf and lroundf replacements for VS < 2013. | /*
* Copyright (c) 2015 The WebM 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 contributin... | /*
* Copyright (c) 2015 The WebM 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 contributin... |
Remove unnecessary include of aery32/all.h | #ifndef __BOARD_H
#define __BOARD_H
#include <aery32/all.h>
#define ADC_VREF 3.0
#define ADC_BITS 10
namespace board {
void init(void);
inline double cnv_to_volt(unsigned int cnv)
{
return cnv * (ADC_VREF / (1UL << ADC_BITS));
}
} /* end of namespace board */
#endif
| #ifndef __BOARD_H
#define __BOARD_H
#define ADC_VREF 3.0
#define ADC_BITS 10
namespace board {
void init(void);
inline double cnv_to_volt(unsigned int cnv)
{
return cnv * (ADC_VREF / (1UL << ADC_BITS));
}
} /* end of namespace board */
#endif
|
Fix listing of test cases | /* Copyright 2021 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <zephyr/zephyr.h>
#include <ztest.h>
#include "ec_app_main.h"
#include "test/drivers/test_state.h"
bool drivers_predicate_pre_main(const ... | /* Copyright 2021 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <zephyr/zephyr.h>
#include <ztest.h>
#include "ec_app_main.h"
#include "test/drivers/test_state.h"
bool drivers_predicate_pre_main(const ... |
Fix bad assumptions about types. PR: 1649 Reviewed by: phk Submitted by: Jason Thorpe <thorpej@nas.nasa.gov> | /* GLOBAL.H - RSAREF types and constants
*/
/* PROTOTYPES should be set to one if and only if the compiler supports
function argument prototyping.
The following makes PROTOTYPES default to 0 if it has not already
been defined with C compiler flags.
*/
#ifndef PROTOTYPES
#define PROTOTYPES 0
#endif
/* POINTER de... | /* GLOBAL.H - RSAREF types and constants
*/
/* PROTOTYPES should be set to one if and only if the compiler supports
function argument prototyping.
The following makes PROTOTYPES default to 0 if it has not already
been defined with C compiler flags.
*/
#ifndef PROTOTYPES
#define PROTOTYPES 0
#endif
/* POINTER de... |
Remove useless defines and variables. | #ifndef E_MOD_MAIN_H
# define E_MOD_MAIN_H
# define LOGFNS 1
# ifdef LOGFNS
# include <stdio.h>
# define LOGFN(fl, ln, fn) printf("-CONF-RANDR: %25s: %5i - %s\n", fl, ln, fn);
# else
# define LOGFN(fl, ln, fn)
# endif
# ifndef ECORE_X_RANDR_1_2
# define ECORE_X_RANDR_1_2 ((1 << 16) | 2)
# endif
# ifndef ECORE_... | #ifndef E_MOD_MAIN_H
# define E_MOD_MAIN_H
//# define LOGFNS 1
# ifdef LOGFNS
# include <stdio.h>
# define LOGFN(fl, ln, fn) printf("-CONF-RANDR: %25s: %5i - %s\n", fl, ln, fn);
# else
# define LOGFN(fl, ln, fn)
# endif
EAPI extern E_Module_Api e_modapi;
EAPI void *e_modapi_init(E_Module *m);
EAPI int e_modapi_s... |
Add the beginnings of something that does SPI | #include "postgres.h"
#include "executor/spi.h"
#include "commands/trigger.h"
#include "fmgr.h"
#include "access/heapam.h"
#include "utils/syscache.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
/*
Figure out how to include these properly
#include "parrot/embed.h"
#include "parrot/debugger.h"
#include "p... | #include "postgres.h"
#include "executor/spi.h"
#include "commands/trigger.h"
#include "fmgr.h"
#include "access/heapam.h"
#include "utils/syscache.h"
#include "utils/builtins.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
/*
Figure out how to include these properly
We need to use "parrot_config include... |
Edit warning about FEATURE_UVISOR being deprecated | /*
* Copyright (c) 2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* 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/LICE... | /*
* Copyright (c) 2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* 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/LICE... |
Remove an unused struct member | #ifndef IDXGEN_H
#define IDXGEN_H
#include "encparams.h"
#include "bitstring.h"
typedef struct NtruIGFState {
int N;
int c;
int clen;
char *Z;
int zlen;
int rem_len;
NtruBitStr buf;
int counter;
void (*hash)(char[], int, char[]);
int hlen;
} NtruIGFState;
/**
* @brief IGF ini... | #ifndef IDXGEN_H
#define IDXGEN_H
#include "encparams.h"
#include "bitstring.h"
typedef struct NtruIGFState {
int N;
int c;
char *Z;
int zlen;
int rem_len;
NtruBitStr buf;
int counter;
void (*hash)(char[], int, char[]);
int hlen;
} NtruIGFState;
/**
* @brief IGF initialization
*... |
Add header file for reference | #include <wiringPi.h>
#include <softPwm.h>
#ifndef GPIOLIB_H
#define GPIOLIB_H
#define FORWARD 1
#define BACKWARD 0
namespace GPIO
{
int init();
int controlLeft(int direction,int speed);
int controlRight(int direction,int speed);
int stopLeft();
int stopRight();
int resetCounter();
void getCounter(int *co... | |
Fix pointer in skb free routine | #include "syshead.h"
#include "skbuff.h"
struct sk_buff *alloc_skb(unsigned int size)
{
struct sk_buff *skb = malloc(sizeof(struct sk_buff));
memset(skb, 0, sizeof(struct sk_buff));
skb->data = malloc(size);
memset(skb->data, 0, size);
skb->head = skb->data;
skb->tail = skb->data;
skb... | #include "syshead.h"
#include "skbuff.h"
struct sk_buff *alloc_skb(unsigned int size)
{
struct sk_buff *skb = malloc(sizeof(struct sk_buff));
memset(skb, 0, sizeof(struct sk_buff));
skb->data = malloc(size);
memset(skb->data, 0, size);
skb->head = skb->data;
skb->tail = skb->data;
skb... |
Fix compilation on Mac OS X | /*****************************************************************************
* SOUNDS HEADER *
* Provides easy access to all sounds. *
* See: sdl_snake.c *
... | /*****************************************************************************
* SOUNDS HEADER *
* Provides easy access to all sounds. *
* See: sdl_snake.c *
... |
Add another test for pretty printing if-then-else | int f(int d)
{
int i = 0, j, k, l;
if (d%2==0)
if (d%3==0)
i+=2;
else
i+=3;
if (d%2==0)
{
if (d%3==0)
i+=7;
}
else
i+=11;
l = d;
if (d%2==0)
while (l--)
if (1)
i+=13;
else
... | |
Use a forward struct str declaration to avoid recursive includes. | #ifndef BGLIBS__STR__ENV__H__
#define BGLIBS__STR__ENV__H__
#include <str/str.h>
/** \defgroup envstr envstr: Environment variables in a str.
\par Calling Convention
All functions that allocate memory return \c 0 (false) if the function
failed due to being unable to allocate memory, and non-zero (true)
otherwise.
... | #ifndef BGLIBS__STR__ENV__H__
#define BGLIBS__STR__ENV__H__
struct str;
/** \defgroup envstr envstr: Environment variables in a str.
\par Calling Convention
All functions that allocate memory return \c 0 (false) if the function
failed due to being unable to allocate memory, and non-zero (true)
otherwise.
@{ */
ex... |
Make virtual functions that need to be virtual | #include "main.h"
enum Priority { PRI_HIGH, PRI_MEDIUM_HIGH, PRI_NORMAL, PRI_MEDIUM_LOW, PRI_LOW };
#define MODULE_SPAWN(modName) extern "C" Module* spawn(std::string moduleName, std::map<std::string, std::string> config, std::string workingDir, unsigned short debugLevel, Base* botptr) {\
return new modName (module... | #include "main.h"
enum Priority { PRI_HIGH, PRI_MEDIUM_HIGH, PRI_NORMAL, PRI_MEDIUM_LOW, PRI_LOW };
#define MODULE_SPAWN(modName) extern "C" Module* spawn(std::string moduleName, std::map<std::string, std::string> config, std::string workingDir, unsigned short debugLevel, Base* botptr) {\
return new modName (module... |
Remove deprecation on int64 type. | /* Copyright 2015 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 2015 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... |
Document the interface for integer expansion, using doxygen-style comments | //===- llvm/Transforms/Utils/IntegerDivision.h ------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===- llvm/Transforms/Utils/IntegerDivision.h ------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
Add documentation comments for PersistentCookieJar | #ifndef PERSISTENT_COOKIE_JAR_H
#define PERSISTENT_COOKIE_JAR_H
#include <QMutex>
#include <QNetworkCookieJar>
#include <QList>
class QNetworkCookie;
class QObject;
class QUrl;
class PersistentCookieJar : public QNetworkCookieJar
{
Q_OBJECT
public:
explicit PersistentCookieJar(QString filename, QObject *parent... | #ifndef PERSISTENT_COOKIE_JAR_H
#define PERSISTENT_COOKIE_JAR_H
#include <QMutex>
#include <QNetworkCookieJar>
#include <QList>
class QNetworkCookie;
class QObject;
class QUrl;
/**
* Network cookie jar which loads and stores cookies on a persistent file on disk.
*/
class PersistentCookieJar : public QNetworkCooki... |
Fix GENERIC recoil_player conditional building | #pragma once
#include "game/container_sizes.h"
namespace assets {
enum class recoil_player_id {
INVALID,
GENERIC,
COUNT = MAX_RECOIL_PLAYER_COUNT + 1
};
}
| #pragma once
#include "game/container_sizes.h"
namespace assets {
enum class recoil_player_id {
INVALID,
#if BUILD_TEST_SCENES
GENERIC,
#endif
COUNT = MAX_RECOIL_PLAYER_COUNT + 1
};
}
|
Add a missing BALL_EXPORT to AutoModelCreator | #include <BALL/QSAR/Model.h>
#include <BALL/QSAR/QSARData.h>
namespace BALL
{
namespace QSAR
{
/** A class for automatic creation of the most appropriate QSAR model.\n
All available model-types are therefore evaluated using nested cross-validation and several successive feature selection steps. */
class Autom... | #include <BALL/COMMON/global.h>
#include <BALL/QSAR/Model.h>
#include <BALL/QSAR/QSARData.h>
namespace BALL
{
namespace QSAR
{
/** A class for automatic creation of the most appropriate QSAR model.\n
All available model-types are therefore evaluated using nested cross-validation and several successive feature se... |
Add change lost from CL 8577 | /*
* Copyright (c) 2012 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*
* This file exist for one purpose one: to pick fast, goto driven FSM in
* validator-x86_64.c or slower table driven FSM in validator-... | |
Change fileWithURL:sourceApplications:annotation: to be a class method. | //
// FileHelper.h
// arc
//
// Created by Jerome Cheng on 24/3/13.
// Copyright (c) 2013 nus.cs3217. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "File.h"
#import "Folder.h"
#import "FileObject.h"
@interface FileHelper : NSObject
// Used to handle files passed in from other applications thr... | //
// FileHelper.h
// arc
//
// Created by Jerome Cheng on 24/3/13.
// Copyright (c) 2013 nus.cs3217. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "File.h"
#import "Folder.h"
#import "FileObject.h"
@interface FileHelper : NSObject
// Used to handle files passed in from other applications thr... |
Move struct bundle declaration to dedicated header, and threads functions declarations to ThreadFunc.h | #include <fstream>
#include <string>
#include <vector>
#include <pthread.h>
#include <sys/epoll.h>
#include "../parser.h"
#include "connection.h"
#include "Db.h"
#include "MatrixServer.h"
typedef struct Bundle Bundle;
struct Bundle {
MatrixServer* matrix;
Db* db;
int epfd; //for init only, not use... | #include <fstream>
#include <string>
#include <vector>
#include <pthread.h>
#include <sys/epoll.h>
#include "../parser.h"
#include "connection.h"
#include "Db.h"
#include "MatrixServer.h"
#include "Bundle.h"
//main.cpp
void bundleInit(Bundle& mydata);
void bundleClean(Bundle& serverData);
void threadsL... |
Fix a stupid mistake in DCHECK definition | // Copyright (c) 2010 Timur Iskhodzhanov and others. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_COMMON_H_
#define BASE_COMMON_H_
#include <assert.h>
// Use CHECK instead of assert.
// TODO(timurrrr): print stack trace when ... | // Copyright (c) 2010 Timur Iskhodzhanov and others. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_COMMON_H_
#define BASE_COMMON_H_
#include <assert.h>
// Use CHECK instead of assert.
// TODO(timurrrr): print stack trace when ... |
Add XMMContentBlocks to framwork header file | //
// XamoomSDK.h
// XamoomSDK
//
// Created by Raphael Seher on 14/01/16.
// Copyright © 2016 xamoom GmbH. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for XamoomSDK.
FOUNDATION_EXPORT double XamoomSDKVersionNumber;
//! Project version string for XamoomSDK.
FOUNDATION_EXPORT const ... | //
// XamoomSDK.h
// XamoomSDK
//
// Created by Raphael Seher on 14/01/16.
// Copyright © 2016 xamoom GmbH. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for XamoomSDK.
FOUNDATION_EXPORT double XamoomSDKVersionNumber;
//! Project version string for XamoomSDK.
FOUNDATION_EXPORT const ... |
Add missing file from previous submit. | /*
* Copyright 2011 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... | |
Add common matrix operation interface | //The MIT License (MIT)
//
//Copyright (c) 2016 Northeastern University
//
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to us... | |
Document contents of Links array | //
// BBASearchServiceResult.h
// BBBAPI
//
// Created by Owen Worley on 12/01/2015.
// Copyright (c) 2015 Blinkbox Entertainment Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
@class FEMObjectMapping;
/**
* Represents data provided from the search service when searching for books
*/
@interface ... | //
// BBASearchServiceResult.h
// BBBAPI
//
// Created by Owen Worley on 12/01/2015.
// Copyright (c) 2015 Blinkbox Entertainment Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
@class FEMObjectMapping;
/**
* Represents data provided from the search service when searching for books
*/
@interface ... |
Include more items in our namespace with shared_ptr. | /** @file
@brief Header to bring shared_ptr into the ::osvr namespace.
@date 2014
@author
Ryan Pavlik
<ryan@sensics.com>
<http://sensics.com>
*/
// Copyright 2014 Sensics, Inc.
//
// All rights reserved.
//
// (Final version intended to be licensed under
// the Apache License, Version 2.0)
... | /** @file
@brief Header to bring shared_ptr into the ::osvr namespace.
@date 2014
@author
Ryan Pavlik
<ryan@sensics.com>
<http://sensics.com>
*/
// Copyright 2014 Sensics, Inc.
//
// All rights reserved.
//
// (Final version intended to be licensed under
// the Apache License, Version 2.0)
... |
Copy some definitions from CMakeLists.txt to preamble | #include "sampgdk.h"
#if SAMPGDK_WINDOWS
#undef CreateMenu
#undef DestroyMenu
#undef GetTickCount
#undef KillTimer
#undef SelectObject
#undef SetTimer
#include <windows.h>
#endif
| #include "sampgdk.h"
#if SAMPGDK_WINDOWS
#undef CreateMenu
#undef DestroyMenu
#undef GetTickCount
#undef KillTimer
#undef SelectObject
#undef SetTimer
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#else
#define _GNU_SOURCE
#endif
|
Add copyright and license header. | #import <Cocoa/Cocoa.h>
@interface CreamMonkey : NSObject {
}
@end
| /*
* Copyright (c) 2006 KATO Kazuyoshi <kzys@8-p.info>
* This source code is released under the MIT license.
*/
#import <Cocoa/Cocoa.h>
@interface CreamMonkey : NSObject {
}
@end
|
Remove unused includes and move rc pin definition | #include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "deps/util.h"
#include "deps/rcswitch/rcswitch.h"
#define PIN_RC PB2
#include "deps/softuart/softuart.h"
#include "packet.h"
int main(void) {
// initialize serial
softuart_init();
// enable interrupts
sei();
// ena... | #include <avr/io.h>
#include <avr/interrupt.h>
#include "deps/rcswitch/rcswitch.h"
#include "deps/softuart/softuart.h"
#include "packet.h"
#define PIN_RC PB2
int main(void) {
// initialize serial
softuart_init();
// enable interrupts
sei();
// enable the rc switch
rcswitch_enable(PIN_RC);
... |
Add environment vars and commandline arguments | /*
============================================================================
Name : thsh.c
Authors : Collin Kruger, Denton Underwood, John Christensen, Jon Stacey
Version :
Copyright : Copyright 2009 Jon Stacey. All rights reserved.
Description : Hello World in C, Ansi-style
=================... | /*
============================================================================
Name : thsh.c
Authors : Collin Kruger, Denton Underwood, John Christensen, Jon Stacey
Version :
Copyright : Copyright 2009 Jon Stacey. All rights reserved.
Description : Hello World in C, Ansi-style
=================... |
Make the MySQL tile_for_point function take arguments in the same order as the ruby version. | #include <my_global.h>
#include <my_sys.h>
#include <m_string.h>
#include <mysql.h>
#include <quad_tile.h>
my_bool tile_for_point_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
{
if ( args->arg_count != 2 ||
args->arg_type[0] != INT_RESULT ||
args->arg_type[1] != INT_RESULT )
{
strcp... | #include <my_global.h>
#include <my_sys.h>
#include <m_string.h>
#include <mysql.h>
#include <quad_tile.h>
my_bool tile_for_point_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
{
if ( args->arg_count != 2 ||
args->arg_type[0] != INT_RESULT ||
args->arg_type[1] != INT_RESULT )
{
strcp... |
Add missing header in case of no debug output | #ifndef HELPER_H
#define HELPER_H
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
#define AT() __FILE__ ":" TOSTRING(__LINE__)
#ifdef DO_DEBUG
#include <iostream>
#include <mutex>
extern std::mutex log_mutex;
#define DEBUG(x) do { std::lock_guard<std::mutex> guard(log_mutex); std::cerr << "[libnice] " << ... | #ifndef HELPER_H
#define HELPER_H
#include <string>
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
#define AT() __FILE__ ":" TOSTRING(__LINE__)
#ifdef DO_DEBUG
#include <iostream>
#include <mutex>
extern std::mutex log_mutex;
#define DEBUG(x) do { std::lock_guard<std::mutex> guard(log_mutex); std::cerr ... |
Fix typo in test case | int main(){
int a;
int b = 1;
int c = 2;
int d = 3;
a = 10/2;
c = (b+3)*4-5;
//printf(“a is %d\n",a);
return 0
}
| int main(){
int a;
int b = 1;
int c = 2;
int d = 3;
a = 10/2;
c = (b+3)*4-5;
//printf(“a is %d\n",a);
return 0;
}
|
Solve Salary with Bonus in c | #include <math.h>
#include <stdio.h>
int main() {
char a[300];
float b, c;
scanf("%s", a);
scanf("%f", &b);
scanf("%f", &c);
printf("TOTAL = R$ %.2f\n", b + round((c * 0.15) * 100) / 100);
return 0;
}
| |
Include WM8350 register definitions in CODEC header | /*
* wm8350.h - WM8903 audio codec interface
*
* Copyright 2008 Wolfson Microelectronics PLC.
*
* 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, o... | /*
* wm8350.h - WM8903 audio codec interface
*
* Copyright 2008 Wolfson Microelectronics PLC.
*
* 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, o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.