commit
stringlengths 40
40
| old_file
stringlengths 4
112
| new_file
stringlengths 4
112
| old_contents
stringlengths 0
2.05k
| new_contents
stringlengths 28
3.9k
| subject
stringlengths 17
736
| message
stringlengths 18
4.78k
| lang
stringclasses 1
value | license
stringclasses 13
values | repos
stringlengths 7
111k
|
---|---|---|---|---|---|---|---|---|---|
7a193d8267c2d21a9236c8950a8f5e896535d5cf | link-grammar/dict-file/word-file.h | link-grammar/dict-file/word-file.h | /*************************************************************************/
/* Copyright (c) 2004 */
/* Daniel Sleator, David Temperley, and John Lafferty */
/* Copyright (c) 2014 Linas Vepstas */
/* All rights reserved */
/* */
/* Use of the link grammar parsing system is subject to the terms of the */
/* license set forth in the LICENSE file included with this software. */
/* This license allows free redistribution and use in source and binary */
/* forms, with or without modification, subject to certain conditions. */
/* */
/*************************************************************************/
#include "dict-api.h"
#include "structures.h"
/* The structure below stores a list of dictionary word files. */
struct Word_file_struct
{
Word_file * next;
const char *file; /* the file name */
bool changed; /* TRUE if this file has been changed */
};
void free_Word_file(Word_file * wf);
Dict_node * read_word_file(Dictionary dict, Dict_node * dn, char * filename);
| /*************************************************************************/
/* Copyright (c) 2004 */
/* Daniel Sleator, David Temperley, and John Lafferty */
/* Copyright (c) 2014 Linas Vepstas */
/* All rights reserved */
/* */
/* Use of the link grammar parsing system is subject to the terms of the */
/* license set forth in the LICENSE file included with this software. */
/* This license allows free redistribution and use in source and binary */
/* forms, with or without modification, subject to certain conditions. */
/* */
/*************************************************************************/
#include "dict-api.h"
#include "structures.h"
/* The structure below stores a list of dictionary word files. */
struct Word_file_struct
{
Word_file * next;
const char *file; /* the file name */
bool changed; /* TRUE if this file has been changed (XXX unused) */
};
void free_Word_file(Word_file * wf);
Dict_node * read_word_file(Dictionary dict, Dict_node * dn, char * filename);
| Add a comment that "changed" is unused. | Word_file_struct: Add a comment that "changed" is unused.
| C | lgpl-2.1 | linas/link-grammar,linas/link-grammar,ampli/link-grammar,opencog/link-grammar,ampli/link-grammar,linas/link-grammar,ampli/link-grammar,ampli/link-grammar,linas/link-grammar,ampli/link-grammar,opencog/link-grammar,linas/link-grammar,ampli/link-grammar,linas/link-grammar,ampli/link-grammar,ampli/link-grammar,opencog/link-grammar,opencog/link-grammar,opencog/link-grammar,opencog/link-grammar,linas/link-grammar,opencog/link-grammar,linas/link-grammar,linas/link-grammar,opencog/link-grammar,ampli/link-grammar,opencog/link-grammar |
83a2eb0cdc19142fcffc331e1621e04f2504acbe | engine/core/command_line.h | engine/core/command_line.h | /*
Copyright (c) 2013 Daniele Bartolini, Michele Rossi
Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include "string_utils.h"
namespace crown
{
/// Helper for parsing command line.
struct CommandLine
{
CommandLine(int argc, char** argv)
: _argc(argc)
, _argv(argv)
{
}
int find_argument(const char* longopt, char shortopt)
{
for (int i = 0; i < _argc; i++)
{
if ((shortopt != '\0' && string::strlen(_argv[i]) > 1 && _argv[i][0] == '-' && _argv[i][1] == shortopt) ||
(string::strlen(_argv[i]) > 2 && _argv[i][0] == '-' && _argv[i][1] == '-' && string::strcmp(&_argv[i][2], longopt) == 0))
{
return i;
}
}
return _argc;
}
const char* get_parameter(const char* longopt, char shortopt = '\0')
{
int argc = find_argument(longopt, shortopt);
return argc < _argc ? _argv[argc + 1] : NULL;
}
bool has_argument(const char* longopt, char shortopt = '\0')
{
return find_argument(longopt, shortopt) < _argc;
}
private:
int _argc;
char** _argv;
};
} // namespace crown
| Add CommandLine for easier command line parsing | Add CommandLine for easier command line parsing
| C | mit | dbartolini/crown,mikymod/crown,dbartolini/crown,mikymod/crown,dbartolini/crown,galek/crown,taylor001/crown,taylor001/crown,taylor001/crown,galek/crown,taylor001/crown,galek/crown,dbartolini/crown,mikymod/crown,mikymod/crown,galek/crown |
|
9ba94e34a669269b923799cfba6cd12363d78be0 | src/libpcp/src/avahi.h | src/libpcp/src/avahi.h | /*
* Copyright (c) 2013 Red Hat.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
#ifndef AVAHI_H
#define AVAHI_H
typedef struct __pmServerPresence __pmServerPresence;
void __pmServerAvahiAdvertisePresence(__pmServerPresence *) _PCP_HIDDEN;
void __pmServerAvahiUnadvertisePresence(__pmServerPresence *) _PCP_HIDDEN;
int __pmAvahiDiscoverServices(const char *, int, char ***) _PCP_HIDDEN;
#endif /* AVAHI_H */
| /*
* Copyright (c) 2013 Red Hat.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
#ifndef AVAHI_H
#define AVAHI_H
void __pmServerAvahiAdvertisePresence(__pmServerPresence *) _PCP_HIDDEN;
void __pmServerAvahiUnadvertisePresence(__pmServerPresence *) _PCP_HIDDEN;
int __pmAvahiDiscoverServices(const char *, int, char ***) _PCP_HIDDEN;
#endif /* AVAHI_H */
| Remove a duplicate definition of __pmServerPresence | Remove a duplicate definition of __pmServerPresence
| C | lgpl-2.1 | mbaldessari/pcp,tjanez/pcp,aeg-aeg/pcpfans,prasincs/pcp,mbaldessari/pcp,adfernandes/pcp,adfernandes/pcp,wuliming/pcp,andyvand/cygpcpfans,adfernandes/pcp,tjanez/pcp,edwardt/pcp,edwardt/pcp,wuliming/pcp,wuliming/pcp,aeg-aeg/pcpfans,aeg-aeg/pcpfans,mbaldessari/pcp,edwardt/pcp,mbaldessari/pcp,edwardt/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,wuliming/pcp,andyvand/cygpcpfans,prasincs/pcp,prasincs/pcp,edwardt/pcp,edwardt/pcp,aeg-aeg/pcpfans,wuliming/pcp,tjanez/pcp,andyvand/cygpcpfans,mbaldessari/pcp,tjanez/pcp,prasincs/pcp,edwardt/pcp,prasincs/pcp,edwardt/pcp,adfernandes/pcp,aeg-aeg/pcpfans,aeg-aeg/pcpfans,aeg-aeg/pcpfans,andyvand/cygpcpfans,mbaldessari/pcp,tjanez/pcp,andyvand/cygpcpfans,aeg-aeg/pcpfans,prasincs/pcp,andyvand/cygpcpfans,prasincs/pcp,tjanez/pcp,wuliming/pcp,andyvand/cygpcpfans,wuliming/pcp,prasincs/pcp,wuliming/pcp,adfernandes/pcp,andyvand/cygpcpfans,tjanez/pcp,tjanez/pcp |
ed0ac568e3df92d4df9e89d1280da6f2a8ab5f43 | sort/isort.c | sort/isort.c | #include <stdio.h>
#include <stdlib.h>
const int N = 1e4;
void
isort(int *ns, int n)
{
int i, j, key;
for(i = 1; i < n; i++) {
key = ns[i];
for(j = i-1; j >= 0 && key < ns[j]; j--)
ns[j+1] = ns[j];
ns[j+1] = key;
}
}
int
main(void)
{
int i;
int *ns = malloc(sizeof(int)*N);
for(i = 0; i < N; i++) {
ns[i] = N-i;
}
isort(ns, N);
for(i = 0; i < N; i++) {
if(ns[i] != i+1) {
fprintf(stderr, "Index %d is %d, expected %d.\n", i, ns[i], i+1);
exit(EXIT_FAILURE);
}
}
return EXIT_SUCCESS;
}
| Add C implementation of insertion sort. | Add C implementation of insertion sort.
| C | mit | lorenzo-stoakes/algoholic |
|
3238c448c6e26d7c26d2e9b070ef149d066cb6c2 | include/asm-arm/arch-iop3xx/timex.h | include/asm-arm/arch-iop3xx/timex.h | /*
* linux/include/asm-arm/arch-iop3xx/timex.h
*
* IOP3xx architecture timex specifications
*/
#include <linux/config.h>
#if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244)
#define CLOCK_TICK_RATE IOP321_TICK_RATE
#elif defined(CONFIG_ARCH_IQ80331) || defined(CONFIG_MACH_IQ80332)
#define CLOCK_TICK_RATE IOP331_TICK_RATE
#else
#error "No IOP3xx timex information for this architecture"
#endif
| /*
* linux/include/asm-arm/arch-iop3xx/timex.h
*
* IOP3xx architecture timex specifications
*/
#include <linux/config.h>
#include <asm/hardware.h>
#if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244)
#define CLOCK_TICK_RATE IOP321_TICK_RATE
#elif defined(CONFIG_ARCH_IQ80331) || defined(CONFIG_MACH_IQ80332)
#define CLOCK_TICK_RATE IOP331_TICK_RATE
#else
#error "No IOP3xx timex information for this architecture"
#endif
| Fix to allow 2.6.15-rc2 to compile for IOP3xx boards | [ARM] 3173/1: Fix to allow 2.6.15-rc2 to compile for IOP3xx boards
Patch from Adam Brooks
Fixes an issue in 2.6.15-rc2 that prevented compilation of kernels for IOP3xx boards.
Signed-off-by: Adam Brooks <[email protected]>
Signed-off-by: Russell King <[email protected]>
| C | apache-2.0 | TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs |
b333dcc2e76b8ccad3bdbf93ec55494de0f984d8 | test/test-saneopt.c | test/test-saneopt.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <saneopt.h>
void test_no_arg() {
char** argv;
saneopt_t* opt = saneopt_init(0, argv);
assert(saneopt_get(opt, "no-option") == NULL);
free(opt);
}
void test_no_value() {
char** argv = malloc(1 * sizeof(char*));
argv[0] = "--option";
saneopt_t* opt = saneopt_init(1, argv);
assert(strcmp(saneopt_get(opt, "option"), "") == 0);
free(argv);
free(opt);
}
void test_value() {
char** argv = malloc(4 * sizeof(char*));
argv[0] = "--option";
argv[1] = "value";
argv[2] = "--next-option";
argv[3] = "--third-option";
saneopt_t* opt = saneopt_init(4, argv);
assert(strcmp(saneopt_get(opt, "option"), "value") == 0);
assert(strcmp(saneopt_get(opt, "next-option"), "") == 0);
assert(strcmp(saneopt_get(opt, "third-option"), "") == 0);
free(argv);
free(opt);
}
int main(int argc, char** argv) {
test_no_arg();
test_no_value();
test_value();
return 0;
}
| Add a bunch of tests | [test] Add a bunch of tests
| C | mit | mmalecki/saneopt |
|
3e11c197042d37ee9c304f59ad83f42cea401a49 | memsize.c | memsize.c | #include <stdio.h>
#include <sys/sysinfo.h>
#include <stdint.h>
uint64_t get_memory_size()
{
struct sysinfo info;
sysinfo( &info );
printf("total ram %lu, mem units %lu\n", (size_t)info.totalram, (size_t)info.mem_unit);
return (size_t)info.totalram * (size_t)info.mem_unit;
}
int main(int argc, char* argv[])
{
uint64_t total_memory = get_memory_size();
printf("Total physical memory: %lu\n", total_memory);
return 0;
}
| Add memory size info example | Add memory size info example
| C | apache-2.0 | tisma/ctorious,tisma/ctorious |
|
53dbe1c9c8f4ab8d5068fce50677fd955c2b1e30 | IGIdenticon/IGIdenticon.h | IGIdenticon/IGIdenticon.h | //
// IGIdenticon.h
// IGIdenticon
//
// Created by Evgeniy Yurtaev on 29/07/15.
// Copyright (c) 2015 Evgeniy Yurtaev. All rights reserved.
//
#import "IGImageGenerator.h"
#import "IGSimpleIdenticon.h"
#import "IGGitHubIdenticon.h"
#import "IGHashFunctions.h"
| Add header which imports all files | Add header which imports all files
| C | mit | seaburg/IGIdenticon,seaburg/IGIdenticon |
|
201ba3681790ed109be1502cfa9ad891de1e2097 | copasi/output/output.h | copasi/output/output.h | /* include files for the package output */
#include "CDatum.h"
#include "COutput.h"
#include "COutputLine.h"
#include "COutputList.h"
#include "COutputEvent.h"
| /* include files for the package output */
#include "CDatum.h"
#include "COutput.h"
#include "COutputLine.h"
#include "COutputList.h"
#include "COutputEvent.h"
#include "CNodeO.h"
#include "CUDFunction.h"
#include "CUDFunctionDB.h" | Add 3 new classes about User Defined Functions | Add 3 new classes about User Defined Functions
| C | artistic-2.0 | copasi/COPASI,copasi/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,copasi/COPASI,copasi/COPASI,copasi/COPASI,copasi/COPASI,jonasfoe/COPASI,copasi/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,copasi/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,copasi/COPASI |
59e44a3ff36e0a67cd39c8e3149d2fdaa089b7d4 | src/log_thread.h | src/log_thread.h | //
// log_thread.h
//
#ifndef log_thread_h
#define log_thread_h
#include "queue_atomic.h"
struct log_thread;
typedef std::shared_ptr<log_thread> log_thread_ptr;
#define LOG_BUFFER_SIZE 1024
struct log_thread : std::thread
{
static const bool debug;
static const int flush_interval_msecs;
FILE* file;
const size_t num_buffers;
queue_atomic<char*> log_buffers_free;
queue_atomic<char*> log_buffers_inuse;
time_t last_time;
std::atomic<bool> running;
std::atomic<bool> writer_waiting;
std::thread thread;
std::mutex log_mutex;
std::condition_variable log_cond;
std::condition_variable writer_cond;
log_thread(int fd, size_t num_buffers);
virtual ~log_thread();
void shutdown();
void create_buffers();
void delete_buffers();
void log(time_t current_time, const char* message);
void write_logs();
void mainloop();
};
#endif
| //
// log_thread.h
//
#ifndef log_thread_h
#define log_thread_h
#include "queue_atomic.h"
struct log_thread;
typedef std::shared_ptr<log_thread> log_thread_ptr;
#define LOG_BUFFER_SIZE 1024
struct log_thread : std::thread
{
static const bool debug;
static const int flush_interval_msecs;
FILE* file;
const size_t num_buffers;
queue_atomic<char*> log_buffers_free;
queue_atomic<char*> log_buffers_inuse;
time_t last_time;
std::atomic<bool> running;
std::atomic<bool> writer_waiting;
std::mutex log_mutex;
std::condition_variable log_cond;
std::condition_variable writer_cond;
std::thread thread;
log_thread(int fd, size_t num_buffers);
virtual ~log_thread();
void shutdown();
void create_buffers();
void delete_buffers();
void log(time_t current_time, const char* message);
void write_logs();
void mainloop();
};
#endif
| Fix thread initialisation race (thread sanitizer) | Fix thread initialisation race (thread sanitizer)
| C | isc | metaparadigm/latypus,metaparadigm/latypus,metaparadigm/latypus,metaparadigm/latypus |
b650f4bc8e04662493546c8ab2ab0fbca1081dac | iree/tools/init_xla_dialects.h | iree/tools/init_xla_dialects.h | // Copyright 2020 The IREE Authors
//
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// This files defines a helper to trigger the registration of dialects to
// the system.
#ifndef IREE_TOOLS_INIT_XLA_DIALECTS_H_
#define IREE_TOOLS_INIT_XLA_DIALECTS_H_
#include "mlir-hlo/Dialect/mhlo/IR/chlo_ops.h"
#include "mlir-hlo/Dialect/mhlo/IR/hlo_ops.h"
#include "mlir-hlo/Dialect/mhlo/IR/lhlo_ops.h"
#include "mlir/IR/Dialect.h"
namespace mlir {
// Add all the XLA dialects to the provided registry.
inline void registerXLADialects(DialectRegistry ®istry) {
// clang-format off
registry.insert<mlir::chlo::HloClientDialect,
mlir::lmhlo::LmhloDialect,
mlir::mhlo::MhloDialect>();
// clang-format on
}
} // namespace mlir
#endif // IREE_TOOLS_INIT_XLA_DIALECTS_H_
| // Copyright 2020 The IREE Authors
//
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// This files defines a helper to trigger the registration of dialects to
// the system.
#ifndef IREE_TOOLS_INIT_XLA_DIALECTS_H_
#define IREE_TOOLS_INIT_XLA_DIALECTS_H_
#include "mlir-hlo/Dialect/mhlo/IR/chlo_ops.h"
#include "mlir-hlo/Dialect/mhlo/IR/hlo_ops.h"
#include "mlir/IR/Dialect.h"
namespace mlir {
// Add all the XLA dialects to the provided registry.
inline void registerXLADialects(DialectRegistry ®istry) {
// clang-format off
registry.insert<mlir::chlo::HloClientDialect,
mlir::mhlo::MhloDialect>();
// clang-format on
}
} // namespace mlir
#endif // IREE_TOOLS_INIT_XLA_DIALECTS_H_
| Move the lhlo dialect into its own directory. | Move the lhlo dialect into its own directory.
Also remove it from registerAllMhloDialects and make registrations explicit.
PiperOrigin-RevId: 412411838
| C | apache-2.0 | iree-org/iree,iree-org/iree,google/iree,google/iree,google/iree,iree-org/iree,iree-org/iree,google/iree,google/iree,google/iree,iree-org/iree,iree-org/iree,google/iree,iree-org/iree |
57f2821f8ed183036e61f76a8b2fefcc1a1f1cbd | src/morphology/mainhelper2.h | src/morphology/mainhelper2.h | #include <iostream>
#include <vector>
#include <string>
#include "erosion.h"
#include "dilation.h"
#include "opening.h"
#include "closing.h"
#include "gradient.h"
/** run: A macro to call a function. */
#define run( function, ctype, dim ) \
if ( operation == #function ) \
{ \
if ( componentType == #ctype && Dimension == dim ) \
{ \
typedef itk::Image< ctype, dim > ImageType; \
if ( type == "grayscale" ) \
{ \
function##Grayscale< ImageType >( inputFileName, outputFileName, radius, boundaryCondition, useCompression ); \
supported = true; \
} \
else if ( type == "binary" ) \
{ \
function##Binary< ImageType >( inputFileName, outputFileName, radius, bin, useCompression ); \
supported = true; \
} \
else if ( type == "parabolic" ) \
{ \
function##Parabolic< ImageType >( inputFileName, outputFileName, radius, useCompression ); \
supported = true; \
} \
} \
}
/** run2: A macro to call a function. */
#define run2( function, ctype, dim ) \
if ( operation == #function ) \
{ \
if ( componentType == #ctype && Dimension == dim ) \
{ \
typedef itk::Image< ctype, dim > ImageType; \
function< ImageType >( inputFileName, outputFileName, radius, algorithm, useCompression ); \
supported = true; \
} \
} | #include <iostream>
#include <vector>
#include <string>
#include "erosion.h"
#include "dilation.h"
#include "opening.h"
#include "closing.h"
#include "gradient.h"
/** run: A macro to call a function. */
#define run( function, ctype, dim ) \
if ( operation == #function ) \
{ \
if ( componentType == #ctype && Dimension == dim ) \
{ \
typedef itk::Image< ctype, dim > ImageType; \
if ( type == "grayscale" ) \
{ \
function##Grayscale< ImageType >( inputFileName, outputFileName, radius, boundaryCondition, useCompression ); \
supported = true; \
} \
else if ( type == "binary" ) \
{ \
function##Binary< ImageType >( inputFileName, outputFileName, radius, bin, useCompression ); \
supported = true; \
} \
else if ( type == "parabolic" ) \
{ \
function##Parabolic< ImageType >( inputFileName, outputFileName, radius, useCompression ); \
supported = true; \
} \
} \
}
/** run2: A macro to call a function. */
#define run2( function, ctype, dim ) \
if ( operation == #function ) \
{ \
if ( componentType == #ctype && Dimension == dim ) \
{ \
typedef itk::Image< ctype, dim > ImageType; \
function< ImageType >( inputFileName, outputFileName, radius, algorithm, useCompression ); \
supported = true; \
} \
}
| Fix backslash warning from missing blank line at end of file | Fix backslash warning from missing blank line at end of file
| C | apache-2.0 | ITKTools/ITKTools,ITKTools/ITKTools,ITKTools/ITKTools,sderaedt/ITKTools,sderaedt/ITKTools,sderaedt/ITKTools,sderaedt/ITKTools,sderaedt/ITKTools,ITKTools/ITKTools |
a3e8d4a968060536e210ac5dc177cd097d7df774 | lib/interception/interception_win.h | lib/interception/interception_win.h | //===-- interception_linux.h ------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file is a part of AddressSanitizer, an address sanity checker.
//
// Windows-specific interception methods.
//===----------------------------------------------------------------------===//
#ifdef _WIN32
#if !defined(INCLUDED_FROM_INTERCEPTION_LIB)
# error "interception_win.h should be included from interception library only"
#endif
#ifndef INTERCEPTION_WIN_H
#define INTERCEPTION_WIN_H
namespace __interception {
// returns true if the old function existed, false on failure.
bool OverrideFunction(uptr old_func, uptr new_func, uptr *orig_old_func);
} // namespace __interception
#if defined(_DLL)
# define INTERCEPT_FUNCTION_WIN(func) \
::__interception::GetRealFunctionAddress( \
#func, (::__interception::uptr*)&REAL(func))
#else
# define INTERCEPT_FUNCTION_WIN(func) \
::__interception::OverrideFunction( \
(::__interception::uptr)func, \
(::__interception::uptr)WRAP(func), \
(::__interception::uptr*)&REAL(func))
#endif
#define INTERCEPT_FUNCTION_VER_WIN(func, symver) \
INTERCEPT_FUNCTION_WIN(func)
#endif // INTERCEPTION_WIN_H
#endif // _WIN32
| //===-- interception_linux.h ------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file is a part of AddressSanitizer, an address sanity checker.
//
// Windows-specific interception methods.
//===----------------------------------------------------------------------===//
#ifdef _WIN32
#if !defined(INCLUDED_FROM_INTERCEPTION_LIB)
# error "interception_win.h should be included from interception library only"
#endif
#ifndef INTERCEPTION_WIN_H
#define INTERCEPTION_WIN_H
namespace __interception {
// returns true if the old function existed, false on failure.
bool OverrideFunction(uptr old_func, uptr new_func, uptr *orig_old_func);
} // namespace __interception
#if defined(_DLL)
# error Not implemented yet
#else
# define INTERCEPT_FUNCTION_WIN(func) \
::__interception::OverrideFunction( \
(::__interception::uptr)func, \
(::__interception::uptr)WRAP(func), \
(::__interception::uptr*)&REAL(func))
#endif
#define INTERCEPT_FUNCTION_VER_WIN(func, symver) \
INTERCEPT_FUNCTION_WIN(func)
#endif // INTERCEPTION_WIN_H
#endif // _WIN32
| Remove one more reference to __interception::GetRealFunctionAddress (follow-up to r215707) | [ASan/Win] Remove one more reference to __interception::GetRealFunctionAddress (follow-up to r215707)
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@215722 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt |
40206332871e11ee28c6d163797cb374da2663e9 | src/python/pylogger.h | src/python/pylogger.h | #ifndef PYLOGGER_H
#define PYLOGGER_H
#include "Python.h"
#include <string>
#include "cantera/base/logger.h"
namespace Cantera
{
/// Logger for Python.
/// @ingroup textlogs
class Py_Logger : public Logger
{
public:
Py_Logger() {
PyRun_SimpleString("import sys");
}
virtual ~Py_Logger() {}
virtual void write(const std::string& s) {
std::string ss = "sys.stdout.write(\"\"\"";
ss += s;
ss += "\"\"\")";
PyRun_SimpleString(ss.c_str());
PyRun_SimpleString("sys.stdout.flush()");
}
virtual void error(const std::string& msg) {
std::string err = "raise \""+msg+"\"";
PyRun_SimpleString((char*)err.c_str());
}
};
}
#endif
| #ifndef PYLOGGER_H
#define PYLOGGER_H
#include "Python.h"
#include <string>
#include "cantera/base/logger.h"
namespace Cantera
{
/// Logger for Python.
/// @ingroup textlogs
class Py_Logger : public Logger
{
public:
Py_Logger() {
PyRun_SimpleString("import sys");
}
virtual ~Py_Logger() {}
virtual void write(const std::string& s) {
std::string ss = "sys.stdout.write(\"\"\"";
ss += s;
ss += "\"\"\")";
PyRun_SimpleString(ss.c_str());
PyRun_SimpleString("sys.stdout.flush()");
}
virtual void error(const std::string& msg) {
std::string err = "raise Exception(\"\"\""+msg+"\"\"\")";
PyRun_SimpleString(err.c_str());
}
};
}
#endif
| Fix Py_Logger to raise instances of Exception instead of strings | Fix Py_Logger to raise instances of Exception instead of strings
Raising string exceptions was removed in Python 2.6
git-svn-id: e76dbe14710aecee1ad27675521492cea2578c83@1932 02a645c2-efd0-11dd-984d-ab748d24aa7e
| C | bsd-3-clause | Cantera/cantera-svn,Cantera/cantera-svn,Cantera/cantera-svn,Cantera/cantera-svn,Cantera/cantera-svn,Cantera/cantera-svn |
bc7bad10693b5c6616a424ff64278a6eeb8925da | folly/CompiledFormat.h | folly/CompiledFormat.h | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <fmt/compile.h>
// Fallback to runtime format string processing for compatibility with fmt 6.x.
#ifndef FMT_COMPILE
#define FMT_COMPILE(format_str) format_str
#endif
| /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <fmt/compile.h>
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 8
// Forcefully disable compiled format strings for GCC 8 & below until fmt is
// updated to do this automatically.
#undef FMT_COMPILE
#endif
// Fallback to runtime format string processing for compatibility with fmt 6.x.
#ifndef FMT_COMPILE
#define FMT_COMPILE(format_str) format_str
#endif
| Disable compiled format for GCC 8 & below | Disable compiled format for GCC 8 & below
Summary: As per title, as fmt doesn't currently handle them well.
Reviewed By: vitaut
Differential Revision: D26004515
fbshipit-source-id: dbbd1e6550fa10c4a6fcb0fc5597887c9411ca70
| C | apache-2.0 | facebook/folly,facebook/folly,facebook/folly,facebook/folly,facebook/folly |
7eae3515be77d87d54f7a1b42cc53cb936e3ede3 | components/DataportTest/src/client.c | components/DataportTest/src/client.c | /*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#include <camkes.h>
#include <stdio.h>
#include <string.h>
#include <sel4/sel4.h>
int run(void) {
char *shello = "hello world";
printf("Starting...\n");
printf("-----------\n");
strcpy((void*)DataOut, shello);
while(!*((char*)DataIn))
seL4_Yield();
printf("%s read %s\n", get_instance_name(), (char*)DataIn);
return 0;
}
| /*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#include <camkes.h>
#include <stdio.h>
#include <string.h>
int run(void) {
char *shello = "hello world";
printf("Starting...\n");
printf("-----------\n");
strcpy((void*)DataOut, shello);
while(!*((volatile char*)DataIn));
printf("%s read %s\n", get_instance_name(), (char*)DataIn);
return 0;
}
| Remove casting away of volatile and explicit call to seL4_Yield. | Remove casting away of volatile and explicit call to seL4_Yield.
This commit removes some bad style in this example. In particular, calling a
seL4 system call directly from a CAmkES component is not intended. Additionally
this example cast away the volatility of the dataport pointer. From what I can
see, the only reason the compiler did not optimise away the repeated read of
this pointer was because the loop contained a system call with a contained
unrestricted memory clobber.
Related to JIRA CAMKES-436
| C | bsd-2-clause | seL4/camkes-apps-dataport--devel |
be3f8ddf0f51e601866dbcc1a3fcac6d0db14e39 | gc_none.c | gc_none.c | #include "visibility.h"
#include "objc/runtime.h"
#include "gc_ops.h"
#include "class.h"
#include <stdlib.h>
#include <stdio.h>
static id allocate_class(Class cls, size_t extraBytes)
{
intptr_t *addr = calloc(cls->instance_size + extraBytes + sizeof(intptr_t), 1);
return (id)(addr + 1);
}
static void free_object(id obj)
{
free((void*)(((intptr_t)obj) - 1));
}
static void *alloc(size_t size)
{
return calloc(size, 1);
}
PRIVATE struct gc_ops gc_ops_none =
{
.allocate_class = allocate_class,
.free_object = free_object,
.malloc = alloc,
.free = free
};
PRIVATE struct gc_ops *gc = &gc_ops_none;
PRIVATE BOOL isGCEnabled = NO;
#ifndef ENABLE_GC
PRIVATE void enableGC(BOOL exclusive)
{
fprintf(stderr, "Attempting to enable garbage collection, but your"
"Objective-C runtime was built without garbage collection"
"support\n");
abort();
}
#endif
| #include "visibility.h"
#include "objc/runtime.h"
#include "gc_ops.h"
#include "class.h"
#include <stdlib.h>
#include <stdio.h>
static id allocate_class(Class cls, size_t extraBytes)
{
intptr_t *addr = calloc(cls->instance_size + extraBytes + sizeof(intptr_t), 1);
return (id)(addr + 1);
}
static void free_object(id obj)
{
free((void*)(((intptr_t*)obj) - 1));
}
static void *alloc(size_t size)
{
return calloc(size, 1);
}
PRIVATE struct gc_ops gc_ops_none =
{
.allocate_class = allocate_class,
.free_object = free_object,
.malloc = alloc,
.free = free
};
PRIVATE struct gc_ops *gc = &gc_ops_none;
PRIVATE BOOL isGCEnabled = NO;
#ifndef ENABLE_GC
PRIVATE void enableGC(BOOL exclusive)
{
fprintf(stderr, "Attempting to enable garbage collection, but your"
"Objective-C runtime was built without garbage collection"
"support\n");
abort();
}
#endif
| Fix bug spotted by Justin Hibbits. | Fix bug spotted by Justin Hibbits.
| C | mit | ngrewe/libobjc2,gnustep/libobjc2,davidchisnall/libobjc2,crystax/android-vendor-libobjc2,ngrewe/libobjc2,crystax/android-vendor-libobjc2,gnustep/libobjc2,darlinghq/darling-libobjc2,davidchisnall/libobjc2,darlinghq/darling-libobjc2 |
151e30567b407381af5134c9f5c3d782bf80c3e2 | src/core/lib/security/security_connector/load_system_roots.h | src/core/lib/security/security_connector/load_system_roots.h | /*
*
* Copyright 2018 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 agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_H
#define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_H
namespace grpc_core {
// Returns a slice containing roots from the OS trust store
grpc_slice LoadSystemRootCerts();
} // namespace grpc_core
#endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_H */ | /*
*
* Copyright 2018 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 agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_H
#define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_H
namespace grpc_core {
// Returns a slice containing roots from the OS trust store
grpc_slice LoadSystemRootCerts();
} // namespace grpc_core
#endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_H */
| Add newline to end of header | Add newline to end of header
| C | apache-2.0 | muxi/grpc,grpc/grpc,carl-mastrangelo/grpc,ejona86/grpc,vjpai/grpc,muxi/grpc,stanley-cheung/grpc,stanley-cheung/grpc,mehrdada/grpc,grpc/grpc,sreecha/grpc,jboeuf/grpc,jtattermusch/grpc,jboeuf/grpc,carl-mastrangelo/grpc,grpc/grpc,carl-mastrangelo/grpc,firebase/grpc,ejona86/grpc,ejona86/grpc,ctiller/grpc,ctiller/grpc,pszemus/grpc,muxi/grpc,nicolasnoble/grpc,carl-mastrangelo/grpc,donnadionne/grpc,jboeuf/grpc,firebase/grpc,ejona86/grpc,muxi/grpc,firebase/grpc,vjpai/grpc,ctiller/grpc,ejona86/grpc,vjpai/grpc,thinkerou/grpc,sreecha/grpc,ejona86/grpc,vjpai/grpc,grpc/grpc,mehrdada/grpc,jboeuf/grpc,carl-mastrangelo/grpc,grpc/grpc,pszemus/grpc,ctiller/grpc,carl-mastrangelo/grpc,pszemus/grpc,jboeuf/grpc,ejona86/grpc,donnadionne/grpc,muxi/grpc,carl-mastrangelo/grpc,ctiller/grpc,firebase/grpc,pszemus/grpc,stanley-cheung/grpc,carl-mastrangelo/grpc,grpc/grpc,sreecha/grpc,pszemus/grpc,stanley-cheung/grpc,donnadionne/grpc,donnadionne/grpc,mehrdada/grpc,vjpai/grpc,jboeuf/grpc,jtattermusch/grpc,muxi/grpc,sreecha/grpc,ctiller/grpc,mehrdada/grpc,thinkerou/grpc,nicolasnoble/grpc,nicolasnoble/grpc,stanley-cheung/grpc,donnadionne/grpc,ctiller/grpc,stanley-cheung/grpc,grpc/grpc,ejona86/grpc,stanley-cheung/grpc,thinkerou/grpc,mehrdada/grpc,mehrdada/grpc,firebase/grpc,stanley-cheung/grpc,donnadionne/grpc,thinkerou/grpc,nicolasnoble/grpc,firebase/grpc,donnadionne/grpc,jtattermusch/grpc,vjpai/grpc,pszemus/grpc,thinkerou/grpc,jtattermusch/grpc,mehrdada/grpc,thinkerou/grpc,thinkerou/grpc,jtattermusch/grpc,jboeuf/grpc,muxi/grpc,firebase/grpc,jboeuf/grpc,stanley-cheung/grpc,mehrdada/grpc,sreecha/grpc,vjpai/grpc,nicolasnoble/grpc,carl-mastrangelo/grpc,ctiller/grpc,donnadionne/grpc,ejona86/grpc,grpc/grpc,muxi/grpc,ctiller/grpc,mehrdada/grpc,muxi/grpc,nicolasnoble/grpc,nicolasnoble/grpc,ejona86/grpc,firebase/grpc,jtattermusch/grpc,jtattermusch/grpc,vjpai/grpc,carl-mastrangelo/grpc,carl-mastrangelo/grpc,mehrdada/grpc,vjpai/grpc,thinkerou/grpc,mehrdada/grpc,carl-mastrangelo/grpc,pszemus/grpc,donnadionne/grpc,sreecha/grpc,grpc/grpc,muxi/grpc,vjpai/grpc,pszemus/grpc,thinkerou/grpc,sreecha/grpc,jboeuf/grpc,jtattermusch/grpc,nicolasnoble/grpc,sreecha/grpc,ctiller/grpc,nicolasnoble/grpc,ejona86/grpc,muxi/grpc,firebase/grpc,pszemus/grpc,mehrdada/grpc,stanley-cheung/grpc,donnadionne/grpc,jtattermusch/grpc,pszemus/grpc,grpc/grpc,sreecha/grpc,thinkerou/grpc,nicolasnoble/grpc,ctiller/grpc,pszemus/grpc,thinkerou/grpc,stanley-cheung/grpc,jtattermusch/grpc,sreecha/grpc,ctiller/grpc,ejona86/grpc,jtattermusch/grpc,firebase/grpc,thinkerou/grpc,muxi/grpc,jtattermusch/grpc,nicolasnoble/grpc,sreecha/grpc,jboeuf/grpc,donnadionne/grpc,firebase/grpc,jboeuf/grpc,vjpai/grpc,firebase/grpc,grpc/grpc,nicolasnoble/grpc,donnadionne/grpc,pszemus/grpc,vjpai/grpc,stanley-cheung/grpc,sreecha/grpc,grpc/grpc,jboeuf/grpc |
58de6ed0ccc6b3749c3ddd0d7be44b81eb440cf9 | inc/spu.h | inc/spu.h | #ifndef __SPU_H__
#define __SPU_H__
typedef enum {
NONE,
VOLUME,
COMPRESSOR,
DISTORTION,
OVERDRIVE,
DELAY,
REVERB,
FLANGER,
EQULIZER,
BACK,
EFFECT_TYPE_NUM
} EffectType_t;
void SignalProcessingUnit(void const * argument);
void attachNewEffect(uint32_t stage, EffectType_t effectType);
void demolishEffect(uint32_t stage);
#endif //__SPU_H__
| #ifndef __SPU_H__
#define __SPU_H__
typedef enum {
NONE,
VOLUME,
COMPRESSOR,
DISTORTION,
OVERDRIVE,
DELAY,
REVERB,
FLANGER,
EQULIZER,
EFFECT_TYPE_NUM
} EffectType_t;
void SignalProcessingUnit(void const * argument);
void attachEffect(uint32_t stage, EffectType_t effectType);
const char *cvtToEffectName(EffectType_t ee);
#endif //__SPU_H__
| Add Function to get avaliable Effect name | Add Function to get avaliable Effect name
| C | mit | sonicyang/uRock,sonicyang/uRock,BeyondCloud/uRock,sonicyang/uRock,BeyondCloud/uRock,BeyondCloud/uRock,BeyondCloud/uRock,sonicyang/uRock |
651603c57e8818a492b59cbaa49f8fc5a27d1566 | main.c | main.c | #include "siphash.h"
#include <stdio.h>
int main(void)
{
uint64_t k0 = 0x0706050403020100ull;
uint64_t k1 = 0x0f0e0d0c0b0a0908ull;
uint8_t msg[] = {0x00, 0x01, 0x02, 0x03, 0x04,
0x05, 0x06, 0x07, 0x08, 0x09,
0x0a, 0x0b, 0x0c, 0x0d, 0x0e};
uint64_t s = siphash24(k0, k1, msg, sizeof(msg));
printf("SipHash-2-4 test: 0x%016llx (expected 0x%016llx)\n", s, 0xa129ca6149be45e5ull);
return 0;
}
| #include "siphash.h"
#include <stdio.h>
int main(void)
{
uint8_t key[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f};
uint64_t k0 = *(uint64_t*)(key + 0);
uint64_t k1 = *(uint64_t*)(key + 8);
uint8_t msg[] = {0x00, 0x01, 0x02, 0x03, 0x04,
0x05, 0x06, 0x07, 0x08, 0x09,
0x0a, 0x0b, 0x0c, 0x0d, 0x0e};
uint64_t s = siphash24(k0, k1, msg, sizeof(msg));
printf("SipHash-2-4 test: 0x%016llx (expected 0x%016llx)\n", s, 0xa129ca6149be45e5ull);
return 0;
}
| Fix test key initialization to be endian-neutral | Fix test key initialization to be endian-neutral
Signed-off-by: Gregory Petrosyan <[email protected]>
| C | mit | flyingmutant/siphash |
3236ff1f1c85e35d99aba3c94092a665717964ef | lb_matrix.h | lb_matrix.h | #ifndef LB_MATRIX_INCLUDED
typedef struct {
double* data;
unsigned int num_rows;
unsigned int num_cols;
} Matrix;
Matrix lb_create_matrix(double* data, unsigned int num_rows, unsigned int num_cols);
Matrix lb_allocate_matrix(unsigned int num_rows, unsigned int num_cols);
#define lb_mat_element_ptr(A,i,j) (A.data + j * A.num_cols + i)
#define lb_mat_element(A,i,j) A.data[j * A.num_cols + i]
#define lb_mat_row_element(A,row,offset) A.data[offset + row * A.num_cols]
#define lb_mat_col_element(A,col,offset) A.data[col + offset * A.num_cols]
#define lb_vec_element_ptr(v,j) v.data + j;
void lbmm(Matrix A, Matrix B, Matrix result);
void lbma(Matrix A, Matrix B, Matrix result);
#define LB_MATRIX_INCLUDED
#endif
| #ifndef LB_MATRIX_INCLUDED
typedef struct {
double* data;
unsigned int num_rows;
unsigned int num_cols;
} Matrix;
Matrix lb_create_matrix(double* data, unsigned int num_rows, unsigned int num_cols);
Matrix lb_allocate_matrix(unsigned int num_rows, unsigned int num_cols);
#define lb_mat_element_ptr(A,i,j) (A.data + j * A.num_cols + i)
#define lb_mat_element(A,i,j) A.data[j * A.num_cols + i]
#define lb_mat_row_element(A,i,j) A.data[i * A.num_cols + j]
#define lb_mat_col_element(A,i,j) A.data[j * A.num_cols + i]
#define lb_vec_element_ptr(v,j) v.data + j;
void lbmm(Matrix A, Matrix B, Matrix result);
void lbma(Matrix A, Matrix B, Matrix result);
#define LB_MATRIX_INCLUDED
#endif
| Clarify row and column iterators | Clarify row and column iterators
| C | apache-2.0 | frenchrd/laid-back-lapack,frenchrd/laid-back-lapack |
c89b58e65cce5113ba2d8d8ce531152da23670c9 | lib/debug.c | lib/debug.c | #include <ctype.h>
#include <stdio.h>
#include "debug.h"
#ifndef NDEBUG
const char * const col[] = {MAG, RED, YEL, CYN, BLU, GRN};
regex_t _comp;
// Initialize the regular expression used for restricting debug output
static void __attribute__((constructor)) premain()
{
if (regcomp(&_comp, DCOMPONENT, REG_EXTENDED | REG_ICASE | REG_NOSUB))
die("may not be a valid regexp: %s", DCOMPONENT);
}
// And free is again
static void __attribute__((destructor)) postmain() { regfree(&_comp); }
// Print a hexdump of the given block
void hexdump(const void * const ptr, const size_t len)
{
const uint8_t * const buf = ptr;
for (uint8_t i = 0; i < len; i += 16) {
fprintf(stderr, "%06x: ", i);
for (uint8_t j = 0; j < 16; j++) {
if (i + j < len)
fprintf(stderr, "%02hhx ", buf[i + j]);
else
fprintf(stderr, " ");
fprintf(stderr, " ");
}
for (uint8_t j = 0; j < 16; j++) {
if (i + j < len)
fprintf(stderr, "%c", isprint(buf[i + j]) ? buf[i + j] : '.');
}
fprintf(stderr, "\n");
}
}
#endif
| #include <ctype.h>
#include <stdio.h>
#include "debug.h"
#ifndef NDEBUG
const char * const col[] = {MAG, RED, YEL, CYN, BLU, GRN};
regex_t _comp;
// Initialize the regular expression used for restricting debug output
static void __attribute__((constructor)) premain()
{
if (regcomp(&_comp, DCOMPONENT, REG_EXTENDED | REG_ICASE | REG_NOSUB))
die("may not be a valid regexp: %s", DCOMPONENT);
}
// And free is again
static void __attribute__((destructor)) postmain() { regfree(&_comp); }
// Print a hexdump of the given block
void hexdump(const void * const ptr, const size_t len)
{
const uint8_t * const buf = ptr;
for (size_t i = 0; i < len; i += 16) {
fprintf(stderr, "%06lx: ", i);
for (size_t j = 0; j < 16; j++) {
if (i + j < len)
fprintf(stderr, "%02hhx ", buf[i + j]);
else
fprintf(stderr, " ");
fprintf(stderr, " ");
}
for (size_t j = 0; j < 16; j++) {
if (i + j < len)
fprintf(stderr, "%c", isprint(buf[i + j]) ? buf[i + j] : '.');
}
fprintf(stderr, "\n");
}
}
#endif
| Fix overflow bug introduced in f6b3328f | Fix overflow bug introduced in f6b3328f
| C | bsd-2-clause | NTAP/quant,NTAP/quant,NTAP/quant |
87dd7d92b3a2598eef4afdde3cda46e1fc23b6e8 | test/CodeGen/2003-10-29-AsmRename.c | test/CodeGen/2003-10-29-AsmRename.c | // RUN: %clang_cc1 -emit-llvm %s -o /dev/null
struct foo { int X; };
struct bar { int Y; };
extern int Func(struct foo*) __asm__("Func64");
extern int Func64(struct bar*);
int Func(struct foo *F) {
return 1;
}
int Func64(struct bar* B) {
return 0;
}
int test() {
Func(0); /* should be renamed to call Func64 */
Func64(0);
}
| // RUN: %clang_cc1 -emit-llvm %s -triple x86_64-apple-darwin -o /dev/null
struct foo { int X; };
struct bar { int Y; };
extern int Func(struct foo*) __asm__("Func64");
extern int Func64(struct bar*);
int Func(struct foo *F) {
return 1;
}
int Func64(struct bar* B) {
return 0;
}
int test() {
Func(0); /* should be renamed to call Func64 */
Func64(0);
}
| Make this darwin only for now while investigating to clear up x86_64 Release+Asserts linux tests. | Make this darwin only for now while investigating to clear up x86_64
Release+Asserts linux tests.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@136223 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang |
33701a61674753db0c9de7a294137e7dc4dd2d9b | test/Parser/traditional_arg_scope.c | test/Parser/traditional_arg_scope.c | // RUN: clang -fsyntax-only %s -verify
x(a) int a; {return a;}
y(b) int b; {return a;} // expected-error {{use of undeclared identifier}}
| // RUN: clang -fsyntax-only %s -verify
x(a) int a; {return a;}
y(b) int b; {return a;} // expected-error {{use of undeclared identifier}}
// PR2332
a(a)int a;{a=10;return a;}
| Test from PR2332; bug already fixed by r51311. | Test from PR2332; bug already fixed by r51311.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@51316 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang |
93b6ed1dc37e1809b7a9dfa04171c34b7b6153ca | src/SE_GLFW3_Include.h | src/SE_GLFW3_Include.h | #pragma once
#define GLFW_INCLUDE_GLU
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
#endif
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpadded"
# include <GLFW/glfw3.h>
#pragma GCC diagnostic pop
#if __clang__
#pragma clang diagnostic pop
#endif
| #pragma once
#define GLFW_INCLUDE_GLU
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
#endif
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpadded"
# include <GLFW/glfw3.h>
#pragma GCC diagnostic pop
#if __clang__
#pragma clang diagnostic pop
#endif
| Disable another warning in GLFW. | Disable another warning in GLFW.
| C | agpl-3.0 | belkiss/SpeakEasy,belkiss/SpeakEasy |
2e2d5d779fa18c98d6affc025dc5fcb122743f4c | test/Sema/2007-10-01-BuildArrayRef.c | test/Sema/2007-10-01-BuildArrayRef.c | // RUN: not %clang_cc1_only -c %s -o - > /dev/null
// PR 1603
void func()
{
const int *arr;
arr[0] = 1; // expected-error {{assignment of read-only location}}
}
struct foo {
int bar;
};
struct foo sfoo = { 0 };
int func2()
{
const struct foo *fp;
fp = &sfoo;
fp[0].bar = 1; // expected-error {{ assignment of read-only member}}
return sfoo.bar;
}
| // RUN: %clang_cc1 -fsyntax-only -verify %s
// PR 1603
void func()
{
const int *arr;
arr[0] = 1; // expected-error {{read-only variable is not assignable}}
}
struct foo {
int bar;
};
struct foo sfoo = { 0 };
int func2()
{
const struct foo *fp;
fp = &sfoo;
fp[0].bar = 1; // expected-error {{read-only variable is not assignable}}
return sfoo.bar;
}
| Fix a test that hasn't worked since 2007 | Fix a test that hasn't worked since 2007
Due to a missing -verify, 2007-10-01-BuildArrayRef.c was a no-op.
The message was changed 5 years ago so also update the test to reflect the new wording.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@196729 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang |
05461a9fc72c303f611d0b37cde545c2b0c7bdc2 | PolyMapGenerator/Map.h | PolyMapGenerator/Map.h | #ifndef MAP_H
#define MAP_H
#include <vector>
#include <map>
#include "DelaunayTriangulation.h"
#include "Structure.h"
#include "QuadTree.h"
#endif | #ifndef MAP_H
#define MAP_H
#include <vector>
#include <map>
#include "DelaunayTriangulation.h"
#include "Structure.h"
#include "QuadTree.h"
using pCenterQT = QuadTree<Center*>;
// Forward Declaration
class Vector2;
namespace Noise
{
namespace Module
{
class Perlin;
}
}
#endif | Define alias type, forward declaration | Define alias type, forward declaration
| C | mit | utilForever/PolyMapGenerator |
d2bf3b4d67fba2849f0d648c491fd2a4f808ce95 | Code/LYRUIMediaAttachment.h | Code/LYRUIMediaAttachment.h | //
// LYRUIMediaAttachment.h
// LayerSample
//
// Created by Kevin Coleman on 9/12/14.
// Copyright (c) 2014 Layer, Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
/**
@abstract The `LYRUIMediaAttachment` class configures the appropriate size
for an NSTextAttachment to comfortably fit inside of a LYRUIMessageInputToolbar
*/
@interface LYRUIMediaAttachment : NSTextAttachment
@end
| //
// LYRUIMediaAttachment.h
// LayerSample
//
// Created by Kevin Coleman on 9/12/14.
// Copyright (c) 2014 Layer, Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
/**
@abstract The `LYRUIMediaAttachment` class configures the appropriate size
for an NSTextAttachment to comfortably fit inside of a `LYRUIMessageInputToolbar`.
*/
@interface LYRUIMediaAttachment : NSTextAttachment
@end
| Add missing backticks and period in media attachment header comment. | Add missing backticks and period in media attachment header comment. | C | apache-2.0 | InterfaceInc/Atlas-iOS,drborges/Atlas-iOS,allensoberano/Atlas-iOS,fhchina/Atlas-iOS,AlexanderMazaletskiy/Atlas-iOS,hellosimplify/Atlas-iOS,joshleibsly/Atlas-iOS,grevolution/Atlas-iOS,acarella/Atlas-iOS,classic-chris/Atlas-iOS,Bluefieldscom/Atlas-iOS,xuzhenguo/Atlas-iOS,dvan001/Atlas-iOS,msdgwzhy6/Atlas-iOS,mohsinalimat/Atlas-iOS,mailyan/Atlas-iOS,NghiaTranUIT/Atlas-iOS,danielwmsun/Atlas-iOS,Suninus/Atlas-iOS,ntnmrndn/Atlas-iOS,fishermenlabs/Atlas-iOS,bandlab/Atlas-iOS,dfinzer/Atlas-iOS,misberri/Atlas-iOS,jflinter/Atlas-iOS,daninfpj/Atlas-iOS,sujohn/Atlas-iOS,jeff-riffsy/Atlas-iOS,sunfei/Atlas-iOS,sanvean/Atlas-iOS,keyeMyria/Atlas-iOS,shaohung001/Atlas-iOS,Eynaliyev/Atlas-iOS,jianwoo/Atlas-iOS,sidewire/Atlas-iOS,ccrazy88/Atlas-iOS,leopardpan/Atlas-iOS,nKey/Atlas-iOS,charlespsdowd/Atlas-iOS,linearregression/Atlas-iOS,venturehacks/Atlas-iOS,bright/Atlas-iOS,BearchInc/Atlas-iOS,Cambly/Atlas-iOS,geoffmacd/Atlas-iOS,andrewcopp/Atlas-iOS,r0ct0-tecsynt/Atlas-iOS,jaderfeijo/Atlas-iOS |
648778df9610e63104914c7fd9a59a07c3016fe4 | BraintreeCore/BTAPIClient_Internal.h | BraintreeCore/BTAPIClient_Internal.h | #import "BTAnalyticsService.h"
#import "BTAPIClient.h"
#import "BTClientMetadata.h"
#import "BTClientToken.h"
#import "BTHTTP.h"
#import "BTJSON.h"
NS_ASSUME_NONNULL_BEGIN
@class BTPaymentMethodNonce;
@interface BTAPIClient ()
@property (nonatomic, copy, nullable) NSString *tokenizationKey;
@property (nonatomic, strong, nullable) BTClientToken *clientToken;
@property (nonatomic, strong) BTHTTP *http;
@property (nonatomic, strong) BTHTTP *configurationHTTP;
/*!
@brief Client metadata that is used for tracking the client session
*/
@property (nonatomic, readonly, strong) BTClientMetadata *metadata;
/*!
@brief Exposed for testing analytics
*/
@property (nonatomic, strong) BTAnalyticsService *analyticsService;
/*!
@brief Sends this event and all queued analytics events. Used by internal clients.
*/
- (void)sendAnalyticsEvent:(NSString *)eventName;
/*!
@brief Queues an analytics event to be sent.
*/
- (void)queueAnalyticsEvent:(NSString *)eventName;
/*!
@brief An internal initializer to toggle whether to send an analytics event during initialization.
@discussion This prevents copyWithSource:integration: from sending a duplicate event. It can also be used to suppress excessive network chatter during testing.
*/
- (nullable instancetype)initWithAuthorization:(NSString *)authorization sendAnalyticsEvent:(BOOL)sendAnalyticsEvent;
@end
NS_ASSUME_NONNULL_END
| #import "BTAnalyticsService.h"
#import "BTAPIClient.h"
#import "BTClientMetadata.h"
#import "BTClientToken.h"
#import "BTHTTP.h"
#import "BTJSON.h"
NS_ASSUME_NONNULL_BEGIN
@class BTPaymentMethodNonce;
@interface BTAPIClient ()
@property (nonatomic, copy, nullable) NSString *tokenizationKey;
@property (nonatomic, strong, nullable) BTClientToken *clientToken;
@property (nonatomic, strong) BTHTTP *http;
@property (nonatomic, strong) BTHTTP *configurationHTTP;
/*!
@brief Client metadata that is used for tracking the client session
*/
@property (nonatomic, readonly, strong) BTClientMetadata *metadata;
/*!
@brief Exposed for testing analytics
*/
@property (nonatomic, strong) BTAnalyticsService *analyticsService;
/*!
@brief Sends this event and all queued analytics events. Use `queueAnalyticsEvent` for low priority events.
*/
- (void)sendAnalyticsEvent:(NSString *)eventName;
/*!
@brief Queues an analytics event to be sent.
*/
- (void)queueAnalyticsEvent:(NSString *)eventName;
/*!
@brief An internal initializer to toggle whether to send an analytics event during initialization.
@discussion This prevents copyWithSource:integration: from sending a duplicate event. It can also be used to suppress excessive network chatter during testing.
*/
- (nullable instancetype)initWithAuthorization:(NSString *)authorization sendAnalyticsEvent:(BOOL)sendAnalyticsEvent;
@end
NS_ASSUME_NONNULL_END
| Update header documentation for BTAPIClient-Internal | Update header documentation for BTAPIClient-Internal
| C | mit | braintree/braintree_ios,apascual/braintree_ios,billCTG/braintree_ios,apascual/braintree_ios,braintree/braintree_ios,billCTG/braintree_ios,billCTG/braintree_ios,billCTG/braintree_ios,braintree/braintree_ios,apascual/braintree_ios,apascual/braintree_ios,braintree/braintree_ios,billCTG/braintree_ios |
1bd3551a0fbd8bc375a9bb7a60d8152ff641f3f9 | tests/regression/36-apron/01-octagon_simple.c | tests/regression/36-apron/01-octagon_simple.c | // SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy
// Example from https://www-apr.lip6.fr/~mine/publi/article-mine-HOSC06.pdf
void main(void) {
int X = 0;
int N = rand();
if(N < 0) { N = 0; }
while(X < N) {
X++;
}
assert(X-N == 0);
assert(X == N);
if(X == N) {
N = 8;
} else {
// is dead code but if that is detected or not depends on what we do in branch
// currently we can't detect this
N = 42;
}
}
| // SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy
// Example from https://www-apr.lip6.fr/~mine/publi/article-mine-HOSC06.pdf
void main(void) {
int X = 0;
int N = rand();
if(N < 0) { N = 0; }
while(X < N) {
X++;
}
assert(X-N == 0);
assert(X == N);
if(X == N) {
N = 8;
} else {
// dead code
N = 42;
}
assert(N == 8);
}
| Make assert in 36/01 stronger | Make assert in 36/01 stronger
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
d922310020e7b97741a5f7e45e84c9ff840514fc | Code/CDAUtilities.h | Code/CDAUtilities.h | //
// CDAUtilities.h
// ContentfulSDK
//
// Created by Boris Bügling on 04/03/14.
//
//
#import <ContentfulDeliveryAPI/CDAClient.h>
#import <Foundation/Foundation.h>
NSString* CDACacheFileNameForQuery(CDAClient* client, CDAResourceType resourceType, NSDictionary* query);
NSString* CDACacheFileNameForResource(CDAResource* resource);
NSArray* CDAClassGetSubclasses(Class parentClass);
void CDADecodeObjectWithCoder(id object, NSCoder* aDecoder);
void CDAEncodeObjectWithCoder(id object, NSCoder* aCoder);
BOOL CDAIsNoNetworkError(NSError* error);
| //
// CDAUtilities.h
// ContentfulSDK
//
// Created by Boris Bügling on 04/03/14.
//
//
#import <ContentfulDeliveryAPI/CDAClient.h>
#import <Foundation/Foundation.h>
NSString* CDACacheDirectory();
NSString* CDACacheFileNameForQuery(CDAClient* client, CDAResourceType resourceType, NSDictionary* query);
NSString* CDACacheFileNameForResource(CDAResource* resource);
NSArray* CDAClassGetSubclasses(Class parentClass);
void CDADecodeObjectWithCoder(id object, NSCoder* aDecoder);
void CDAEncodeObjectWithCoder(id object, NSCoder* aCoder);
BOOL CDAIsNoNetworkError(NSError* error);
| Make the cache directory accessor public. | Make the cache directory accessor public.
| C | mit | contentful/contentful.objc,contentful/contentful.objc,davidmdavis/contentful.objc,davidmdavis/contentful.objc,akfreas/contentful.objc,contentful/contentful.objc,danieleggert/contentful.objc,danieleggert/contentful.objc,akfreas/contentful.objc,danieleggert/contentful.objc,akfreas/contentful.objc,davidmdavis/contentful.objc |
6fac7a106ada5c1428a629d9ef418f0482c01001 | PHYKit/PHYKit/PHYGeometry.h | PHYKit/PHYKit/PHYGeometry.h | //
// PHYGeometry.h
// PHYKit
//
// Created by Nora Trapp on 8/1/13.
// Copyright (c) 2013 Nora Trapp. All rights reserved.
//
#import <Box2D/Common/b2Math.h>
#define kPointsToMeterRatio (32)
#define PointsToMeters(points) (points / kPointsToMeterRatio)
#define MetersToPoints(meters) (meters * kPointsToMeterRatio)
#define CGPointTob2Vec2(point) (b2Vec2(PointsToMeters(point.x), PointsToMeters(point.y)))
#define b2Vec2ToCGPoint(vector) (CGPointMake(MetersToPoints(vector.x), MetersToPoints(vector.y)))
| //
// PHYGeometry.h
// PHYKit
//
// Created by Nora Trapp on 8/1/13.
// Copyright (c) 2013 Nora Trapp. All rights reserved.
//
#import <Box2D/Common/b2Math.h>
#define kPointsToMeterRatio (32.0)
#define PointsToMeters(points) (points / kPointsToMeterRatio)
#define MetersToPoints(meters) (meters * kPointsToMeterRatio)
#define CGPointTob2Vec2(point) (b2Vec2(PointsToMeters(point.x), PointsToMeters(point.y)))
#define b2Vec2ToCGPoint(vector) (CGPointMake(MetersToPoints(vector.x), MetersToPoints(vector.y)))
| Change PointsToMeters ratio to a float, so we doing floating point math | Change PointsToMeters ratio to a float, so we doing floating point math
| C | mit | Imperiopolis/PHYKit |
a5f1eb8cfa251cd56957cdbc434322f1a5406ee2 | src/math/double/log.c | src/math/double/log.c | #include "kernel/log.h"
#include "normalize.h"
#include "../reinterpret.h"
#include <math.h>
static double _finite(int64_t i)
{
const double ln2[] = { 0x1.62e42fefa4p-1, -0x1.8432a1b0e2634p-43 };
int64_t exponent = (i - 0x3FE6A09E667F3BCD) >> 52;
double x = reinterpret(double, i - (exponent << 52)) - 1;
double z = x / (x + 2);
double h = 0.5 * x * x;
return z * (h + _kernel_log(z)) + exponent * ln2[1] - h + x + exponent * ln2[0];
}
double log(double x)
{
int64_t i = reinterpret(int64_t, x);
if (i <= 0)
return i << 1 == 0 ? -INFINITY : NAN;
if (i < 0x7FF0000000000000)
return _finite(_normalize(i));
return x;
}
| #include "kernel/log.h"
#include "normalize.h"
#include "../reinterpret.h"
#include <math.h>
static double _finite(int64_t i)
{
const double ln2[] = { 0x1.62e42fefa4p-1, -0x1.8432a1b0e2634p-43 };
int64_t exponent = (i - 0x3FE6A09E667F3BCD) >> 52;
double x = reinterpret(double, i - (exponent << 52)) - 1;
double z = x / (x + 2);
double h = 0.5 * x * x;
return exponent * ln2[1] + z * (h + _kernel_log(z)) - h + x + exponent * ln2[0];
}
double log(double x)
{
int64_t i = reinterpret(int64_t, x);
if (i <= 0)
return i << 1 == 0 ? -INFINITY : NAN;
if (i < 0x7FF0000000000000)
return _finite(_normalize(i));
return x;
}
| Reorder terms by expected size, though this does not affect calculation | Reorder terms by expected size, though this does not affect calculation
| C | mit | jdh8/metallic,jdh8/metallic,jdh8/metallic,jdh8/metallic,jdh8/metallic |
be41c270b9b111574aabadf20d4eb77a395974ff | tests/regression/34-localwn_restart/21-restart_abort_aget.c | tests/regression/34-localwn_restart/21-restart_abort_aget.c | // SKIP PARAM: --enable exp.solver.td3.restart.wpoint.enabled --enable exp.solver.td3.abort
#include<stdlib.h>
struct a {
int b;
} c(), *f;
int g;
void d();
void e();
int main() {
void *h = calloc(1, sizeof(struct a));
f = h;
d(e);
while (1) {
g = c;
if (c)
break;
f->b = 0;
}
d(h);
} | Add minimized test where abort fails. | Add minimized test where abort fails.
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
903787a5941c9eabcbfe597ee4d80843dc9c586f | src/modules/conf_randr/e_smart_monitor.h | src/modules/conf_randr/e_smart_monitor.h | #ifdef E_TYPEDEFS
#else
# ifndef E_SMART_MONITOR_H
# define E_SMART_MONITOR_H
Evas_Object *e_smart_monitor_add(Evas *evas);
void e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch);
void e_smart_monitor_output_set(Evas_Object *obj, Ecore_X_Randr_Output output);
void e_smart_monitor_grid_set(Evas_Object *obj, Evas_Object *grid);
void e_smart_monitor_background_set(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy);
# endif
#endif
| #ifdef E_TYPEDEFS
#else
# ifndef E_SMART_MONITOR_H
# define E_SMART_MONITOR_H
Evas_Object *e_smart_monitor_add(Evas *evas);
void e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch);
void e_smart_monitor_output_set(Evas_Object *obj, Ecore_X_Randr_Output output);
void e_smart_monitor_grid_set(Evas_Object *obj, Evas_Object *grid, Evas_Coord gx, Evas_Coord gy, Evas_Coord gw, Evas_Coord gh);
void e_smart_monitor_virtual_size_set(Evas_Object *obj, Evas_Coord vw, Evas_Coord vh);
void e_smart_monitor_background_set(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy);
# endif
#endif
| Change monitor_grid_set function to also accept the grid geometry (used for virtual-->canvas coordinate functions). | Change monitor_grid_set function to also accept the grid geometry
(used for virtual-->canvas coordinate functions).
Signed-off-by: Christopher Michael <[email protected]>
SVN revision: 84169
| C | bsd-2-clause | tasn/enlightenment,rvandegrift/e,FlorentRevest/Enlightenment,rvandegrift/e,rvandegrift/e,FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment,tasn/enlightenment,tasn/enlightenment,tizenorg/platform.upstream.enlightenment,FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment |
e65030e7639fd0e21789ed18855b36720cdba09d | samples/fx_lpng/include/fx_png.h | samples/fx_lpng/include/fx_png.h | // Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../lpng_v163/png.h"
| // Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../lpng_v163/png.h"
| Convert all files on the master branch to unix line endings. | Convert all files on the master branch to unix line endings.
Luckily, it's just one file.
BUG=none
[email protected]
Review URL: https://codereview.chromium.org/1281923004 .
| C | bsd-3-clause | was4444/pdfium,DrAlexx/pdfium,azunite/libpdfium,andoma/pdfium,andoma/pdfium,was4444/pdfium,DrAlexx/pdfium,azunite/libpdfium,was4444/pdfium,DrAlexx/pdfium,was4444/pdfium,andoma/pdfium,andoma/pdfium,azunite/libpdfium,DrAlexx/pdfium,azunite/libpdfium |
7d2c8d0aed20b6d2b02c7bd79aed173664742a6e | src/condor_ckpt/condor_syscalls.h | src/condor_ckpt/condor_syscalls.h | #ifndef _CONDOR_SYSCALLS_H
#define _CONDOR_SYSCALLS_H
#if defined( AIX32)
# include "syscall.aix32.h"
#else
# include <syscall.h>
#endif
typedef int BOOL;
static const int SYS_LOCAL = 1;
static const int SYS_REMOTE = 0;
static const int SYS_RECORDED = 2;
static const int SYS_MAPPED = 2;
static const int SYS_UNRECORDED = 0;
static const int SYS_UNMAPPED = 0;
#if defined(__cplusplus)
extern "C" {
#endif
int SetSyscalls( int mode );
int GetSyscallMode();
BOOL LocalSysCalls();
BOOL RemoteSysCalls();
BOOL MappingFileDescriptors();
int REMOTE_syscall( int syscall_num, ... );
#if defined(OSF1) || defined(HPUX9)
int syscall( int, ... );
#endif
#if defined(__cplusplus)
}
#endif
#endif
| #ifndef _CONDOR_SYSCALLS_H
#define _CONDOR_SYSCALLS_H
#if defined( AIX32)
# include "syscall.aix32.h"
#else
# include <syscall.h>
#endif
typedef int BOOL;
static const int SYS_LOCAL = 1;
static const int SYS_REMOTE = 0;
static const int SYS_RECORDED = 2;
static const int SYS_MAPPED = 2;
static const int SYS_UNRECORDED = 0;
static const int SYS_UNMAPPED = 0;
#if defined(__cplusplus)
extern "C" {
#endif
int SetSyscalls( int mode );
int GetSyscallMode();
BOOL LocalSysCalls();
BOOL RemoteSysCalls();
BOOL MappingFileDescriptors();
int REMOTE_syscall( int syscall_num, ... );
#if defined(OSF1) || defined(HPUX9) || defined(SUNOS41)
int syscall( int, ... );
#endif
#if defined(__cplusplus)
}
#endif
#endif
| Add SUNOS41 to an existing conditional compilation directive. | Add SUNOS41 to an existing conditional compilation directive.
| C | apache-2.0 | mambelli/osg-bosco-marco,zhangzhehust/htcondor,clalancette/condor-dcloud,htcondor/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,clalancette/condor-dcloud,djw8605/condor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,zhangzhehust/htcondor,clalancette/condor-dcloud,djw8605/htcondor,neurodebian/htcondor,htcondor/htcondor,htcondor/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/condor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,htcondor/htcondor,bbockelm/condor-network-accounting,zhangzhehust/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,htcondor/htcondor,neurodebian/htcondor,djw8605/htcondor,clalancette/condor-dcloud,djw8605/condor,zhangzhehust/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,djw8605/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,djw8605/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,neurodebian/htcondor,neurodebian/htcondor,djw8605/condor,djw8605/condor,htcondor/htcondor,djw8605/condor,zhangzhehust/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,djw8605/condor,clalancette/condor-dcloud,djw8605/htcondor,djw8605/condor,djw8605/htcondor,neurodebian/htcondor,neurodebian/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco |
295b8c8f866469181703c4c2e882dc6af955e9c7 | K2Status-static-ImportExport/include/k2info.h | K2Status-static-ImportExport/include/k2info.h | #include "k2pktdef.h"
#define TRACE2_STA_LEN 7
#define TRACE2_CHAN_LEN 9 /* 4 bytes plus padding for loc and version */
#define TRACE2_NET_LEN 9
#define TRACE2_LOC_LEN 3
#define K2INFO_TYPE_STRING "TYPE_K2INFO_PACKET"
typedef struct {
char net[TRACE2_NET_LEN]; /* Network name */
char sta[TRACE2_STA_LEN]; /* Site name */
qint16 data_type; /* see K2INFO_TYPE #defines below */
quint32 epoch_sent; /* local time sent */
quint16 reserved[5]; /* reserved for future use */
} K2INFO_HEADER;
#define K2INFO_TYPE_HEADER 1 /* k2 header params */
#define K2INFO_TYPE_STATUS 2 /* k2 regular status packet */
#define K2INFO_TYPE_ESTATUS 3 /* k2 extended status packet (old) */
#define K2INFO_TYPE_E2STATUS 4 /* k2 extended status packet v2 */
#define K2INFO_TYPE_COMM 5 /* k2ew packet processing stats */
#define MAX_K2INFOBUF_SIZ 4096
typedef union {
qint8 msg[MAX_K2INFOBUF_SIZ];
K2INFO_HEADER k2info;
} K2infoPacket;
| #include "k2pktdef.h"
#define TRACE2_STA_LEN 7
#define TRACE2_CHAN_LEN 9 /* 4 bytes plus padding for loc and version */
#define TRACE2_NET_LEN 9
#define TRACE2_LOC_LEN 3
#define K2_TIME_CONV ((unsigned long)315532800)
#define K2INFO_TYPE_STRING "TYPE_K2INFO_PACKET"
typedef struct {
char net[TRACE2_NET_LEN]; /* Network name */
char sta[TRACE2_STA_LEN]; /* Site name */
qint16 data_type; /* see K2INFO_TYPE #defines below */
quint32 epoch_sent; /* local time sent */
quint16 reserved[5]; /* reserved for future use */
} K2INFO_HEADER;
#define K2INFO_TYPE_HEADER 1 /* k2 header params */
#define K2INFO_TYPE_STATUS 2 /* k2 regular status packet */
#define K2INFO_TYPE_ESTATUS 3 /* k2 extended status packet (old) */
#define K2INFO_TYPE_E2STATUS 4 /* k2 extended status packet v2 */
#define K2INFO_TYPE_COMM 5 /* k2ew packet processing stats */
#define MAX_K2INFOBUF_SIZ 4096
typedef union {
qint8 msg[MAX_K2INFOBUF_SIZ];
K2INFO_HEADER k2info;
} K2infoPacket;
| Make 64Bit Friendly, NonStatic for Ubuntu 14.04 delete unneeded files | Make 64Bit Friendly, NonStatic for Ubuntu 14.04 delete unneeded files
| C | lgpl-2.1 | Fran89/K2Status,Fran89/K2Status |
ec3bd3aa0c6b507e8819d58ac5282b7f97f0be28 | libslax/slaxprofiler.h | libslax/slaxprofiler.h | /*
* $Id$
*
* Copyright (c) 2010-2011, Juniper Networks, Inc.
* All rights reserved.
* This SOFTWARE is licensed under the LICENSE provided in the
* ../Copyright file. By downloading, installing, copying, or otherwise
* using the SOFTWARE, you agree to be bound by the terms of that
* LICENSE.
*/
/**
* Called from the debugger when we want to profile a script.
*
* @docp document pointer for the script
* @returns TRUE is there was a problem
*/
int
slaxProfOpen (xmlDocPtr docp);
/**
* Called when we enter a instruction.
*
* @docp document pointer
* @inst instruction (slax/xslt code) pointer
*/
void
slaxProfEnter (xmlNodePtr inst);
/**
* Called when we exit an instruction
*/
void
slaxProfExit (void);
#if 0
typedef int (*slaxProfCallback_t)(void *, const char *fmt, ...);
#endif
/**
* Report the results
*/
void
slaxProfReport (int);
/**
* Clear all values
*/
void
slaxProfClear (void);
/**
* Done (free resources)
*/
void
slaxProfClose (void);
| /*
* Copyright (c) 2010-201e, Juniper Networks, Inc.
* All rights reserved.
* This SOFTWARE is licensed under the LICENSE provided in the
* ../Copyright file. By downloading, installing, copying, or otherwise
* using the SOFTWARE, you agree to be bound by the terms of that
* LICENSE.
*/
/**
* Called from the debugger when we want to profile a script.
*
* @docp document pointer for the script
* @returns TRUE is there was a problem
*/
int
slaxProfOpen (xmlDocPtr docp);
/**
* Called when we enter a instruction.
*
* @docp document pointer
* @inst instruction (slax/xslt code) pointer
*/
void
slaxProfEnter (xmlNodePtr inst);
/**
* Called when we exit an instruction
*/
void
slaxProfExit (void);
#if 0
typedef int (*slaxProfCallback_t)(void *, const char *fmt, ...);
#endif
/**
* Report the results
*/
void
slaxProfReport (int);
/**
* Clear all values
*/
void
slaxProfClear (void);
/**
* Done (free resources)
*/
void
slaxProfClose (void);
| Drop $Id$ and update copyright | Drop $Id$ and update copyright
| C | bsd-3-clause | Juniper/libslax,Juniper/libslax,Juniper/libslax |
5fd3d4cdd83c079b2f588380622b2b3348a67360 | src/IDPDataKit.h | src/IDPDataKit.h | #import "IDPBlock.h"
#import "IDPBufferArray.h"
#import "IDPKVOContext.h"
#import "IDPKVOMutableArray.h"
#import "IDPKeyPathObserver.h"
#import "IDPMachTimer.h"
#import "IDPMutableArray.h"
#import "IDPMutableDictionary.h"
#import "IDPOCContext.h"
#import "IDPOCImplementation.h"
#import "IDPOCStack.h"
#import "NSObject+IDPOCExtensionsPrivate.h"
#import "IDPReference.h"
#import "IDPRetainingReference.h"
#import "IDPWeakReference.h"
#import "IDPRetainingDictionary.h"
#import "IDPStackArray.h"
#import "IDPURLConnection.h"
#import "IDPURLRequest.h"
#import "IDPWeakArray.h"
| #import "IDPBlock.h"
#import "IDPBufferArray.h"
#import "IDPKVOContext.h"
#import "IDPKVOMutableArray.h"
#import "IDPKeyPathObserver.h"
#import "IDPMachTimer.h"
#import "IDPMutableArray.h"
#import "IDPMutableDictionary.h"
#import "IDPOCContext.h"
#import "IDPOCImplementation.h"
#import "IDPOCStack.h"
#import "NSObject+IDPOCExtensionsPrivate.h"
#import "IDPReference.h"
#import "IDPRetainingReference.h"
#import "IDPWeakReference.h"
#import "IDPRetainingDictionary.h"
#import "IDPStackArray.h"
#import "IDPURLConnection.h"
#import "IDPURLRequest.h"
#import "IDPWeakArray.h"
#import "IDPSingletonModel.h"
| Add to header file IDPSingletonModel. | Add to header file IDPSingletonModel.
| C | bsd-3-clause | idapgroup/DataKit,idapgroup/DataKit,idapgroup/DataKit,idapgroup/DataKit |
cc45877f2a988121937b6bc7a5a0d64a4b62d518 | testmud/mud/home/Text/sys/bin/wiz/colortest.c | testmud/mud/home/Text/sys/bin/wiz/colortest.c | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2012 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <kotaka/paths.h>
#include <text/paths.h>
inherit LIB_BIN;
void main(string args)
{
object user;
object painter;
object gc;
int x, y, b;
user = query_user();
painter = new_object(LWO_PAINTER);
painter->set_size(16, 8);
gc = painter->create_gc();
gc->set_clip(0, 0, 15, 7);
b = random(128);
for (y = 0; y < 8; y++) {
for (x = 0; x < 16; x++) {
gc->set_color((x + y * 16) ^ b);
gc->move_pen(x, y);
gc->draw("X");
}
}
send_out(implode(painter->render_color(), "\n") + "\n");
}
| Add color testing command with random order, to uncover subtle bugs | Add color testing command with random order, to uncover subtle bugs
| C | agpl-3.0 | shentino/kotaka,shentino/kotaka,shentino/kotaka |
|
47f76f175cf6dd8f81711146e6845006c1912c2f | include/swift/Basic/SmallPtrSetVector.h | include/swift/Basic/SmallPtrSetVector.h | //===--- SmallPtrSetVector.h ----------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_BASIC_SMALLPTRSETVECTOR_H
#define SWIFT_BASIC_SMALLPTRSETVECTOR_H
#include "swift/Basic/LLVM.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
namespace swift {
/// A SetVector that performs no allocations if smaller than a certain
/// size. Uses a SmallPtrSet/SmallVector internally.
template <typename T, unsigned VectorSize, unsigned SetSize = VectorSize>
class SmallPtrSetVector : public llvm::SetVector<T, SmallVector<T, VectorSize>,
SmallPtrSet<T, SetSize>> {
public:
SmallPtrSetVector() = default;
/// Initialize a SmallPtrSetVector with a range of elements
template <typename It> SmallPtrSetVector(It Start, It End) {
this->insert(Start, End);
}
};
} // namespace swift
namespace std {
/// Implement std::swap in terms of SmallSetVector swap.
///
/// This matches llvm's implementation for SmallSetVector.
template <typename T, unsigned VectorSize, unsigned SetSize = VectorSize>
inline void swap(swift::SmallPtrSetVector<T, VectorSize, SetSize> &LHS,
swift::SmallPtrSetVector<T, VectorSize, SetSize> &RHS) {
LHS.swap(RHS);
}
} // end namespace std
#endif
| Add a variant of SmallSetVector that uses SmallPtrSet internally instead of SmallDenseSet. | [sil] Add a variant of SmallSetVector that uses SmallPtrSet internally instead of SmallDenseSet.
| C | apache-2.0 | apple/swift,parkera/swift,ahoppen/swift,roambotics/swift,tkremenek/swift,atrick/swift,parkera/swift,rudkx/swift,hooman/swift,tkremenek/swift,gregomni/swift,glessard/swift,ahoppen/swift,rudkx/swift,roambotics/swift,JGiola/swift,ahoppen/swift,JGiola/swift,xwu/swift,benlangmuir/swift,roambotics/swift,benlangmuir/swift,tkremenek/swift,atrick/swift,JGiola/swift,roambotics/swift,hooman/swift,hooman/swift,apple/swift,glessard/swift,rudkx/swift,JGiola/swift,glessard/swift,glessard/swift,JGiola/swift,gregomni/swift,benlangmuir/swift,xwu/swift,rudkx/swift,tkremenek/swift,xwu/swift,rudkx/swift,ahoppen/swift,atrick/swift,xwu/swift,gregomni/swift,hooman/swift,ahoppen/swift,tkremenek/swift,glessard/swift,glessard/swift,apple/swift,apple/swift,parkera/swift,hooman/swift,JGiola/swift,tkremenek/swift,apple/swift,gregomni/swift,benlangmuir/swift,tkremenek/swift,gregomni/swift,parkera/swift,atrick/swift,rudkx/swift,apple/swift,benlangmuir/swift,roambotics/swift,atrick/swift,xwu/swift,benlangmuir/swift,parkera/swift,gregomni/swift,parkera/swift,roambotics/swift,ahoppen/swift,hooman/swift,atrick/swift,xwu/swift,xwu/swift,hooman/swift,parkera/swift,parkera/swift |
|
67ce2b4d5e93bea3bbbb28f711f0de09228f9de9 | src/unique_ptr.h | src/unique_ptr.h | // Copyright 2014 The open-vcdiff Authors. All Rights Reserved.
// Author: Mostyn Bramley-Moore
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef OPEN_VCDIFF_UNIQUE_PTR_H_
#define OPEN_VCDIFF_UNIQUE_PTR_H_
// std::auto_ptr is deprecated in C++11, in favor of std::unique_ptr.
// Since C++11 is not widely available yet, the macro below is used to
// select the best available option.
#include <memory>
#if __cplusplus >= 201103L
// C++11
#define UNIQUE_PTR std::unique_ptr
#else
#define UNIQUE_PTR std::auto_ptr
#endif
#endif // OPEN_VCDIFF_UNIQUE_PTR_H_
| // Copyright 2014 The open-vcdiff Authors. All Rights Reserved.
// Author: Mostyn Bramley-Moore
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef OPEN_VCDIFF_UNIQUE_PTR_H_
#define OPEN_VCDIFF_UNIQUE_PTR_H_
// std::auto_ptr is deprecated in C++11, in favor of std::unique_ptr.
// Since C++11 is not widely available yet, the macro below is used to
// select the best available option.
#include <memory>
#if __cplusplus >= 201103L && !defined(OPEN_VCDIFF_USE_AUTO_PTR) // C++11
#define UNIQUE_PTR std::unique_ptr
#else
#define UNIQUE_PTR std::auto_ptr
#endif // __cplusplus >= 201103L && !defined(OPEN_VCDIFF_USE_AUTO_PTR)
#endif // OPEN_VCDIFF_UNIQUE_PTR_H_
| Add an option to force use of auto_ptr for legacy STL implementations. | Add an option to force use of auto_ptr for legacy STL implementations.
| C | apache-2.0 | Steelskin/open-vcdiff,elly/open-vcdiff,Steelskin/open-vcdiff,google/open-vcdiff,elly/open-vcdiff,google/open-vcdiff,elly/open-vcdiff,google/open-vcdiff,Steelskin/open-vcdiff |
ffbd18870f6fa2284884e6c425e51f00efe48cc2 | src/util/files.c | src/util/files.c | //
// Created by gravypod on 9/20/17.
//
#include "files.h"
#include <sys/stat.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
long int fsize(const char *filename)
{
struct stat st;
if (stat(filename, &st) == 0)
return st.st_size;
return -1;
}
char* read_file(const char* filename)
{
const size_t file_size = (size_t) fsize(filename);
FILE *f;
if (file_size == -1 || !(f = fopen(filename, "rb"))) {
return NULL;
}
size_t data_left = file_size;
char *buffer = malloc(file_size + 1);
char *tmp = buffer;
while (data_left > 0)
{
const size_t len = fread((void *) tmp, sizeof(char), sizeof(buffer), f);
data_left -= len;
tmp += len;
}
buffer[file_size] = 0;
fclose(f);
return buffer;
} | //
// Created by gravypod on 9/20/17.
//
#include "files.h"
#include <sys/stat.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
long int fsize(const char *filename)
{
struct stat st;
if (stat(filename, &st) == 0)
return st.st_size;
return -1;
}
char* read_file(const char* filename)
{
long int reported_size = fsize(filename);
FILE *f;
if (reported_size == -1 || !(f = fopen(filename, "rb"))) {
return NULL;
}
const size_t file_size = (size_t) reported_size;
size_t data_left = file_size;
char *buffer = malloc(file_size + 1);
char *tmp = buffer;
while (data_left > 0)
{
const size_t len = fread((void *) tmp, sizeof(char), sizeof(buffer), f);
data_left -= len;
tmp += len;
}
buffer[file_size] = 0;
fclose(f);
return buffer;
} | Make sure file stat actually finished. Don't check a size_t for neg. | Make sure file stat actually finished. Don't check a size_t for neg.
| C | mit | gravypod/solid-snake,gravypod/solid-snake,gravypod/solid-snake |
681cc70a6305451ea1c85dbd239ea3cd38abe7b3 | simulator/ghc_instruction.h | simulator/ghc_instruction.h | #include <vector>
enum GHCMnemonic {
MOV,
INC,
DEC,
ADD,
SUB,
MUL,
DIV,
AND,
OR,
XOR,
JLT,
JEQ,
JGT,
INT,
HLT
};
enum GHCRegister {
A = 0,
B,
C,
D,
E,
F,
G,
H,
PC
};
enum GHCArgumentType {
Constant,
Register,
Memory
};
struct GHCArgument {
GHCArgumentType type;
unsigned int id;
};
struct GHCInstruction {
GHCMnemonic mnemonic;
std::vector<GHCArgument> arguments;
};
| #include <vector>
enum GHCMnemonic {
MOV,
INC,
DEC,
ADD,
SUB,
MUL,
DIV,
AND,
OR,
XOR,
JLT,
JEQ,
JGT,
INT,
HLT
};
enum GHCRegister {
A = 0,
B,
C,
D,
E,
F,
G,
H,
PC
};
enum GHCArgumentType {
Constant,
Register,
Memory
};
struct GHCArgument {
GHCArgumentType type;
bool as_address;
unsigned int id;
};
struct GHCInstruction {
GHCMnemonic mnemonic;
std::vector<GHCArgument> arguments;
};
| Add as_address on mnemonic argument. | Add as_address on mnemonic argument.
| C | mit | fuqinho/icfpc2014,fuqinho/icfpc2014 |
1fb59024b3e1b2989ecadfa7a6c4b39b11f7a4e2 | utils/ansi_colors.h | utils/ansi_colors.h | #ifndef _ANSI_COLORS
#define _ANSI_COLORS
#define ANSI_COLOR_RED "\x1b[31m"
#define ANSI_COLOR_GREEN "\x1b[32m"
#define ANSI_COLOR_YELLOW "\x1b[33m"
#define ANSI_COLOR_BLUE "\x1b[34m"
#define ANSI_COLOR_MAGENTA "\x1b[35m"
#define ANSI_COLOR_CYAN "\x1b[36m"
#define ANSI_COLOR_RESET "\x1b[0m"
#endif
| Add ansi colors file header | Add ansi colors file header
| C | mit | elc1798/wish |
|
495a5a547f3eefbdf0e4b29d510d63a4ff0a3664 | src/ia64/Gis_signal_frame.c | src/ia64/Gis_signal_frame.c | /* libunwind - a platform-independent unwind library
Copyright (C) 2001-2002 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include "unwind_i.h"
int
unw_is_signal_frame (unw_cursor_t *cursor)
{
struct ia64_cursor *c = (struct ia64_cursor *) cursor;
struct ia64_state_record sr;
int ret;
/* Crude and slow, but we need to peek ahead into the unwind
descriptors to find out if the current IP is inside the signal
trampoline. */
ret = ia64_create_state_record (c, &sr);
if (ret < 0)
return ret;
return sr.is_signal_frame;
}
| Use "is_signal_frame" instead of IA64_FLAG_SIGTRAMP flag bit. | (unw_is_signal_frame): Use "is_signal_frame" instead of IA64_FLAG_SIGTRAMP flag bit.
2002/12/11 12:26:26-08:00 mostang.com!davidm
Rename: src/ia64/Lis_signal_frame.c -> src/ia64/Gis_signal_frame.c
(Logical change 1.30)
| C | mit | pathscale/libunwind,atanasyan/libunwind,cms-externals/libunwind,pathscale/libunwind,cloudius-systems/libunwind,yuyichao/libunwind,mpercy/libunwind,maltek/platform_external_libunwind,cloudius-systems/libunwind,zeldin/platform_external_libunwind,olibc/libunwind,djwatson/libunwind,joyent/libunwind,olibc/libunwind,Chilledheart/libunwind,vegard/libunwind,wdv4758h/libunwind,evaautomation/libunwind,ehsan/libunwind,geekboxzone/lollipop_external_libunwind,igprof/libunwind,atanasyan/libunwind-android,krytarowski/libunwind,cloudius-systems/libunwind,Keno/libunwind,SyndicateRogue/libunwind,igprof/libunwind,DroidSim/platform_external_libunwind,wdv4758h/libunwind,zeldin/platform_external_libunwind,fdoray/libunwind,CyanogenMod/android_external_libunwind,dreal-deps/libunwind,vegard/libunwind,CyanogenMod/android_external_libunwind,tkelman/libunwind,jrmuizel/libunwind,evaautomation/libunwind,rntz/libunwind,rntz/libunwind,martyone/libunwind,fdoray/libunwind,vtjnash/libunwind,rantala/libunwind,mpercy/libunwind,frida/libunwind,rogwfu/libunwind,dagar/libunwind,zliu2014/libunwind-tilegx,tronical/libunwind,frida/libunwind,unkadoug/libunwind,geekboxzone/lollipop_external_libunwind,mpercy/libunwind,martyone/libunwind,jrmuizel/libunwind,tronical/libunwind,evaautomation/libunwind,0xlab/0xdroid-external_libunwind,bo-on-software/libunwind,rogwfu/libunwind,geekboxzone/lollipop_external_libunwind,androidarmv6/android_external_libunwind,ehsan/libunwind,geekboxzone/mmallow_external_libunwind,rogwfu/libunwind,libunwind/libunwind,maltek/platform_external_libunwind,project-zerus/libunwind,djwatson/libunwind,zliu2014/libunwind-tilegx,lat/libunwind,unkadoug/libunwind,tronical/libunwind,rntz/libunwind,yuyichao/libunwind,joyent/libunwind,SyndicateRogue/libunwind,cms-externals/libunwind,geekboxzone/mmallow_external_libunwind,project-zerus/libunwind,DroidSim/platform_external_libunwind,djwatson/libunwind,android-ia/platform_external_libunwind,dropbox/libunwind,bo-on-software/libunwind,vtjnash/libunwind,geekboxzone/mmallow_external_libunwind,project-zerus/libunwind,Keno/libunwind,atanasyan/libunwind-android,dagar/libunwind,igprof/libunwind,olibc/libunwind,android-ia/platform_external_libunwind,tony/libunwind,krytarowski/libunwind,frida/libunwind,krytarowski/libunwind,pathscale/libunwind,wdv4758h/libunwind,fillexen/libunwind,fdoray/libunwind,martyone/libunwind,libunwind/libunwind,joyent/libunwind,cms-externals/libunwind,vegard/libunwind,rantala/libunwind,yuyichao/libunwind,adsharma/libunwind,fillexen/libunwind,androidarmv6/android_external_libunwind,atanasyan/libunwind,dreal-deps/libunwind,DroidSim/platform_external_libunwind,0xlab/0xdroid-external_libunwind,jrmuizel/libunwind,tkelman/libunwind,tony/libunwind,atanasyan/libunwind-android,fillexen/libunwind,Chilledheart/libunwind,unkadoug/libunwind,dropbox/libunwind,androidarmv6/android_external_libunwind,maltek/platform_external_libunwind,Keno/libunwind,zeldin/platform_external_libunwind,android-ia/platform_external_libunwind,dreal-deps/libunwind,atanasyan/libunwind,0xlab/0xdroid-external_libunwind,ehsan/libunwind,lat/libunwind,dropbox/libunwind,Chilledheart/libunwind,adsharma/libunwind,adsharma/libunwind,CyanogenMod/android_external_libunwind,vtjnash/libunwind,tkelman/libunwind,tony/libunwind,libunwind/libunwind,zliu2014/libunwind-tilegx,bo-on-software/libunwind,rantala/libunwind,SyndicateRogue/libunwind,dagar/libunwind,lat/libunwind |
|
b8c623d9a4331c20dd28220868bdc6d98b2bd4c4 | examples/parsebuf.c | examples/parsebuf.c | /* Very simple example for parse buf example */
#include <string.h>
#include <stdlib.h>
#include "confuse.h"
int main(void)
{
cfg_t *cfg;
cfg_opt_t arg_opts[] = {
CFG_STR("value", "default", CFGF_NONE),
CFG_END()
};
cfg_opt_t opts[] = {
CFG_INT("delay", 3, CFGF_NONE),
CFG_STR("message", "This is a message", CFGF_NONE),
CFG_SEC("argument", arg_opts, CFGF_MULTI | CFGF_TITLE),
CFG_END()
};
char *buf =
" delay = 3\n"
"# message = 'asdfasfasfd tersf'\n"
" argument one { value = bar }\n"
" argument two { value=foo}\n";
cfg = cfg_init(opts, 0);
if (cfg_parse_buf(cfg, buf) != CFG_SUCCESS) {
fprintf(stderr, "Failed parsing configuration: %s\n", strerror(errno));
exit(1);
}
cfg_print(cfg, stdout);
return cfg_free(cfg);
}
| /* Very simple example for parse buf example */
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include "confuse.h"
int main(void)
{
cfg_t *cfg;
cfg_opt_t arg_opts[] = {
CFG_STR("value", "default", CFGF_NONE),
CFG_END()
};
cfg_opt_t opts[] = {
CFG_INT("delay", 3, CFGF_NONE),
CFG_STR("message", "This is a message", CFGF_NONE),
CFG_SEC("argument", arg_opts, CFGF_MULTI | CFGF_TITLE),
CFG_END()
};
char *buf =
" delay = 3\n"
"# message = 'asdfasfasfd tersf'\n"
" argument one { value = bar }\n"
" argument two { value=foo}\n";
cfg = cfg_init(opts, 0);
if (cfg_parse_buf(cfg, buf) != CFG_SUCCESS) {
fprintf(stderr, "Failed parsing configuration: %s\n", strerror(errno));
exit(1);
}
cfg_print(cfg, stdout);
return cfg_free(cfg);
}
| Add missing errno.h include for Linux/UNIX | Add missing errno.h include for Linux/UNIX
Signed-off-by: Joachim Nilsson <[email protected]>
| C | isc | troglobit/libconfuse,westermo/libconfuse,peda-r/libconfuse,martinh/libconfuse,peda-r/libconfuse,troglobit/libconfuse,westermo/libconfuse,martinh/libconfuse |
8323670661ff47298967bca382b360f50f878041 | native-unpacker/kisskiss.h | native-unpacker/kisskiss.h | /*
* kisskiss.h
*
* Tim "diff" Strazzere <[email protected]>
*/
#include <stdlib.h>
#include <stdio.h>
#include <sys/ptrace.h>
#include <dirent.h>
#include <fcntl.h> // open / O_RDONLY
static const char* odex_magic = "dey\n036";
static const char* static_safe_location = "/data/local/tmp/";
static const char* suffix = ".dumped_odex";
typedef struct {
uint32_t start;
uint32_t end;
} memory_region;
uint32_t get_clone_pid(uint32_t service_pid);
uint32_t get_process_pid(const char* target_package_name);
char *determine_filter(uint32_t clone_pid, int memory_fd);
int find_magic_memory(uint32_t clone_pid, int memory_fd, memory_region *memory, char* extra_filter);
int peek_memory(int memory_file, uint32_t address);
int dump_memory(int memory_fd, memory_region *memory, const char* file_name);
int attach_get_memory(uint32_t pid);
| /*
* kisskiss.h
*
* Tim "diff" Strazzere <[email protected]>
*/
#include <stdlib.h>
#include <stdio.h>
#include <sys/ptrace.h>
#include <dirent.h>
#include <fcntl.h> // open / O_RDONLY
#include <unistd.h> // close
#include <errno.h> // perror
#include <string.h> // strlen
static const char* odex_magic = "dey\n036";
static const char* static_safe_location = "/data/local/tmp/";
static const char* suffix = ".dumped_odex";
typedef struct {
uint64_t start;
uint64_t end;
} memory_region;
uint32_t get_clone_pid(uint32_t service_pid);
uint32_t get_process_pid(const char* target_package_name);
char *determine_filter(uint32_t clone_pid, int memory_fd);
int find_magic_memory(uint32_t clone_pid, int memory_fd, memory_region *memory, char* extra_filter);
int peek_memory(int memory_file, uint32_t address);
int dump_memory(int memory_fd, memory_region *memory, const char* file_name);
int attach_get_memory(uint32_t pid);
| Reduce implicit calls, add fix for large memory sections | Reduce implicit calls, add fix for large memory sections
| C | apache-2.0 | strazzere/android-unpacker,strazzere/android-unpacker |
86f56f6d510c533fe570fb6153b6c1f7b4b365a3 | net/spdy/spdy_http_utils.h | net/spdy/spdy_http_utils.h | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_SPDY_SPDY_HTTP_UTILS_H_
#define NET_SPDY_SPDY_HTTP_UTILS_H_
#pragma once
#include "net/spdy/spdy_framer.h"
namespace net {
class HttpResponseInfo;
class HttpRequestInfo;
// Convert a SpdyHeaderBlock into an HttpResponseInfo.
// |headers| input parameter with the SpdyHeaderBlock.
// |info| output parameter for the HttpResponseInfo.
// Returns true if successfully converted. False if there was a failure
// or if the SpdyHeaderBlock was invalid.
bool SpdyHeadersToHttpResponse(const spdy::SpdyHeaderBlock& headers,
HttpResponseInfo* response);
// Create a SpdyHeaderBlock for a Spdy SYN_STREAM Frame from
// a HttpRequestInfo block.
void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info,
spdy::SpdyHeaderBlock* headers,
bool direct);
} // namespace net
#endif // NET_SPDY_SPDY_HTTP_UTILS_H_
| // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_SPDY_SPDY_HTTP_UTILS_H_
#define NET_SPDY_SPDY_HTTP_UTILS_H_
#pragma once
#include "net/spdy/spdy_framer.h"
namespace net {
class HttpResponseInfo;
struct HttpRequestInfo;
// Convert a SpdyHeaderBlock into an HttpResponseInfo.
// |headers| input parameter with the SpdyHeaderBlock.
// |info| output parameter for the HttpResponseInfo.
// Returns true if successfully converted. False if there was a failure
// or if the SpdyHeaderBlock was invalid.
bool SpdyHeadersToHttpResponse(const spdy::SpdyHeaderBlock& headers,
HttpResponseInfo* response);
// Create a SpdyHeaderBlock for a Spdy SYN_STREAM Frame from
// a HttpRequestInfo block.
void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info,
spdy::SpdyHeaderBlock* headers,
bool direct);
} // namespace net
#endif // NET_SPDY_SPDY_HTTP_UTILS_H_
| Change forward declaration of HttpRequestInfo from class to struct to fix build breakage. | Change forward declaration of HttpRequestInfo from class to struct to
fix build breakage.
BUG=none
TEST=none
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@59584 0039d316-1c4b-4281-b951-d872f2087c98
| C | bsd-3-clause | zcbenz/cefode-chromium,zcbenz/cefode-chromium,anirudhSK/chromium,M4sse/chromium.src,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,keishi/chromium,anirudhSK/chromium,ltilve/chromium,markYoungH/chromium.src,ondra-novak/chromium.src,ChromiumWebApps/chromium,hujiajie/pa-chromium,Pluto-tv/chromium-crosswalk,robclark/chromium,hgl888/chromium-crosswalk-efl,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,dednal/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,keishi/chromium,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,zcbenz/cefode-chromium,robclark/chromium,chuan9/chromium-crosswalk,hujiajie/pa-chromium,robclark/chromium,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,markYoungH/chromium.src,zcbenz/cefode-chromium,Chilledheart/chromium,keishi/chromium,M4sse/chromium.src,ChromiumWebApps/chromium,keishi/chromium,littlstar/chromium.src,crosswalk-project/chromium-crosswalk-efl,rogerwang/chromium,pozdnyakov/chromium-crosswalk,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,ondra-novak/chromium.src,anirudhSK/chromium,Fireblend/chromium-crosswalk,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,mogoweb/chromium-crosswalk,ltilve/chromium,timopulkkinen/BubbleFish,ondra-novak/chromium.src,axinging/chromium-crosswalk,dednal/chromium.src,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,timopulkkinen/BubbleFish,dednal/chromium.src,junmin-zhu/chromium-rivertrail,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk,markYoungH/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,hujiajie/pa-chromium,patrickm/chromium.src,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,jaruba/chromium.src,hujiajie/pa-chromium,dednal/chromium.src,chuan9/chromium-crosswalk,keishi/chromium,Just-D/chromium-1,hgl888/chromium-crosswalk-efl,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,M4sse/chromium.src,zcbenz/cefode-chromium,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,junmin-zhu/chromium-rivertrail,mogoweb/chromium-crosswalk,littlstar/chromium.src,dushu1203/chromium.src,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,keishi/chromium,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,ltilve/chromium,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,keishi/chromium,keishi/chromium,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,dednal/chromium.src,hgl888/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,Chilledheart/chromium,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,timopulkkinen/BubbleFish,Just-D/chromium-1,jaruba/chromium.src,littlstar/chromium.src,fujunwei/chromium-crosswalk,ChromiumWebApps/chromium,patrickm/chromium.src,bright-sparks/chromium-spacewalk,bright-sparks/chromium-spacewalk,TheTypoMaster/chromium-crosswalk,ondra-novak/chromium.src,timopulkkinen/BubbleFish,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,ChromiumWebApps/chromium,anirudhSK/chromium,Fireblend/chromium-crosswalk,littlstar/chromium.src,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,rogerwang/chromium,hujiajie/pa-chromium,Just-D/chromium-1,robclark/chromium,Just-D/chromium-1,robclark/chromium,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,junmin-zhu/chromium-rivertrail,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,timopulkkinen/BubbleFish,dednal/chromium.src,Chilledheart/chromium,ChromiumWebApps/chromium,dushu1203/chromium.src,Fireblend/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,zcbenz/cefode-chromium,axinging/chromium-crosswalk,Jonekee/chromium.src,Chilledheart/chromium,hgl888/chromium-crosswalk,nacl-webkit/chrome_deps,anirudhSK/chromium,ChromiumWebApps/chromium,axinging/chromium-crosswalk,robclark/chromium,junmin-zhu/chromium-rivertrail,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,Just-D/chromium-1,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,zcbenz/cefode-chromium,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,robclark/chromium,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,timopulkkinen/BubbleFish,anirudhSK/chromium,M4sse/chromium.src,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,nacl-webkit/chrome_deps,axinging/chromium-crosswalk,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,mogoweb/chromium-crosswalk,Chilledheart/chromium,hujiajie/pa-chromium,Chilledheart/chromium,Jonekee/chromium.src,fujunwei/chromium-crosswalk,mogoweb/chromium-crosswalk,littlstar/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,pozdnyakov/chromium-crosswalk,markYoungH/chromium.src,Just-D/chromium-1,anirudhSK/chromium,axinging/chromium-crosswalk,zcbenz/cefode-chromium,ChromiumWebApps/chromium,ltilve/chromium,ChromiumWebApps/chromium,pozdnyakov/chromium-crosswalk,robclark/chromium,bright-sparks/chromium-spacewalk,ltilve/chromium,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,Jonekee/chromium.src,markYoungH/chromium.src,dednal/chromium.src,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,ondra-novak/chromium.src,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,rogerwang/chromium,robclark/chromium,dednal/chromium.src,nacl-webkit/chrome_deps,axinging/chromium-crosswalk,zcbenz/cefode-chromium,nacl-webkit/chrome_deps,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,littlstar/chromium.src,hujiajie/pa-chromium,anirudhSK/chromium,nacl-webkit/chrome_deps,jaruba/chromium.src,robclark/chromium,pozdnyakov/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,ltilve/chromium,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,keishi/chromium,dednal/chromium.src,ltilve/chromium,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,junmin-zhu/chromium-rivertrail,nacl-webkit/chrome_deps,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,patrickm/chromium.src,hujiajie/pa-chromium,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,ltilve/chromium,dushu1203/chromium.src,junmin-zhu/chromium-rivertrail,mohamed--abdel-maksoud/chromium.src,rogerwang/chromium,littlstar/chromium.src,junmin-zhu/chromium-rivertrail,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,patrickm/chromium.src,ondra-novak/chromium.src,keishi/chromium,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,junmin-zhu/chromium-rivertrail,crosswalk-project/chromium-crosswalk-efl,zcbenz/cefode-chromium,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,Chilledheart/chromium,rogerwang/chromium,mogoweb/chromium-crosswalk,ondra-novak/chromium.src,Just-D/chromium-1,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,fujunwei/chromium-crosswalk,patrickm/chromium.src,dushu1203/chromium.src,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,rogerwang/chromium,ltilve/chromium,jaruba/chromium.src,chuan9/chromium-crosswalk,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,anirudhSK/chromium,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,rogerwang/chromium,junmin-zhu/chromium-rivertrail,keishi/chromium,jaruba/chromium.src,dednal/chromium.src,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,hujiajie/pa-chromium,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,krieger-od/nwjs_chromium.src,dednal/chromium.src,rogerwang/chromium,chuan9/chromium-crosswalk,M4sse/chromium.src,M4sse/chromium.src,M4sse/chromium.src,M4sse/chromium.src,rogerwang/chromium,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,mogoweb/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,pozdnyakov/chromium-crosswalk,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,dushu1203/chromium.src,Chilledheart/chromium,fujunwei/chromium-crosswalk,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,rogerwang/chromium,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,littlstar/chromium.src,Jonekee/chromium.src |
507c3e1f7f594135e33dea40f1221957df129979 | mserv/mp3info.h | mserv/mp3info.h |
#define MP3ID3_TITLELEN NAMELEN
#define MP3ID3_ARTISTLEN AUTHORLEN
#define MP3ID3_ALBUMLEN 30
#define MP3ID3_YEARLEN 4
#define MP3ID3_COMMENTLEN 30
typedef struct {
int present:1;
char title[MP3ID3_TITLELEN+1];
char artist[MP3ID3_ARTISTLEN+1];
char album[MP3ID3_ALBUMLEN+1];
char year[MP3ID3_YEARLEN+1];
char comment[MP3ID3_COMMENTLEN+1];
char genre[31];
} t_id3tag;
int mserv_mp3info_readlen(const char *fname, int *bitrate_ret,
t_id3tag *id3tag);
|
#define MP3ID3_TITLELEN 30
#define MP3ID3_ARTISTLEN 30
#define MP3ID3_ALBUMLEN 30
#define MP3ID3_YEARLEN 4
#define MP3ID3_COMMENTLEN 30
typedef struct {
int present:1;
char title[MP3ID3_TITLELEN+1];
char artist[MP3ID3_ARTISTLEN+1];
char album[MP3ID3_ALBUMLEN+1];
char year[MP3ID3_YEARLEN+1];
char comment[MP3ID3_COMMENTLEN+1];
char genre[31];
} t_id3tag;
int mserv_mp3info_readlen(const char *fname, int *bitrate_ret,
t_id3tag *id3tag);
| Fix mp3 field size constants so that the ID3 information gets parsed correctly. | Fix mp3 field size constants so that the ID3 information gets parsed
correctly.
| C | isc | spigot/mserv,spigot/mserv |
3dd0eb97ff69943b37d92932d0ac7b5b4324bbc8 | source/config_lui.h | source/config_lui.h | // Filename: config_lui.h
// Created by: tobspr (28Aug14)
//
#ifndef CONFIG_LUI_H
#define CONFIG_LUI_H
#include "pandabase.h"
#include "notifyCategoryProxy.h"
#include "dconfig.h"
#define EXPCL_LUI EXPORT_CLASS
#define EXPTP_LUI EXPORT_TEMPL
ConfigureDecl(config_lui, EXPCL_LUI, EXPTP_LUI);
NotifyCategoryDecl(lui, EXPCL_LUI, EXPTP_LUI);
extern EXPCL_LUI void init_lui();
#ifdef INTERROGATE
// Interrogate can't handle this
#define unordered_map pmap
#endif
#endif
| // Filename: config_lui.h
// Created by: tobspr (28Aug14)
//
#ifndef CONFIG_LUI_H
#define CONFIG_LUI_H
#include "pandabase.h"
#include "notifyCategoryProxy.h"
#include "dconfig.h"
#define EXPCL_LUI EXPORT_CLASS
#define EXPTP_LUI EXPORT_TEMPL
ConfigureDecl(config_lui, EXPCL_LUI, EXPTP_LUI);
NotifyCategoryDecl(lui, EXPCL_LUI, EXPTP_LUI);
extern EXPCL_LUI void init_lui();
using namespace std;
#endif
| Fix build with modern Panda headers | Fix build with modern Panda headers
Panda3D now no longer defines `using namespace std;` (see panda3d/panda3d#335) which the LUI code relied on;
Panda3D headers provide unordered_map so the #define is actually preventing that header from being parsed correctly.
| C | mit | tobspr/LUI,tobspr/LUI,tobspr/LUI |
9cdc25c056d3da95035b7ed9c28b78f0c23a2222 | libempathy/empathy-types.h | libempathy/empathy-types.h | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
/*
* Copyright (C) 2008 Collabora Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors: Cosimo Cecchi <[email protected]>
*/
#ifndef __EMPATHY_TYPES_H__
#define __EMPATHY_TYPES_H__
typedef struct _EmpathyContactList EmpathyContactList;
typedef struct _EmpathyContactMonitor EmpathyContactMonitor;
#endif /* __EMPATHY_TYPES_H__ */ | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
/*
* Copyright (C) 2008 Collabora Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors: Cosimo Cecchi <[email protected]>
*/
#ifndef __EMPATHY_TYPES_H__
#define __EMPATHY_TYPES_H__
typedef struct _EmpathyContactList EmpathyContactList;
typedef struct _EmpathyContactMonitor EmpathyContactMonitor;
#endif /* __EMPATHY_TYPES_H__ */
| Add newline at end of file | Add newline at end of file
From: Olivier Crête <[email protected]>
Signed-off-by: Sjoerd Simons <[email protected]>
svn path=/trunk/; revision=2439
| C | lgpl-2.1 | Distrotech/telepathy-account-widgets,GNOME/telepathy-account-widgets,GNOME/telepathy-account-widgets,Distrotech/telepathy-account-widgets,GNOME/telepathy-account-widgets |
950c1f5c6ed2c6b05d5cf2c1162454dccd011296 | phonebook_opt.c | phonebook_opt.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "phonebook_opt.h"
/* FILL YOUR OWN IMPLEMENTATION HERE! */
entry *findName(char lastname[], entry *pHead)
{
while (pHead != NULL) {
if (strcasecmp(lastname, pHead->lastName) == 0)
return pHead;
pHead = pHead->pNext;
}
return NULL;
}
entry *append(char lastName[], entry *e)
{
/* allocate memory for the new entry and put lastName */
e->pNext = (entry *) malloc(sizeof(entry));
e = e->pNext;
strcpy(e->lastName, lastName);
e->pNext = NULL;
return e;
}
| #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include "phonebook_opt.h"
entry *findName(char lastname[], entry *pHead)
{
while (pHead != NULL) {
if (strcasecmp(lastname, pHead->lastName) == 0)
return pHead;
pHead = pHead->pNext;
}
return NULL;
}
entry *append(char lastName[], entry *e)
{
/* check whther entry is null or not */
assert(e != NULL && "[error] entry is null");
/* allocate memory for the new entry and put lastName */
e->pNext = (entry *) malloc(sizeof(entry));
e = e->pNext;
strcpy(e->lastName, lastName);
e->pNext = NULL;
return e;
}
| Delete todo comments and add assert to avoid null entry | Delete todo comments and add assert to avoid null entry
Delete the todo comments before the function findName.
Use assert to avoid the condition of null pointer in the begining of
function append.
| C | bsd-2-clause | zeroplusone/phonebook,zeroplusone/phonebook |
cfb065c8fc4730ea3ea371b2e9def448c5552ca5 | src/core/include/iDynTree/Core/LinearForceVector3.h | src/core/include/iDynTree/Core/LinearForceVector3.h | /*
* Copyright (C) Fondazione Istituto Italiano di Tecnologia
*
* Licensed under either the GNU Lesser General Public License v3.0 :
* https://www.gnu.org/licenses/lgpl-3.0.html
* or the GNU Lesser General Public License v2.1 :
* https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
* at your option.
*/
#ifndef IDYNTREE_LINEAR_FORCE_VECTOR_3_H
#define IDYNTREE_LINEAR_FORCE_VECTOR_3_H
#warning <iDynTree/Core/LinearForceVector3.h> is deprecated. Please use GeomVector3 and <iDynTree/Model/GeomVector3.h>.
#include <iDynTree/Core/GeomVector3.h>
#endif /* IDYNTREE_LINEAR_FORCE_VECTOR_3_H */
| /*
* Copyright (C) Fondazione Istituto Italiano di Tecnologia
*
* Licensed under either the GNU Lesser General Public License v3.0 :
* https://www.gnu.org/licenses/lgpl-3.0.html
* or the GNU Lesser General Public License v2.1 :
* https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
* at your option.
*/
#ifndef IDYNTREE_LINEAR_FORCE_VECTOR_3_H
#define IDYNTREE_LINEAR_FORCE_VECTOR_3_H
#warning <iDynTree/Core/LinearForceVector3.h> is deprecated. Please use GeomVector3 and <iDynTree/Core/GeomVector3.h>.
#include <iDynTree/Core/GeomVector3.h>
#endif /* IDYNTREE_LINEAR_FORCE_VECTOR_3_H */
| Fix typo in deprecation message | Fix typo in deprecation message | C | lgpl-2.1 | robotology/idyntree,robotology/idyntree,robotology/idyntree,robotology/idyntree,robotology/idyntree |
e6d89d26db671755353c06ed6b353af995a03dba | src/C/pyramid_of_numbers.c | src/C/pyramid_of_numbers.c | /* Pyramid of numbers
Exercise #7 from my college
Make a program that's receive a number and print it like a pyramid in descending order.
Example with number 5 inputted. The output must be like that:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
*/
#include <stdio.h>
int main() {
int number;
printf("Type a number: ");
scanf("%d", &number);
for (int i = 1; i <= number; i++) {
for (int j = 1; j <= i; j++) {
printf ("%d ", j);
}
printf ("\n");
}
return 0;
}
| /* Pyramid of numbers
Exercise #7 from my college
Make a program that's receive a number and print it like a pyramid in ascending order.
Example with number 5 inputted. The output must be like that:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
*/
#include <stdio.h>
int main() {
int number;
printf("Type a number: ");
scanf("%d", &number);
for (int i = 1; i <= number; i++) {
for (int j = 1; j <= i; j++) {
printf ("%d ", j);
}
printf ("\n");
}
return 0;
}
| Update pyramid of numbers in C language | Update pyramid of numbers in C language
| C | mit | daltonmenezes/learning-C |
80d912a5fedb401cf2e80584a398238f7f083812 | log.h | log.h | //
// Copyright (c) 2010-2012 Linaro Limited
//
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the MIT License which accompanies
// this distribution, and is available at
// http://www.opensource.org/licenses/mit-license.php
//
// Contributors:
// Alexandros Frantzis <[email protected]>
// Jesse Barker <[email protected]>
//
#ifndef LOG_H_
#define LOG_H_
class Log
{
public:
static void init(bool do_debug = false) { do_debug_ = do_debug; }
// Emit an informational message
static void info(const char *fmt, ...);
// Emit a debugging message
static void debug(const char *fmt, ...);
// Emit an error message
static void error(const char *fmt, ...);
// Explicit flush of the log buffer
static void flush();
// A prefix constant that informs the logging infrastructure that the log
// message is a continuation of a previous log message to be put on the
// same line.
static const std::string continuation_prefix;
// A constant for identifying the log messages as originating from a
// particular application.
static std::string appname;
private:
static bool do_debug_;
};
#endif /* LOG_H_ */
| //
// Copyright (c) 2010-2012 Linaro Limited
//
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the MIT License which accompanies
// this distribution, and is available at
// http://www.opensource.org/licenses/mit-license.php
//
// Contributors:
// Alexandros Frantzis <[email protected]>
// Jesse Barker <[email protected]>
//
#ifndef LOG_H_
#define LOG_H_
#include <string>
class Log
{
public:
static void init(bool do_debug = false) { do_debug_ = do_debug; }
// Emit an informational message
static void info(const char *fmt, ...);
// Emit a debugging message
static void debug(const char *fmt, ...);
// Emit an error message
static void error(const char *fmt, ...);
// Explicit flush of the log buffer
static void flush();
// A prefix constant that informs the logging infrastructure that the log
// message is a continuation of a previous log message to be put on the
// same line.
static const std::string continuation_prefix;
// A constant for identifying the log messages as originating from a
// particular application.
static std::string appname;
private:
static bool do_debug_;
};
#endif /* LOG_H_ */
| Make sure to include string for the definiton of Log. | Make sure to include string for the definiton of Log.
| C | mit | jessebarker/libmatrix,jessebarker/libmatrix |
f8c381fff1a3c10e0f7f0c9f223f08e8d7dce0e3 | include/clang/Lex/ExternalPreprocessorSource.h | include/clang/Lex/ExternalPreprocessorSource.h | //===- ExternalPreprocessorSource.h - Abstract Macro Interface --*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines the ExternalPreprocessorSource interface, which enables
// construction of macro definitions from some external source.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_LEX_EXTERNAL_PREPROCESSOR_SOURCE_H
#define LLVM_CLANG_LEX_EXTERNAL_PREPROCESSOR_SOURCE_H
namespace clang {
/// \brief Abstract interface for external sources of preprocessor
/// information.
///
/// This abstract class allows an external sources (such as the \c PCHReader)
/// to provide additional macro definitions.
class ExternalPreprocessorSource {
public:
virtual ~ExternalPreprocessorSource();
/// \brief Read the set of macros defined by this external macro source.
virtual void ReadDefinedMacros() = 0;
};
}
#endif // LLVM_CLANG_LEX_EXTERNAL_PREPROCESSOR_SOURCE_H | //===- ExternalPreprocessorSource.h - Abstract Macro Interface --*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines the ExternalPreprocessorSource interface, which enables
// construction of macro definitions from some external source.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_LEX_EXTERNAL_PREPROCESSOR_SOURCE_H
#define LLVM_CLANG_LEX_EXTERNAL_PREPROCESSOR_SOURCE_H
namespace clang {
/// \brief Abstract interface for external sources of preprocessor
/// information.
///
/// This abstract class allows an external sources (such as the \c PCHReader)
/// to provide additional macro definitions.
class ExternalPreprocessorSource {
public:
virtual ~ExternalPreprocessorSource();
/// \brief Read the set of macros defined by this external macro source.
virtual void ReadDefinedMacros() = 0;
};
}
#endif // LLVM_CLANG_LEX_EXTERNAL_PREPROCESSOR_SOURCE_H
| Add missing newline (which breaks MSVC build???) | Add missing newline (which breaks MSVC build???)
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@92522 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang |
9c80f5b16d0752e1bc3f49f15b1a146b7345b9ee | Pod/Swift/APAddressBook-Bridging.h | Pod/Swift/APAddressBook-Bridging.h | //
// APAddressBook-Bridging.h
// APAddressBook
//
// Created by Alexey Belkevich on 7/31/14.
// Copyright (c) 2014 alterplay. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "APAddressBook.h"
#import "APContact.h"
#import "APSocialProfile.h"
#import "APAddress.h"
#import "APPhoneWithLabel.h"
| //
// APAddressBook-Bridging.h
// APAddressBook
//
// Created by Alexey Belkevich on 7/31/14.
// Copyright (c) 2014 alterplay. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "APAddressBook.h"
#import "APContact.h"
#import "APSocialProfile.h"
#import "APAddress.h"
#import "APPhoneWithLabel.h"
#import "APEmailWithLabel.h"
| Add APEmailWithLabel.h to the Swift bridging file. | Add APEmailWithLabel.h to the Swift bridging file.
| C | mit | Alterplay/APAddressBook,Alterplay/APAddressBook,felix-dumit/APAddressBook,felix-dumit/APAddressBook |
8ab3b68ef35411be456f26d1fc0dad1ebff87141 | bluetooth/bdroid_buildcfg.h | bluetooth/bdroid_buildcfg.h | /*
* Copyright 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _BDROID_BUILDCFG_H
#define _BDROID_BUILDCFG_H
#define BTA_DISABLE_DELAY 100 /* in milliseconds */
#define BLE_VND_INCLUDED TRUE
#define BTM_BLE_ADV_TX_POWER {-21, -15, -7, 1, 9}
#endif
| /*
* Copyright 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _BDROID_BUILDCFG_H
#define _BDROID_BUILDCFG_H
#define BTA_DISABLE_DELAY 100 /* in milliseconds */
#define BTM_BLE_ADV_TX_POWER {-21, -15, -7, 1, 9}
#endif
| Disable peripheral mode in N5 | Disable peripheral mode in N5
bug 16545864
Change-Id: I2273716fbce151173c067b8441e749c78e17141e | C | apache-2.0 | maruos/android_device_lge_hammerhead,maruos/android_device_lge_hammerhead,maruos/android_device_lge_hammerhead,maruos/android_device_lge_hammerhead |
dd6e3b76a29da1f6979717e65faf652dde20be65 | include/mindbw/Types.h | include/mindbw/Types.h | #ifndef MINDBW_TYPES_H
#define MINDBW_TYPES_H
namespace mindbw
{
enum class Operator
{
LT,
LTE,
GT,
GTE,
EQ,
NEQ,
};
}
#endif
| #ifndef MINDBW_TYPES_H
#define MINDBW_TYPES_H
#include <zephyr/CExport.h>
Z_NS_START(mindbw)
Z_ENUM_CLASS(mindbw, Operator)
{
LT,
LTE,
GT,
GTE,
EQ,
NEQ,
};
Z_NS_END
#endif
| Allow types in C includes | Allow types in C includes
| C | mit | DeonPoncini/mindbw,DeonPoncini/mindbw |
bb71227a64ed0b093e31e0bddab4fa4d4462a0b6 | include/lld/ReaderWriter/YamlContext.h | include/lld/ReaderWriter/YamlContext.h | //===- lld/ReaderWriter/YamlContext.h - object used in YAML I/O context ---===//
//
// The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLD_READER_WRITER_YAML_CONTEXT_H
#define LLD_READER_WRITER_YAML_CONTEXT_H
#include "lld/Core/LLVM.h"
#include <functional>
#include <memory>
#include <vector>
namespace lld {
class File;
class LinkingContext;
namespace mach_o {
namespace normalized {
struct NormalizedFile;
}
}
using lld::mach_o::normalized::NormalizedFile;
/// When YAML I/O is used in lld, the yaml context always holds a YamlContext
/// object. We need to support hetergenous yaml documents which each require
/// different context info. This struct supports all clients.
struct YamlContext {
YamlContext()
: _ctx(nullptr), _registry(nullptr), _file(nullptr),
_normalizeMachOFile(nullptr) {}
const LinkingContext *_ctx;
const Registry *_registry;
File *_file;
NormalizedFile *_normalizeMachOFile;
StringRef _path;
};
} // end namespace lld
#endif // LLD_READER_WRITER_YAML_CONTEXT_H
| //===- lld/ReaderWriter/YamlContext.h - object used in YAML I/O context ---===//
//
// The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLD_READER_WRITER_YAML_CONTEXT_H
#define LLD_READER_WRITER_YAML_CONTEXT_H
#include "lld/Core/LLVM.h"
#include <functional>
#include <memory>
#include <vector>
namespace lld {
class File;
class LinkingContext;
namespace mach_o {
namespace normalized {
struct NormalizedFile;
}
}
using lld::mach_o::normalized::NormalizedFile;
/// When YAML I/O is used in lld, the yaml context always holds a YamlContext
/// object. We need to support hetergenous yaml documents which each require
/// different context info. This struct supports all clients.
struct YamlContext {
const LinkingContext *_ctx = nullptr;
const Registry *_registry = nullptr;
File *_file = nullptr;
NormalizedFile *_normalizeMachOFile = nullptr;
StringRef _path;
};
} // end namespace lld
#endif // LLD_READER_WRITER_YAML_CONTEXT_H
| Use C++11 non-static member initialization. | Use C++11 non-static member initialization.
git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@234648 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/lld,llvm-mirror/lld |
b493f25a14e51fa1648b6b84b2afd18326a561ca | src/bin/e_widget_iconsel.h | src/bin/e_widget_iconsel.h | /*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
#else
#ifndef E_WIDGET_BUTTON_H
#define E_WIDGET_BUTTON_H
EAPI Evas_Object *e_widget_iconsel_add(Evas *evas, Evas_Object *icon, Evas_Coord minw, Evas_Coord minh, void (*func) (void *data, void *data2), void *data, void *data2);
EAPI Evas_Object *e_widget_iconsel_add_from_file(Evas *evas, char *icon, Evas_Coord minw, Evas_Coord minh, void (*func) (void *data, void *data2), void *data, void *data2);
EAPI void e_widget_iconsel_select_callback_add(Evas_Object *obj, void (*func)(Evas_Object *obj, char *file, void *data), void *data);
#endif
#endif
| /*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
#else
#ifndef E_WIDGET_ICONSEL_H
#define E_WIDGET_ICONSEL_H
EAPI Evas_Object *e_widget_iconsel_add(Evas *evas, Evas_Object *icon, Evas_Coord minw, Evas_Coord minh, char **file);
EAPI Evas_Object *e_widget_iconsel_add_from_file(Evas *evas, char *icon, Evas_Coord minw, Evas_Coord minh, char **file);
EAPI void e_widget_iconsel_select_callback_add(Evas_Object *obj, void (*func)(Evas_Object *obj, char *file, void *data), void *data);
#endif
#endif
| Correct define for this file. Fix function declarations. | Correct define for this file.
Fix function declarations.
| C | bsd-2-clause | jordemort/e17,jordemort/e17,jordemort/e17 |
d655d71e6b85f7f07c738dbb1a22d6c29bb0bdbf | src/pwm.h | src/pwm.h | #ifndef PWM_H
#define PWM_H
void PwmInit(uint8_t channel);
void PwmSetPeriod(uint8_t channel, uint32_t frequency);
void PwmSetDuty(uint8_t channel, uint8_t duty);
typedef struct
{
uint32_t frequency;
uint8_t duty;
} PwmOutput;
#endif //PWM_H
| #ifndef PWM_H
#define PWM_H
extern void PwmInit(uint8_t channel);
extern void PwmSetPeriod(uint8_t channel, uint32_t frequency);
extern void PwmSetDuty(uint8_t channel, uint8_t duty);
typedef struct
{
uint32_t frequency;
uint8_t duty;
} PwmOutput;
#endif //PWM_H
| Update prototypes to make them more compliant. | Update prototypes to make them more compliant.
| C | mit | jotux/LaunchLib,jotux/LaunchLib,jotux/LaunchLib |
f5f8876e86a699dc1c43a1369c963916684ec8de | numpy/core/src/common/npy_ctypes.h | numpy/core/src/common/npy_ctypes.h | #ifndef NPY_CTYPES_H
#define NPY_CTYPES_H
#include <Python.h>
#include "npy_import.h"
/*
* Check if a python type is a ctypes class.
*
* Works like the Py<type>_Check functions, returning true if the argument
* looks like a ctypes object.
*
* This entire function is just a wrapper around the Python function of the
* same name.
*/
NPY_INLINE static int
npy_ctypes_check(PyTypeObject *obj)
{
static PyObject *py_func = NULL;
PyObject *ret_obj;
int ret;
npy_cache_import("numpy.core._internal", "npy_ctypes_check", &py_func);
if (py_func == NULL) {
goto fail;
}
ret_obj = PyObject_CallFunctionObjArgs(py_func, (PyObject *)obj, NULL);
if (ret_obj == NULL) {
goto fail;
}
ret = PyObject_IsTrue(ret_obj);
if (ret == -1) {
goto fail;
}
return ret;
fail:
/* If the above fails, then we should just assume that the type is not from
* ctypes
*/
PyErr_Clear();
return 0;
}
#endif
| #ifndef NPY_CTYPES_H
#define NPY_CTYPES_H
#include <Python.h>
#include "npy_import.h"
/*
* Check if a python type is a ctypes class.
*
* Works like the Py<type>_Check functions, returning true if the argument
* looks like a ctypes object.
*
* This entire function is just a wrapper around the Python function of the
* same name.
*/
NPY_INLINE static int
npy_ctypes_check(PyTypeObject *obj)
{
static PyObject *py_func = NULL;
PyObject *ret_obj;
int ret;
npy_cache_import("numpy.core._internal", "npy_ctypes_check", &py_func);
if (py_func == NULL) {
goto fail;
}
ret_obj = PyObject_CallFunctionObjArgs(py_func, (PyObject *)obj, NULL);
if (ret_obj == NULL) {
goto fail;
}
ret = PyObject_IsTrue(ret_obj);
Py_DECREF(ret_obj);
if (ret == -1) {
goto fail;
}
return ret;
fail:
/* If the above fails, then we should just assume that the type is not from
* ctypes
*/
PyErr_Clear();
return 0;
}
#endif
| Add missing decref in ctypes check | BUG: Add missing decref in ctypes check
| C | bsd-3-clause | jorisvandenbossche/numpy,endolith/numpy,numpy/numpy,seberg/numpy,ahaldane/numpy,rgommers/numpy,charris/numpy,jakirkham/numpy,endolith/numpy,mattip/numpy,madphysicist/numpy,madphysicist/numpy,pdebuyl/numpy,jakirkham/numpy,seberg/numpy,rgommers/numpy,jorisvandenbossche/numpy,grlee77/numpy,jakirkham/numpy,WarrenWeckesser/numpy,WarrenWeckesser/numpy,charris/numpy,anntzer/numpy,endolith/numpy,MSeifert04/numpy,mattip/numpy,madphysicist/numpy,MSeifert04/numpy,WarrenWeckesser/numpy,jorisvandenbossche/numpy,rgommers/numpy,pbrod/numpy,charris/numpy,charris/numpy,pizzathief/numpy,madphysicist/numpy,ahaldane/numpy,grlee77/numpy,numpy/numpy,MSeifert04/numpy,abalkin/numpy,pbrod/numpy,madphysicist/numpy,pizzathief/numpy,anntzer/numpy,pbrod/numpy,simongibbons/numpy,rgommers/numpy,WarrenWeckesser/numpy,jorisvandenbossche/numpy,ahaldane/numpy,WarrenWeckesser/numpy,jorisvandenbossche/numpy,pdebuyl/numpy,grlee77/numpy,simongibbons/numpy,mattip/numpy,jakirkham/numpy,abalkin/numpy,abalkin/numpy,ahaldane/numpy,pizzathief/numpy,mhvk/numpy,grlee77/numpy,mhvk/numpy,mhvk/numpy,MSeifert04/numpy,ahaldane/numpy,simongibbons/numpy,mhvk/numpy,seberg/numpy,numpy/numpy,anntzer/numpy,seberg/numpy,numpy/numpy,simongibbons/numpy,grlee77/numpy,mhvk/numpy,pizzathief/numpy,endolith/numpy,simongibbons/numpy,pbrod/numpy,jakirkham/numpy,anntzer/numpy,MSeifert04/numpy,pdebuyl/numpy,pbrod/numpy,pdebuyl/numpy,pizzathief/numpy,mattip/numpy |
c78c827078ec7211971e4d42c7de8c7a0e16fd56 | include/utils/ALDebug.h | include/utils/ALDebug.h | #ifndef ABSTRACT_LEARNING_DEBUG_H
#define ABSTRACT_LEARNING_DEBUG_H
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#define FUNC_PRINT(x) printf(#x"=%d in %s, %d \n",x, __func__, __LINE__);
#define FUNC_PRINT_ALL(x, type) printf(#x"="#type"%"#type" in %s, %d \n",x, __func__, __LINE__);
#define CHECK_POINTER(x) {if(NULL==x){FUNC_PRINT_ALL(x,p);break;}}
#ifdef __cplusplus
extern "C"{
#endif
void al_dump_stack();
#ifdef __cplusplus
}
#endif
//#define ALASSERT(x) assert(x)
#define ALASSERT(x) \
if (!(x)) al_dump_stack();assert(x);
#endif
| #ifndef ABSTRACT_LEARNING_DEBUG_H
#define ABSTRACT_LEARNING_DEBUG_H
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
/*Print method*/
#ifdef BUILD_FOR_ANDROID
#include <android/log.h>
#define ALPRINT(format, ...) __android_log_print(ANDROID_LOG_INFO, "AL", format,##__VA_ARGS__)
#define ALPRINT_FL(format,...) __android_log_print(ANDROID_LOG_INFO, "AL", format", FUNC: %s, LINE: %d \n",##__VA_ARGS__, __func__, __LINE__)
#else
#define ALPRINT(format, ...) printf(format,##__VA_ARGS__)
#define ALPRINT_FL(format,...) printf(format", FUNC: %s, LINE: %d \n", ##__VA_ARGS__,__func__, __LINE__)
#endif
/*Add with line and function*/
#define FUNC_PRINT(x) ALPRINT(#x"=%d in %s, %d \n",(int)(x), __func__, __LINE__);
#define FUNC_PRINT_ALL(x, type) ALPRINT(#x"= "#type" %"#type" in %s, %d \n",x, __func__, __LINE__);
#define CHECK_POINTER(x) {if(NULL==x){FUNC_PRINT_ALL(x,p);break;}}
#ifndef BUILD_FOR_ANDROID
#define ALASSERT(x) \
if (!(x)) al_dump_stack();assert(x);
#else
#define ALASSERT(x) \
{bool ___result = (x);\
if (!(___result))\
FUNC_PRINT((___result));}
#endif
#define CHECK_POINTER(x) {if(NULL==x){FUNC_PRINT_ALL(x,p);break;}}
#ifdef __cplusplus
extern "C"{
#endif
void al_dump_stack();
#ifdef __cplusplus
}
#endif
#endif
| Add debug for android, solve all warning | Add debug for android, solve all warning
| C | apache-2.0 | jxt1234/Abstract_Learning,jxt1234/Abstract_Learning,jxt1234/Abstract_Learning |
9be52ff3eb31ac0c1365f1f6e2a1c54c436a5dca | src/drivers/block_dev/stm32_sd/stm32f4_discovery_sd.h | src/drivers/block_dev/stm32_sd/stm32f4_discovery_sd.h | #ifndef STM32F4_DISCOVERY_SD_H_
#define STM32F4_DISCOVERY_SD_H_
#include <assert.h>
#include "stm32f4xx_hal.h"
#include "stm32f4xx_hal_sd.h"
#include "stm324xg_eval_sd.h"
#include <framework/mod/options.h>
#define STM32_DMA_RX_IRQ OPTION_GET(NUMBER, dma_rx_irq)
static_assert(STM32_DMA_RX_IRQ == DMA2_Stream3_IRQn);
#define STM32_DMA_TX_IRQ OPTION_GET(NUMBER, dma_tx_irq)
static_assert(STM32_DMA_TX_IRQ == DMA2_Stream6_IRQn);
#define STM32_SDMMC_IRQ OPTION_GET(NUMBER, dma_sdmmc_irq)
static_assert(STM32_SDMMC_IRQ == EXTI15_10_IRQn);
#endif /* STM32F4_DISCOVERY_SD_H_ */
| #ifndef STM32F4_DISCOVERY_SD_H_
#define STM32F4_DISCOVERY_SD_H_
#include <assert.h>
#include "stm32f4xx_hal.h"
#include "stm32f4xx_hal_sd.h"
#include "stm324xg_eval_sd.h"
#include <framework/mod/options.h>
#define STM32_DMA_RX_IRQ OPTION_GET(NUMBER, dma_rx_irq)
static_assert(STM32_DMA_RX_IRQ == DMA2_Stream3_IRQn);
#define STM32_DMA_TX_IRQ OPTION_GET(NUMBER, dma_tx_irq)
static_assert(STM32_DMA_TX_IRQ == DMA2_Stream6_IRQn);
#define STM32_SDMMC_IRQ OPTION_GET(NUMBER, dma_sdmmc_irq)
//static_assert(STM32_SDMMC_IRQ == EXTI15_10_IRQn);
#endif /* STM32F4_DISCOVERY_SD_H_ */
| Work on stm32_sd for stm32f4_discovery | drivers: Work on stm32_sd for stm32f4_discovery
| C | bsd-2-clause | embox/embox,embox/embox,embox/embox,embox/embox,embox/embox,embox/embox |
6955060ef131a07b26e6a0af9fd75f225004333a | tests/regression/46-apron2/21-tid-toy-10-exit-othert.c | tests/regression/46-apron2/21-tid-toy-10-exit-othert.c | // SKIP PARAM: --set ana.activated[+] apron --set ana.path_sens[+] threadflag --set ana.activated[+] threadJoins --sets ana.apron.privatization mutex-meet-tid
// Modification of 19 that would fail if pthread_exit was only handled for the top-level thread
#include <pthread.h>
#include <assert.h>
int g = 10;
int h = 10;
pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER;
void cheeky() { pthread_exit(NULL); }
void *t_evil(void *arg) {
pthread_mutex_lock(&A);
g = 8;
h = 20;
pthread_mutex_unlock(&A);
}
void *t_benign(void *arg) {
pthread_t id2;
pthread_create(&id2, NULL, t_evil, NULL);
int top;
if(top) {
// If the analysis does unsoundly not account for pthread_exit called from another function, these writes are lost
cheeky();
}
pthread_join(id2, NULL);
pthread_mutex_lock(&A);
g = 10;
h = 10;
pthread_mutex_unlock(&A);
return NULL;
}
int main(void) {
int t;
// Force multi-threaded handling
pthread_t id2;
pthread_create(&id2, NULL, t_benign, NULL);
pthread_mutex_lock(&A);
g = 10;
h = 10;
pthread_mutex_unlock(&A);
pthread_join(id2, NULL);
pthread_mutex_lock(&A);
assert(g == 10); //UNKNOWN!
pthread_mutex_unlock(&A);
return 0;
}
| Add example that becomes unsound if pthread_exit is only handeled for top-level threads | Add example that becomes unsound if pthread_exit is only handeled for top-level threads
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
0bb9476c8bcf324b65715fd0c971616a7eb77b64 | tests/regression/02-base/33-backwards-loop.c | tests/regression/02-base/33-backwards-loop.c | // PARAM: --sets solver td3
void main(void) {
int x;
int i = 41;
while(i >= 12) {
x = 0;
i--;
}
}
| // PARAM: --sets solver td3
void main(void) {
int x;
int i = 41;
while(i >= 12) {
x = 0;
i--;
}
int y;
int j = -40;
while(-5 >= j) {
y = 0;
j++;
}
}
| Add further problematic example where positive half is excluded | Def_Exc: Add further problematic example where positive half is excluded
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
162ae220b18ff32ee631202567ca85eb69823372 | events/tests/UNITTESTS/doubles/equeue_stub.h | events/tests/UNITTESTS/doubles/equeue_stub.h | /*
* Copyright (c) , Arm Limited and affiliates.
* 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/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __EQUEUE_STUB_H__
#define __EQUEUE_STUB_H__
#include "stdint.h"
#include "stdbool.h"
typedef struct {
void *void_ptr;
bool call_cb_immediately;
} equeue_stub_def;
extern equeue_stub_def equeue_stub;
#endif
| /*
* Copyright (c) , Arm Limited and affiliates.
* 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/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __EQUEUE_STUB_H__
#define __EQUEUE_STUB_H__
#include "stdint.h"
#include "stdbool.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
void *void_ptr;
bool call_cb_immediately;
} equeue_stub_def;
extern equeue_stub_def equeue_stub;
#ifdef __cplusplus
}
#endif
#endif
| Enable use of stub from C++ | equeue: Enable use of stub from C++
Add extern "C" to the equeue_stub declaration to avoid an error when a C
file implements the equeue_stub symbol (as we do in equeue_stub.c).
Undefined symbols for architecture x86_64:
"_equeue_stub", referenced from:
Test_LoRaWANTimer_start_Test::TestBody() in Test_LoRaWANTimer.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
| C | apache-2.0 | mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed |
d73da12174d48ca0d9f5a574542bcace01b0bd6f | mongoc-config.h | mongoc-config.h | /*
* Copyright 2013 MongoDB Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MONGOC_CONFIG_H
#define MONGOC_CONFIG_H
/*
* MONGOC_ENABLE_SSL is set from configure to determine if we are
* compiled with SSL support.
*/
#define MONGOC_ENABLE_SSL 1
#if MONGOC_ENABLE_SSL != 1
# undef MONGOC_ENABLE_SSL
#endif
/*
* MONGOC_ENABLE_SASL is set from configure to determine if we are
* compiled with SASL support.
*/
#define MONGOC_ENABLE_SASL 0
#if MONGOC_ENABLE_SASL != 1
# undef MONGOC_ENABLE_SASL
#endif
/*
* Set dir for mongoc tests
*/
#define BINARY_DIR "../../../__submodules/mongo-c-driver/tests/binary"
#endif /* MONGOC_CONFIG_H */
| /*
* Copyright 2013 MongoDB Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MONGOC_CONFIG_H
#define MONGOC_CONFIG_H
/*
* MONGOC_ENABLE_SSL is set from configure to determine if we are
* compiled with SSL support.
*/
#define MONGOC_ENABLE_SSL 1
#if MONGOC_ENABLE_SSL != 1
# undef MONGOC_ENABLE_SSL
#endif
/*
* MONGOC_ENABLE_SASL is set from configure to determine if we are
* compiled with SASL support.
*/
#define MONGOC_ENABLE_SASL 0
#if MONGOC_ENABLE_SASL != 1
# undef MONGOC_ENABLE_SASL
#endif
/*
* Set dir for mongoc tests
*/
#undef BINARY_DIR
#define BINARY_DIR "../../../__submodules/mongo-c-driver/tests/binary"
#endif /* MONGOC_CONFIG_H */
| Fix warning when BINARY_DIR already defined | Fix warning when BINARY_DIR already defined
| C | mit | alexeyvo/mongo-c-driver-build-headers,Convey-Compliance/mongo-c-driver-build-headers |
c436708c65be210d2ab761a02df2b6c06bd0a85b | test/Lexer/block_cmt_end.c | test/Lexer/block_cmt_end.c | /*
RUN: %clang_cc1 -E -trigraphs %s | grep bar
RUN: %clang_cc1 -E -trigraphs %s | grep foo
RUN: %clang_cc1 -E -trigraphs %s | not grep abc
RUN: %clang_cc1 -E -trigraphs %s | not grep xyz
RUN: %clang_cc1 -fsyntax-only -trigraphs -verify %s
*/
// This is a simple comment, /*/ does not end a comment, the trailing */ does.
int i = /*/ */ 1;
/* abc
next comment ends with normal escaped newline:
*/
/* expected-warning {{escaped newline}} expected-warning {{backslash and newline}} *\
/
int bar /* expected-error {{expected ';' after top level declarator}} */
/* xyz
next comment ends with a trigraph escaped newline: */
/* expected-warning {{escaped newline between}} expected-warning {{backslash and newline separated by space}} expected-warning {{trigraph ends block comment}} *??/
/
foo
// rdar://6060752 - We should not get warnings about trigraphs in comments:
// '????'
/* ???? */
| /*
RUN: %clang_cc1 -E -trigraphs %s | grep bar
RUN: %clang_cc1 -E -trigraphs %s | grep foo
RUN: %clang_cc1 -E -trigraphs %s | not grep qux
RUN: %clang_cc1 -E -trigraphs %s | not grep xyz
RUN: %clang_cc1 -fsyntax-only -trigraphs -verify %s
*/
// This is a simple comment, /*/ does not end a comment, the trailing */ does.
int i = /*/ */ 1;
/* qux
next comment ends with normal escaped newline:
*/
/* expected-warning {{escaped newline}} expected-warning {{backslash and newline}} *\
/
int bar /* expected-error {{expected ';' after top level declarator}} */
/* xyz
next comment ends with a trigraph escaped newline: */
/* expected-warning {{escaped newline between}} expected-warning {{backslash and newline separated by space}} expected-warning {{trigraph ends block comment}} *??/
/
foo
// rdar://6060752 - We should not get warnings about trigraphs in comments:
// '????'
/* ???? */
| Change magic string "abc" to better magic string "qux". | Change magic string "abc" to better magic string "qux".
Wait, what?
So, we run Clang (and LLVM) tests in an environment where the md5sum of the
input files becomes a component of the path. When testing the preprocessor,
the path becomes part of the output (in line directives). In this test, we
were grepping for the absence of "abc" in the output. When the stars aligned
properly, the md5sum component of the path contained "abc" and the test
failed. Oops.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@131147 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang |
1c243b427ec2605a45333ef855f698a21708452f | mojito/client-monitor.h | mojito/client-monitor.h | #include <glib-object.h>
void client_monitor_add (char *sender, GObject *object);
void client_monitor_remove (char *sender, GObject *object);
| #include <glib-object.h>
#include <dbus/dbus-glib.h>
void client_monitor_init (DBusGConnection *connection);
void client_monitor_add (char *sender, GObject *object);
void client_monitor_remove (char *sender, GObject *object);
| Add client_monitor_init to the header | Add client_monitor_init to the header
| C | lgpl-2.1 | GNOME/libsocialweb,lcp/mojito,lcp/mojito,ThomasBollmeier/libsocialweb-flickr-oauth,lcp/mojito,lcp/libsocialweb,GNOME/libsocialweb,lcp/libsocialweb,ThomasBollmeier/libsocialweb-flickr-oauth,GNOME/libsocialweb,ThomasBollmeier/libsocialweb-flickr-oauth,lcp/libsocialweb |
4c8a566280ea16396f660ac75f30f20e515c4a18 | test/native/float/common.h | test/native/float/common.h | #include "../../../src/math/reinterpret.h"
#include <stdint.h>
#include <float.h>
#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
static inline _Bool approx(double x, double y)
{
const uint64_t mask = (1L << (DBL_MANT_DIG - FLT_MANT_DIG)) - 1;
uint64_t a = reinterpret(uint64_t, x);
uint64_t b = reinterpret(uint64_t, y);
return a - b + mask <= 2 * mask;
}
static inline _Bool approxf(float x, float y)
{
uint32_t a = reinterpret(uint32_t, x);
uint32_t b = reinterpret(uint32_t, y);
return a - b + 1 <= 2;
}
static inline _Bool identical(float x, float y)
{
return reinterpret(uint32_t, x) == reinterpret(uint32_t, y);
}
#define verify(cond, x) if (!(cond)) { \
float y = x; \
fprintf(stderr, "Assertion `"#cond"' failed at %g (%#"PRIx32")\n", y, reinterpret(uint32_t, y)); \
abort(); \
}
/* vim: set ft=c: */
| #include "../../../src/math/reinterpret.h"
#include <stdint.h>
#include <float.h>
#include <inttypes.h>
#include <stdio.h>
static inline _Bool approx(double x, double y)
{
const uint64_t mask = (1L << (DBL_MANT_DIG - FLT_MANT_DIG)) - 1;
uint64_t a = reinterpret(uint64_t, x);
uint64_t b = reinterpret(uint64_t, y);
return a - b + mask <= 2 * mask;
}
static inline _Bool approxf(float x, float y)
{
uint32_t a = reinterpret(uint32_t, x);
uint32_t b = reinterpret(uint32_t, y);
return a - b + 1 <= 2;
}
double cimag(double _Complex);
static inline _Bool capprox(double _Complex x, double _Complex y)
{
return approx(x, y) && approx(cimag(x), cimag(y));
}
static inline _Bool identical(float x, float y)
{
return reinterpret(uint32_t, x) == reinterpret(uint32_t, y);
}
_Noreturn void abort(void);
#define verify(cond, x) if (!(cond)) { \
float y = x; \
fprintf(stderr, "Assertion `"#cond"' failed at %g (%#"PRIx32")\n", y, reinterpret(uint32_t, y)); \
abort(); \
}
/* vim: set ft=c: */
| Test helper for complex functions | Test helper for complex functions
| C | mit | jdh8/metallic,jdh8/metallic,jdh8/metallic,jdh8/metallic,jdh8/metallic |
c458a1c32a0bfcb1ac77cb38a648efdc1e0696ad | include/response.h | include/response.h | #ifndef CPR_RESPONSE_H
#define CPR_RESPONSE_H
#include <string>
#include "cookies.h"
#include "cprtypes.h"
#include "defines.h"
#include "error.h"
namespace cpr {
class Response {
public:
Response() = default;
template <typename TextType, typename HeaderType, typename UrlType, typename CookiesType, typename ErrorType>
Response(const long& p_status_code, TextType&& p_text, HeaderType&& p_header, UrlType&& p_url,
const double& p_elapsed, ErrorType&& p_error = Error{}, CookiesType&& p_cookies = Cookies{})
: status_code{p_status_code}, text{CPR_FWD(p_text)}, header{CPR_FWD(p_header)},
url{CPR_FWD(p_url)}, elapsed{p_elapsed}, cookies{CPR_FWD(p_cookies)}, error{CPR_FWD(p_error)} {}
long status_code;
std::string text;
Header header;
Url url;
double elapsed;
Cookies cookies;
//error conditions
Error error;
};
} // namespace cpr
#endif
| #ifndef CPR_RESPONSE_H
#define CPR_RESPONSE_H
#include <string>
#include "cookies.h"
#include "cprtypes.h"
#include "defines.h"
#include "error.h"
namespace cpr {
class Response {
public:
Response() = default;
template <typename TextType, typename HeaderType, typename UrlType, typename CookiesType, typename ErrorType>
Response(const long& p_status_code, TextType&& p_text, HeaderType&& p_header, UrlType&& p_url,
const double& p_elapsed, ErrorType&& p_error = Error{}, CookiesType&& p_cookies = Cookies{})
: status_code{p_status_code}, text{CPR_FWD(p_text)}, header{CPR_FWD(p_header)},
url{CPR_FWD(p_url)}, elapsed{p_elapsed}, cookies{CPR_FWD(p_cookies)}, error{CPR_FWD(p_error)} {}
long status_code;
std::string text;
Header header;
Url url;
double elapsed;
Cookies cookies;
Error error;
};
} // namespace cpr
#endif
| Remove explanatory comment as it should be obvious what the member is | Remove explanatory comment as it should be obvious what the member is
| C | mit | SuperV1234/cpr,SuperV1234/cpr,whoshuu/cpr,msuvajac/cpr,whoshuu/cpr,whoshuu/cpr,SuperV1234/cpr,msuvajac/cpr,msuvajac/cpr |
d152f432634b2a8fe378f24e8ffb05b6599881ec | scanner/scanner.h | scanner/scanner.h | #ifndef SCANNER_H
#define SCANNER_H
#include <QString>
#include <QChar>
#include <QVector>
#include "token.h"
/**
* @class Scanner
* @brief Class representing a scanner (lexical analyzer). It takes a file path as input and generates tokens, either lazily or as a QVector.
*/
class Scanner
{
public:
Scanner(const QString& sourcePath);
/**
* @brief Read until a token is parsed, add it to the vector of tokens and return the last one (by value).
* @return the newest token.
*/
Token nextToken();
private:
QChar peek() const;
QChar next();
QString fileContent;
QVector<Token> tokens;
int currentChar = 0;
int currentLine = 0;
int currentRow = 0;
};
#endif // SCANNER_H
| #ifndef SCANNER_H
#define SCANNER_H
#include <QString>
#include <QChar>
#include <QVector>
#include "token.h"
/**
* @class Scanner
* @brief Class representing a scanner (lexical analyzer). It takes a file path as input and generates tokens, either lazily or as a QVector.
*/
class Scanner
{
public:
Scanner(const QString& sourcePath);
/**
* @brief Read until a token is parsed, add it to the vector of tokens and return the last one (by value).
* @return the newest token.
*/
Token nextToken();
private:
QChar peek() const;
QChar next();
QString fileContent;
QVector<Token> tokens;
int currentChar = 0;
int currentLine = 1;
int currentRow = 1;
};
#endif // SCANNER_H
| Set default line and row to 1 | Set default line and row to 1
| C | mit | bisthebis/Boboscript,bisthebis/Boboscript |
5c457b95ac29e548f50e0c36287016454d8ac076 | pset2/Hacker/initials.c | pset2/Hacker/initials.c | /****************************************************************************
* initials.c
*
* Computer Science 50
* Problem Set 2 - Hacker Edition
*
* Return uppercase initials of name provided.
***************************************************************************/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
int main(void)
{
// get name from user
printf("Enter name: ");
char* name = malloc(128*sizeof(char));
fgets (name, 128, stdin);
printf("%c", toupper(name[0]));
for (int i = 1; i < strlen(name); i++)
{
if (name[i] == ' ')
{
while (name[i] == ' ')
i++;
printf("%c", toupper(name[i]));
}
}
printf("\n");
}
| /****************************************************************************
* initials.c
*
* Computer Science 50
* Problem Set 2 - Hacker Edition
*
* Return uppercase initials of name provided.
***************************************************************************/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
int main(void)
{
// get name from user
printf("Enter name: ");
char* name = malloc(128*sizeof(char));
fgets (name, 128, stdin);
printf("%c", toupper(name[0]));
for (int i = 1, n = strlen(name); i < n; i++)
{
if (name[i] == ' ')
{
while (name[i] == ' ')
i++;
printf("%c", toupper(name[i]));
}
}
printf("\n");
}
| Optimize pset2 hacker edition slightly. | Optimize pset2 hacker edition slightly.
| C | mit | leeorb321/CS50,leeorb321/CS50,leeorb321/CS50,leeorb321/CS50,leeorb321/CS50 |
41c4603134c88859218d56a3680f45dfaa02b80a | src/C++/helpers.h | src/C++/helpers.h | #include <iostream>
using std::cout;
using std::cin;
using std::endl;
string get_device_id() {
cout << concol::RED << "Enumerating devices" << concol::RESET << endl;
int numDevices = get_numDevices();
cout << concol::RED << numDevices << " APS device" << (numDevices > 1 ? "s": "") << " found" << concol::RESET << endl;
if (numDevices < 1)
return 0;
cout << concol::RED << "Attempting to get serials" << concol::RESET << endl;
const char ** serialBuffer = new const char*[numDevices];
get_deviceSerials(serialBuffer);
for (int cnt=0; cnt < numDevices; cnt++) {
cout << concol::RED << "Device " << cnt << " serial #: " << serialBuffer[cnt] << concol::RESET << endl;
}
string deviceSerial;
if (numDevices == 1) {
deviceSerial = string(serialBuffer[0]);
}
else {
cout << "Choose device ID [0]: ";
string input = "";
getline(cin, input);
int device_id = 0;
if (input.length() != 0) {
std::stringstream mystream(input);
mystream >> device_id;
}
deviceSerial = string(serialBuffer[device_id]);
}
delete[] serialBuffer;
return deviceSerial;
} | #include <iostream>
#include <sstream>
#include "concol.h"
using std::cout;
using std::cin;
using std::endl;
using std::string;
string get_device_id() {
cout << concol::RED << "Enumerating devices" << concol::RESET << endl;
int numDevices = get_numDevices();
cout << concol::RED << numDevices << " APS device" << (numDevices > 1 ? "s": "") << " found" << concol::RESET << endl;
if (numDevices < 1)
return 0;
cout << concol::RED << "Attempting to get serials" << concol::RESET << endl;
const char ** serialBuffer = new const char*[numDevices];
get_deviceSerials(serialBuffer);
for (int cnt=0; cnt < numDevices; cnt++) {
cout << concol::RED << "Device " << cnt << " serial #: " << serialBuffer[cnt] << concol::RESET << endl;
}
string deviceSerial;
if (numDevices == 1) {
deviceSerial = string(serialBuffer[0]);
}
else {
cout << "Choose device ID [0]: ";
string input = "";
getline(cin, input);
int device_id = 0;
if (input.length() != 0) {
std::stringstream mystream(input);
mystream >> device_id;
}
deviceSerial = string(serialBuffer[device_id]);
}
delete[] serialBuffer;
return deviceSerial;
} | Add necessary include to get_device_id helper | Add necessary include to get_device_id helper
| C | apache-2.0 | BBN-Q/libaps2,BBN-Q/libaps2,BBN-Q/libaps2,BBN-Q/libaps2,BBN-Q/libaps2 |
164434b5d164cd992ea85536ce4f073eb8f60ca5 | IoTally/PachubeAppCredentials-Dev.h | IoTally/PachubeAppCredentials-Dev.h | //
// PachubeAppCredentials.h
// IoTally
//
// Created by Levent Ali on 09/02/2012.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#define kPBoAuthAppId @"e03db05a9cb717769d41"
#define kPBoAuthAppSecret @"VYeiGP-4aLsQbm9Ywu7VKJJzSVRBvTeuyyGN2UyQsWestpcc"
#define kPBoauthRedirectURI @"https://appdev.loc/?levent=oauth"
#define kPBsiteEndpoint @"https://appdev.loc"
#define kPBapiEndpoint @"https://api.appdev.loc/v2"
| Add dev home vm creds | Add dev home vm creds
| C | mit | levent/IoTally |
|
92843c3f7aa8cc483c5c2271489197c376d95d6f | src/Stdafx.h | src/Stdafx.h | #pragma once
#include <future>
#include <list>
#include <map>
#include <set>
#include <Shlwapi.h>
#include "../lib/foobar2000_sdk/foobar2000/SDK/foobar2000.h"
#include "../lib/tinyxml2/tinyxml2.h"
#define PLUGIN_NAME "WPL Playlist support"
#define PLUGIN_VERSION "1.0.2"
#define CONSOLE_HEADER "foo_wpl: " | #pragma once
#include <future>
#include <list>
#include <map>
#include <set>
#include <Shlwapi.h>
#include "../lib/foobar2000_sdk/foobar2000/SDK/foobar2000.h"
#include "../lib/tinyxml2/tinyxml2.h"
#define PLUGIN_NAME "WPL Playlist support"
#define PLUGIN_VERSION "1.1"
#define CONSOLE_HEADER "foo_wpl: " | Update plugin version to 1.1 | Update plugin version to 1.1
| C | bsd-3-clause | UrbanCMC/foo_wpl |
618aa06fa17c1aed3cce18218c41b2c7e517c935 | src/pyfont.h | src/pyfont.h | #ifndef PYFONT_H
#define PYFONT_H
#include <stdint.h>
#include <stddef.h>
struct PyFont
{
PyFont(uint8_t chars, uint8_t baseChar, const uint8_t* data, const uint16_t* offsets, const uint8_t* sizes):
chars(chars), baseChar(baseChar), data(data), offsets(offsets), sizes(sizes) {}
uint8_t chars;
uint8_t baseChar;
const uint8_t* data;
const uint16_t* offsets;
const uint8_t* sizes;
uint8_t getCharSize(char ch) const
{
uint16_t o = ((uint8_t)ch)-baseChar;
return sizes[o];
}
const uint8_t* getCharData(char ch) const
{
uint16_t o = ((uint8_t)ch)-baseChar;
return data + offsets[o];
}
};
int renderText(const PyFont& f, const char* text, uint8_t* output, int maxSize);
size_t calculateRenderedLength(const PyFont& f, const char* text);
#endif //PYFONT_H
| #ifndef PYFONT_H
#define PYFONT_H
#include <stdint.h>
#include <stddef.h>
struct PyFont
{
PyFont(uint8_t chars, uint8_t baseChar, const uint8_t* data, const uint16_t* offsets, const uint8_t* sizes):
chars(chars), baseChar(baseChar), data(data), offsets(offsets), sizes(sizes) {}
uint8_t chars;
uint8_t baseChar;
const uint8_t* data;
const uint16_t* offsets;
const uint8_t* sizes;
uint8_t getCharSize(char ch) const
{
if ((ch < baseChar) || (ch > (chars + baseChar)))
ch = baseChar;
uint16_t o = ((uint8_t)ch)-baseChar;
return sizes[o];
}
const uint8_t* getCharData(char ch) const
{
if ((ch < baseChar) || (ch > (chars + baseChar)))
ch = baseChar;
uint16_t o = ((uint8_t)ch)-baseChar;
return data + offsets[o];
}
};
int renderText(const PyFont& f, const char* text, uint8_t* output, int maxSize);
size_t calculateRenderedLength(const PyFont& f, const char* text);
#endif //PYFONT_H
| Fix for newlines and other non-printable chars in renderer | Fix for newlines and other non-printable chars in renderer
| C | mit | bartoszbielawski/InfoClock,bartoszbielawski/InfoClock |
589a9d66803e323c66ef78ebf499cc49a6b65fe7 | Source/World/Block/BlockDatabase.h | Source/World/Block/BlockDatabase.h | #ifndef BlockDatabase_H_INCLUDED
#define BlockDatabase_H_INCLUDED
#include <memory>
#include <array>
#include "Types/BlockType.h"
#include "BlockID.h"
#include "../../Texture/Texture_Atlas.h"
namespace Block
{
class Database
{
public:
static Database& get();
Database();
const BlockType& getBlock(uint8_t id) const;
const BlockType& getBlock(ID blockID) const;
const Texture::Atlas& getTextureAtlas() const;
private:
std::array<std::unique_ptr<BlockType>, (int)ID::NUM_BlockTypeS> m_blocks;
Texture::Atlas m_textures;
};
const BlockType& get(uint8_t id);
const BlockType& get(ID blockID);
}
#endif // BlockDatabase_H_INCLUDED
| #ifndef BlockDatabase_H_INCLUDED
#define BlockDatabase_H_INCLUDED
#include <memory>
#include <array>
#include "Types/BlockType.h"
#include "BlockID.h"
#include "../../Texture/Texture_Atlas.h"
namespace Block
{
class Database
{
public:
static Database& get();
const BlockType& getBlock(uint8_t id) const;
const BlockType& getBlock(ID blockID) const;
const Texture::Atlas& getTextureAtlas() const;
private:
Database();
std::array<std::unique_ptr<BlockType>, (int)ID::NUM_BlockTypeS> m_blocks;
Texture::Atlas m_textures;
};
const BlockType& get(uint8_t id);
const BlockType& get(ID blockID);
}
#endif // BlockDatabase_H_INCLUDED
| Fix the block database singleton | Fix the block database singleton
| C | mit | Hopson97/HopsonCraft,Hopson97/HopsonCraft |
2ca0a974b6a0dec32f8827757d844a45d8077be2 | mudlib/mud/home/Text/sys/verb/ooc/wiz/object/frename.c | mudlib/mud/home/Text/sys/verb/ooc/wiz/object/frename.c | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2012 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <kotaka/paths.h>
#include <text/paths.h>
inherit LIB_RAWVERB;
atomic private void do_folder_rename(string old, string new)
{
mapping map;
string *names;
int *keys;
int sz, i;
map = CATALOGD->list_directory(old);
names = map_indices(map);
keys = map_values(map);
sz = sizeof(names);
for (i = 0; i < sz; i++) {
string name;
name = names[i];
switch(keys[i]) {
case 1: /* object */
CATALOGD->lookup_object(old + ":" + name)->set_object_name(new + ":" + name);
break;
case 2:
do_folder_rename(old + ":" + name, new + ":" + name);
}
}
}
void main(object actor, string args)
{
string old, new;
object user;
user = query_user();
if (user->query_class() < 2) {
send_out("You do not have sufficient access rights to rename catalog folders.\n");
return;
}
if (sscanf(args, "%s %s", old, new) != 2) {
send_out("Usage: frename old_folder new_folder\n");
return;
}
switch (CATALOGD->test_name(old)) {
case -2: send_out(old + " has an object in it.\n"); return;
case -1: send_out(old + " does not exist somewhere.\n"); return;
case 0: send_out(old + " does not exist.\n"); return;
case 1: send_out(old + " is an object.\n"); return;
}
switch (CATALOGD->test_name(new)) {
case -2: send_out(new + " has an object in it.\n"); return;
case 2: send_out(new + " already exists.\n"); return;
case 1: send_out(new + " is an object.\n"); return;
}
do_folder_rename(old, new);
}
| Add catalog folder rename command | Add catalog folder rename command
| C | agpl-3.0 | shentino/kotaka,shentino/kotaka,shentino/kotaka |
|
56bde90e1ebe943fe005585662f93f6d65460bdd | src/lib/hex-dec.c | src/lib/hex-dec.c | /* Copyright (c) 2005-2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "hex-dec.h"
void dec2hex(unsigned char *hexstr, uintmax_t dec, unsigned int hexstr_size)
{
unsigned int i;
for (i = 0; i < hexstr_size; i++) {
unsigned int value = dec & 0x0f;
if (value < 10)
hexstr[hexstr_size-i-1] = value + '0';
else
hexstr[hexstr_size-i-1] = value - 10 + 'A';
dec >>= 4;
}
}
uintmax_t hex2dec(const unsigned char *data, unsigned int len)
{
unsigned int i;
uintmax_t value = 0;
for (i = 0; i < len; i++) {
value = value*0x10;
if (data[i] >= '0' && data[i] <= '9')
value += data[i]-'0';
else if (data[i] >= 'A' && data[i] <= 'F')
value += data[i]-'A' + 10;
else
return 0;
}
return value;
}
| /* Copyright (c) 2005-2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "hex-dec.h"
void dec2hex(unsigned char *hexstr, uintmax_t dec, unsigned int hexstr_size)
{
unsigned int i;
for (i = 0; i < hexstr_size; i++) {
unsigned int value = dec & 0x0f;
if (value < 10)
hexstr[hexstr_size-i-1] = value + '0';
else
hexstr[hexstr_size-i-1] = value - 10 + 'A';
dec >>= 4;
}
}
uintmax_t hex2dec(const unsigned char *data, unsigned int len)
{
unsigned int i;
uintmax_t value = 0;
for (i = 0; i < len; i++) {
value = value*0x10;
if (data[i] >= '0' && data[i] <= '9')
value += data[i]-'0';
else if (data[i] >= 'A' && data[i] <= 'F')
value += data[i]-'A' + 10;
else if (data[i] >= 'a' && data[i] <= 'f')
value += data[i]-'a' + 10;
else
return 0;
}
return value;
}
| Allow data to contain also lowercase hex characters. | hex2dec(): Allow data to contain also lowercase hex characters.
| C | mit | jkerihuel/dovecot,jkerihuel/dovecot,jkerihuel/dovecot,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jkerihuel/dovecot,jkerihuel/dovecot,jwm/dovecot-notmuch |
3011d09c458f1f62ec95bd027344c579c54561e2 | exercises/004-ethernet-leds.c | exercises/004-ethernet-leds.c | #include <inc/hw_types.h>
#include <driverlib/sysctl.h>
#include <stdio.h>
#include <string.h>
#include <inc/hw_memmap.h>
#include <inc/hw_sysctl.h>
#include <driverlib/gpio.h>
#include <driverlib/debug.h>
#define DEFAULT_STRENGTH GPIO_STRENGTH_2MA
#define DEFAULT_PULL_TYPE GPIO_PIN_TYPE_STD_WPU
#define PORT_E GPIO_PORTE_BASE
#define PORT_F GPIO_PORTF_BASE
#define PIN_0 GPIO_PIN_0
#define PIN_1 GPIO_PIN_1
#define PIN_2 GPIO_PIN_2
#define PIN_3 GPIO_PIN_3
#define HIGH 0xFF
#define LOW 0x00
int btnAPressed, btnBPressed = 0;
void setup() {
SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
GPIOPinTypeGPIOInput(PORT_E, PIN_0 | PIN_1 | PIN_2 | PIN_3);
GPIOPadConfigSet(PORT_E, PIN_0 | PIN_1 | PIN_2 | PIN_3, DEFAULT_STRENGTH, DEFAULT_PULL_TYPE);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeGPIOOutput(PORT_F, PIN_0 | PIN_1 | PIN_2 | PIN_3);
GPIOPadConfigSet(PORT_F, PIN_0 | PIN_1 | PIN_2 | PIN_3, DEFAULT_STRENGTH, DEFAULT_PULL_TYPE);
}
int main(){
setup();
while (1) {
btnAPressed = (GPIOPinRead(PORT_E, PIN_0) & 0x01) != 0x01;
btnBPressed = (GPIOPinRead(PORT_E, PIN_1) & 0x02) != 0x02;
if (btnAPressed)
GPIOPinWrite(PORT_F, PIN_2, LOW);
else
GPIOPinWrite(PORT_F, PIN_2, HIGH);
if (btnBPressed)
GPIOPinWrite(PORT_F, PIN_3, LOW);
else
GPIOPinWrite(PORT_F, PIN_3, HIGH);
}
}
| Add example with ethernet leds | feature: Add example with ethernet leds | C | mit | marceloboeira/unisinos-microprocessors |
|
99cbd5c8b2c4c6bdac752da4ec96249ad5165701 | mama/c_cpp/src/c/bridge/qpid/io.h | mama/c_cpp/src/c/bridge/qpid/io.h | /* $Id$
*
* OpenMAMA: The open middleware agnostic messaging API
* Copyright (C) 2011 NYSE Technologies, 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 Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef MAMA_BRIDGE_QPID_IO_H__
#define MAMA_BRIDGE_QPID_IO_H__
/*=========================================================================
= Includes =
=========================================================================*/
#if defined(__cplusplus)
extern "C" {
#endif
/*=========================================================================
= Public implementation functions =
=========================================================================*/
mama_status
qpidBridgeMamaIoImpl_start (void);
mama_status
qpidBridgeMamaIoImpl_stop (void);
#if defined(__cplusplus)
}
#endif
#endif /* MAMA_BRIDGE_QPID_IO_H__ */
| /* $Id$
*
* OpenMAMA: The open middleware agnostic messaging API
* Copyright (C) 2011 NYSE Technologies, 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 Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef MAMA_BRIDGE_QPID_IO_H__
#define MAMA_BRIDGE_QPID_IO_H__
/*=========================================================================
= Includes =
=========================================================================*/
#if defined(__cplusplus)
extern "C" {
#endif
#include <mama/mama.h>
/*=========================================================================
= Public implementation functions =
=========================================================================*/
mama_status
qpidBridgeMamaIoImpl_start (void);
mama_status
qpidBridgeMamaIoImpl_stop (void);
#if defined(__cplusplus)
}
#endif
#endif /* MAMA_BRIDGE_QPID_IO_H__ */
| Fix IO header include issue | QPID: Fix IO header include issue
Resolves an issue with QPID io.h, which should include
mama/mama.h. Lack of include can cause issues with some
build systems.
Signed-off-by: Damian Maguire <[email protected]>
| C | lgpl-2.1 | cloudsmith-io/openmama,cloudsmith-io/openmama,MattMulhern/OpenMamaCassandra,cloudsmith-io/openmama,philippreston/OpenMAMA,dmaguire/OpenMAMA,vulcanft/openmama,dmaguire/OpenMAMA,vulcanft/openmama,vulcanft/openmama,dmaguire/OpenMAMA,jacobraj/MAMA,MattMulhern/OpenMAMA,dpauls/OpenMAMA,vulcanft/openmama,philippreston/OpenMAMA,MattMulhern/OpenMAMA,philippreston/OpenMAMA,dpauls/OpenMAMA,fquinner/OpenMAMA,dmagOM/OpenMAMA-dynamic,dpauls/OpenMAMA,dpauls/OpenMAMA,kuangtu/OpenMAMA,dmaguire/OpenMAMA,vulcanft/openmama,kuangtu/OpenMAMA,dmagOM/OpenMAMA-dynamic,dmaguire/OpenMAMA,philippreston/OpenMAMA,dmagOM/OpenMAMA-dynamic,kuangtu/OpenMAMA,jacobraj/MAMA,MattMulhern/OpenMAMA,dmagOM/OpenMAMA-dynamic,MattMulhern/OpenMAMA,cloudsmith-io/openmama,MattMulhern/OpenMamaCassandra,fquinner/OpenMAMA,fquinner/OpenMAMA,fquinner/OpenMAMA,vulcanft/openmama,MattMulhern/OpenMAMA,fquinner/OpenMAMA,philippreston/OpenMAMA,jacobraj/MAMA,cloudsmith-io/openmama,kuangtu/OpenMAMA,dmagOM/OpenMAMA-dynamic,fquinner/OpenMAMA,kuangtu/OpenMAMA,jacobraj/MAMA,dpauls/OpenMAMA,jacobraj/MAMA,dmaguire/OpenMAMA,MattMulhern/OpenMAMA,vulcanft/openmama,cloudsmith-io/openmama,MattMulhern/OpenMamaCassandra,MattMulhern/OpenMamaCassandra,dmagOM/OpenMAMA-dynamic,jacobraj/MAMA,cloudsmith-io/openmama,philippreston/OpenMAMA,MattMulhern/OpenMamaCassandra,kuangtu/OpenMAMA,dpauls/OpenMAMA,dpauls/OpenMAMA,kuangtu/OpenMAMA,MattMulhern/OpenMAMA,dmaguire/OpenMAMA,philippreston/OpenMAMA,MattMulhern/OpenMamaCassandra,fquinner/OpenMAMA |
f4c443646d35cad3a4b8cd83bd9ddf3cbf852c09 | histogram/histogram.pencil.c | histogram/histogram.pencil.c | #include "histogram.pencil.h"
#include <pencil.h>
static void calcHist( const int rows
, const int cols
, const int step
, const unsigned char image[static const restrict rows][step]
, int hist[static const restrict HISTOGRAM_BINS] //out
)
{
#pragma scop
__pencil_assume(rows > 0);
__pencil_assume(cols > 0);
__pencil_assume(step >= cols);
__pencil_kill(hist);
#pragma pencil independent
for(int b = 0; b < HISTOGRAM_BINS; ++b)
hist[b] = 0;
#pragma pencil independent reduction(+:hist)
for(int r = 0; r < rows; ++r)
{
#pragma pencil independent reduction(+:hist)
for(int c = 0; c < cols; ++c)
{
unsigned char pixel = image[r][c];
++hist[pixel];
}
}
#pragma endscop
}
void pencil_calcHist( const int rows, const int cols, const int step, const unsigned char image[], int hist[HISTOGRAM_BINS])
{
calcHist( rows, cols, step, (const unsigned char(*)[step])image, hist);
}
| #include "histogram.pencil.h"
#include <pencil.h>
void atomic_inc(int *v);
#ifndef __PENCIL__
void atomic_inc(int *v)
{
(*v)++;
}
#endif
static void calcHist( const int rows
, const int cols
, const int step
, const unsigned char image[static const restrict rows][step]
, int hist[static const restrict HISTOGRAM_BINS] //out
)
{
#pragma scop
__pencil_assume(rows > 0);
__pencil_assume(cols > 0);
__pencil_assume(step >= cols);
__pencil_kill(hist);
#pragma pencil independent
for(int b = 0; b < HISTOGRAM_BINS; ++b)
hist[b] = 0;
#pragma pencil independent
for(int r = 0; r < rows; ++r)
{
#pragma pencil independent
for(int c = 0; c < cols; ++c)
{
unsigned char pixel = image[r][c];
atomic_inc(&hist[pixel]);
}
}
__pencil_kill(image);
#pragma endscop
}
void pencil_calcHist( const int rows, const int cols, const int step, const unsigned char image[], int hist[HISTOGRAM_BINS])
{
calcHist( rows, cols, step, (const unsigned char(*)[step])image, hist);
}
| Use atomic_inc function in histogram instead of reductions (which are not supported by PPCG) | Use atomic_inc function in histogram instead of reductions (which are not supported by PPCG)
Former-commit-id: ff28bc0ff228606ed66e2cc1214aeff7f7f84f3b | C | mit | rbaghdadi/pencil-benchmark,pencil-language/pencil-benchmark,dividiti/pencil-benchmark,pencil-language/pencil-benchmark,pencil-language/pencil-benchmark,dividiti/pencil-benchmark,dividiti/pencil-benchmark,rbaghdadi/pencil-benchmark,rbaghdadi/pencil-benchmark |
e56c3f36194858d81ac2be3c9bf26cdb54df9dc1 | emu/src/process.h | emu/src/process.h | #ifndef EMULATOR_PROCESS_H
#include <pthread.h>
#include <stdarg.h>
#define MAX_ARGS 8
// A transputer process (more like a thread)
typedef struct {
pthread_t thread;
void* args[MAX_ARGS];
void (*func)();
} Process;
// Create a new process, with entry point 'func' and given stacksize. The
// 'nargs' arguments are passed to 'func' upon startup.
Process *ProcAlloc (void (*func)(), int stacksize, int nargs, ...);
// Start the process 'p'
void ProcRun (Process *p);
// Yield the rest of the time-slice to another process
void ProcReschedule();
#define EMULATOR_PROCESS_H
#endif // EMULATOR_PROCESS_H
| #ifndef EMULATOR_PROCESS_H
#include <pthread.h>
// OS X does not support pthread_yield(), only pthread_yield_np()
#if defined(__APPLE__) || defined(__MACH__)
#define pthread_yield() pthread_yield_np()
#endif
#include <stdarg.h>
#define MAX_ARGS 8
// A transputer process (more like a thread)
typedef struct {
pthread_t thread;
void* args[MAX_ARGS];
void (*func)();
} Process;
// Create a new process, with entry point 'func' and given stacksize. The
// 'nargs' arguments are passed to 'func' upon startup.
Process *ProcAlloc (void (*func)(), int stacksize, int nargs, ...);
// Start the process 'p'
void ProcRun (Process *p);
// Yield the rest of the time-slice to another process
void ProcReschedule();
#define EMULATOR_PROCESS_H
#endif // EMULATOR_PROCESS_H
| Fix pthread_yield() not supported by OS X | Fix pthread_yield() not supported by OS X
See here for further reference:
https://github.com/01org/ocr/issues/28
And here for the diff between pthread_yield() and pthread_yield_np():
http://www.linuxquestions.org/questions/programming-9/pthread_yield-vs-pthread_yield_np-469283/
| C | mit | noqu/vbb,noqu/vbb |
5c020deef2ee09fe0abe00ad533fba9a2411dd4a | include/siri/grammar/gramp.h | include/siri/grammar/gramp.h | /*
* gramp.h - SiriDB Grammar Properties.
*
* Note: we need this file up-to-date with the grammar. The grammar has
* keywords starting with K_ so the will all be sorted.
* KW_OFFSET should be set to the first keyword and KW_COUNT needs the
* last keyword in the grammar.
*
*/
#ifndef SIRI_GRAMP_H_
#define SIRI_GRAMP_H_
#include <siri/grammar/grammar.h>
/* keywords */
#define KW_OFFSET CLERI_GID_K_ACCESS
#define KW_COUNT CLERI_GID_K_WRITE + 1 - KW_OFFSET
/* aggregation functions */
#define F_OFFSET CLERI_GID_F_COUNT
/* help statements */
#define HELP_OFFSET CLERI_GID_HELP_ACCESS
#define HELP_COUNT CLERI_GID_HELP_TIMEZONES + 1 - HELP_OFFSET
#if CLERI_VERSION_MINOR >= 12
#define CLERI_NODE_DATA(__node) ((intptr_t)(__node)->data)
#define CLERI_NODE_DATA_ADDR(__node) ((intptr_t *) &(__node)->data)
#else
#define CLERI_NODE_DATA(__node) ((intptr_t)(__node)->result)
#define CLERI_NODE_DATA_ADDR(__node) ((intptr_t *) &(__node)->result)
#endif
#endif /* SIRI_GRAMP_H_ */
| /*
* gramp.h - SiriDB Grammar Properties.
*
* Note: we need this file up-to-date with the grammar. The grammar has
* keywords starting with K_ so the will all be sorted.
* KW_OFFSET should be set to the first keyword and KW_COUNT needs the
* last keyword in the grammar.
*
*/
#ifndef SIRI_GRAMP_H_
#define SIRI_GRAMP_H_
#include <siri/grammar/grammar.h>
/* keywords */
#define KW_OFFSET CLERI_GID_K_ACCESS
#define KW_COUNT CLERI_GID_K_WRITE + 1 - KW_OFFSET
/* aggregation functions */
#define F_OFFSET CLERI_GID_F_COUNT
/* help statements */
#define HELP_OFFSET CLERI_GID_HELP_ACCESS
#define HELP_COUNT CLERI_GID_HELP_TIMEZONES + 1 - HELP_OFFSET
#if CLERI_VERSION_MINOR >= 12
#define CLERI_NODE_DATA(__node) ((intptr_t)(__node)->data)
#define CLERI_NODE_DATA_ADDR(__node) ((intptr_t *) &(__node)->data)
#else
#define CLERI_NODE_DATA(__node) (__node)->result
#define CLERI_NODE_DATA_ADDR(__node) &(__node)->result
#endif
#endif /* SIRI_GRAMP_H_ */
| Update compat with old libcleri | Update compat with old libcleri
| C | mit | transceptor-technology/siridb-server,transceptor-technology/siridb-server,transceptor-technology/siridb-server,transceptor-technology/siridb-server |
87ae35cd89a8176b9fef8d1848bc7f6ef2ff41d2 | include/utils/SkNullCanvas.h | include/utils/SkNullCanvas.h | /*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkNullCanvas_DEFINED
#define SkNullCanvas_DEFINED
#include "SkBitmap.h"
class SkCanvas;
/**
* Creates a canvas that draws nothing. This is useful for performance testing.
*/
SkCanvas* SkCreateNullCanvas();
#endif
| /*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkNullCanvas_DEFINED
#define SkNullCanvas_DEFINED
#include "SkBitmap.h"
class SkCanvas;
/**
* Creates a canvas that draws nothing. This is useful for performance testing.
*/
SK_API SkCanvas* SkCreateNullCanvas();
#endif
| Add SK_API to null canvas create method | Add SK_API to null canvas create method
| C | bsd-3-clause | csulmone/skia,csulmone/skia,csulmone/skia,csulmone/skia |
e3757fde740764ed5b1be40aefb5594e6aef4cfb | Core/include/TexCompTypes.h | Core/include/TexCompTypes.h | // Copyright 2012 (c) Pavel Krajcevski
// BC7IntTypes.h
// This file contains all of the various platform definitions for fixed width integers
// on various platforms.
// !FIXME! Still needs to be tested on Windows platforms.
#ifndef _TEX_COMP_TYPES_H_
#define _TEX_COMP_TYPES_H_
// Windows?
#ifdef _MSC_VER
typedef __int16 int16;
typedef __uint16 uint16;
typedef __int32 int32;
typedef __uint32 uint32;
typedef __int8 int8;
typedef __uint8 uint8;
typedef __uint64 uint64;
typedef __int64 int64;
typedef __int32_ptr int32_ptr;
// If not, assume GCC, or at least standard defines...
#else
#include <stdint.h>
typedef int8_t int8;
typedef int16_t int16;
typedef int32_t int32;
typedef int64_t int64;
typedef uint8_t uint8;
typedef uint16_t uint16;
typedef uint32_t uint32;
typedef uint64_t uint64;
typedef uintptr_t int32_ptr;
typedef char CHAR;
#endif // _MSC_VER
#endif // _TEX_COMP_TYPES_H_
| // Copyright 2012 (c) Pavel Krajcevski
// BC7IntTypes.h
// This file contains all of the various platform definitions for fixed width integers
// on various platforms.
// !FIXME! Still needs to be tested on Windows platforms.
#ifndef _TEX_COMP_TYPES_H_
#define _TEX_COMP_TYPES_H_
// Windows?
#ifdef _MSC_VER
typedef __int16 int16;
typedef unsigned __int16 uint16;
typedef __int32 int32;
typedef unsigned __int32 uint32;
typedef __int8 int8;
typedef unsigned __int8 uint8;
typedef unsigned __int64 uint64;
typedef __int64 int64;
#include <tchar.h>
typedef TCHAR CHAR;
// If not, assume GCC, or at least standard defines...
#else
#include <stdint.h>
typedef int8_t int8;
typedef int16_t int16;
typedef int32_t int32;
typedef int64_t int64;
typedef uint8_t uint8;
typedef uint16_t uint16;
typedef uint32_t uint32;
typedef uint64_t uint64;
typedef char CHAR;
#endif // _MSC_VER
#endif // _TEX_COMP_TYPES_H_
| Fix MSVC interpretation of our types. | Fix MSVC interpretation of our types.
| C | apache-2.0 | GammaUNC/FasTC,GammaUNC/FasTC,GammaUNC/FasTC,GammaUNC/FasTC |
206caf539d9e7e426dbfc3936e49a72601500375 | test/CodeGen/statements.c | test/CodeGen/statements.c | // RUN: %clang_cc1 -Wreturn-type %s -emit-llvm-only
void test1(int x) {
switch (x) {
case 111111111111111111111111111111111111111:
bar();
}
}
// Mismatched type between return and function result.
int test2() { return; }
void test3() { return 4; }
void test4() {
bar:
baz:
blong:
bing:
;
// PR5131
static long x = &&bar - &&baz;
static long y = &&baz;
&&bing;
&&blong;
if (y)
goto *y;
goto *x;
}
// PR3869
int test5(long long b) {
static void *lbls[] = { &&lbl };
goto *b;
lbl:
return 0;
}
| // RUN: rm -f %S/statements.ll
// RUN: %clang_cc1 -Wreturn-type %s -emit-llvm-only
void test1(int x) {
switch (x) {
case 111111111111111111111111111111111111111:
bar();
}
}
// Mismatched type between return and function result.
int test2() { return; }
void test3() { return 4; }
void test4() {
bar:
baz:
blong:
bing:
;
// PR5131
static long x = &&bar - &&baz;
static long y = &&baz;
&&bing;
&&blong;
if (y)
goto *y;
goto *x;
}
// PR3869
int test5(long long b) {
static void *lbls[] = { &&lbl };
goto *b;
lbl:
return 0;
}
| Clean up in buildbot directories. | Clean up in buildbot directories.
This test created a statements.ll file until about a month ago. Some buildbots
still have this file in their source dir. This is the easiest way to remove the
file on all bots. Then I'll revert.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@113814 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang |
6ea796c6cae61f9c45d4a85e84ce619b83788934 | libs/console/src/cons_fmt.c | libs/console/src/cons_fmt.c | /**
* Copyright (c) 2015 Runtime Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdarg.h>
#include <stdio.h>
#include <console/console.h>
#define CONS_OUTPUT_MAX_LINE 128
void console_printf(const char *fmt, ...)
{
va_list args;
char buf[CONS_OUTPUT_MAX_LINE];
int len;
va_start(args, fmt);
len = vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
if (len >= sizeof(buf)) {
len = sizeof(buf) - 1;
}
if (buf[len - 1] != '\n') {
if (len != sizeof(buf) - 1) {
len++;
}
buf[len - 1] = '\n';
}
console_write(buf, len);
}
| /**
* Copyright (c) 2015 Runtime Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdarg.h>
#include <stdio.h>
#include <console/console.h>
#include <os/os_time.h>
#define CONS_OUTPUT_MAX_LINE 128
void console_printf(const char *fmt, ...)
{
va_list args;
char buf[CONS_OUTPUT_MAX_LINE];
int len;
len = snprintf(buf, sizeof(buf), "%lu:", os_time_get());
console_write(buf, len);
va_start(args, fmt);
len = vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
if (len >= sizeof(buf)) {
len = sizeof(buf) - 1;
}
if (buf[len - 1] != '\n') {
if (len != sizeof(buf) - 1) {
len++;
}
buf[len - 1] = '\n';
}
console_write(buf, len);
}
| Add timestamp to output in the beginning of output. | Add timestamp to output in the beginning of output.
| C | apache-2.0 | mlaz/mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,wes3/incubator-mynewt-core,IMGJulian/incubator-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,wes3/incubator-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,mlaz/mynewt-core,andrzej-kaczmarek/apache-mynewt-core,wes3/incubator-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,IMGJulian/incubator-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,IMGJulian/incubator-mynewt-core,wes3/incubator-mynewt-core,mlaz/mynewt-core,mlaz/mynewt-core,IMGJulian/incubator-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,mlaz/mynewt-core,IMGJulian/incubator-mynewt-core,wes3/incubator-mynewt-core |
a765e158458a4ecf6876d2513e1cfa8e705afb0d | Queue/link_list_queue.c | Queue/link_list_queue.c | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
/* This is Stack Implementation using a Linked list */
#define MAXSIZE 101
#define BOOL_PRINT(bool_expr) "%s\n", (bool_expr) ? "true" : "false"
typedef struct node{
int data;
struct node* link;
} node;
node* head; //global variable
node* create_newnode(int x){
node* temp;
temp = (node*) malloc (sizeof(node));
temp->data =x;
temp->link=NULL;
return temp;
}
void enq(int data){
//this is equivalent to add a node at end of the linked list
if(isEmpty()){
node* temp;
temp =create_newnode(data);
temp->link = head;
head = temp;
}
else{
node* temp;
temp =create_newnode(data);
node* last = head;
while(last->link!=NULL){
last=last->link;
}
last->link = temp;
}
}
int deq(){
//this is equivalent to delete a node at begining of the linked list
if(head != NULL ){
node* temp = head;
head = temp->link;
return temp->data;
}
else{
printf("Error: queue is empty \n");
return -1;
}
}
int isEmpty(){
//this is equivalent to checking if the linked list is empty
if(head != NULL) return false;
else return true;
}
void q_print(){
//this is equivalent to printing a linked list while traversing
printf("queue is : ");
node* temp = head;
while(temp != NULL){
printf("%d ", temp->data);
temp = temp->link;
}
printf("\n");
}
int main(){
int i;
printf("is queue empty? \n");
printf(BOOL_PRINT(isEmpty()));
enq(10);
enq(11);
enq(12);
enq(15);
i = deq();
printf("first in queue is %d\n",i );
q_print();
return 0;
} | Add linked list implementation of queue | Add linked list implementation of queue
| C | mit | anaghajoshi/C_DataStructures_Algorithms |
|
700975bc9b076bd9095326bb1c0e19b8763584ff | include/llvm/Analysis/BasicAliasAnalysis.h | include/llvm/Analysis/BasicAliasAnalysis.h | //===- llvm/Analysis/BasicAliasAnalysis.h - Alias Analysis Impl -*- C++ -*-===//
//
// This file defines the default implementation of the Alias Analysis interface
// that simply implements a few identities (two different globals cannot alias,
// etc), but otherwise does no analysis.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_ANALYSIS_BASIC_ALIAS_ANALYSIS_H
#define LLVM_ANALYSIS_BASIC_ALIAS_ANALYSIS_H
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Pass.h"
struct BasicAliasAnalysis : public FunctionPass, public AliasAnalysis {
// Pass Implementation stuff. This isn't much of a pass.
//
bool runOnFunction(Function &) { return false; }
// getAnalysisUsage - Does not modify anything.
//
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
}
// alias - This is the only method here that does anything interesting...
//
Result alias(const Value *V1, const Value *V2) const;
/// canCallModify - We are not interprocedural, so we do nothing exciting.
///
Result canCallModify(const CallInst &CI, const Value *Ptr) const {
return MayAlias;
}
/// canInvokeModify - We are not interprocedural, so we do nothing exciting.
///
Result canInvokeModify(const InvokeInst &I, const Value *Ptr) const {
return MayAlias; // We are not interprocedural
}
};
#endif
| //===- llvm/Analysis/BasicAliasAnalysis.h - Alias Analysis Impl -*- C++ -*-===//
//
// This file defines the default implementation of the Alias Analysis interface
// that simply implements a few identities (two different globals cannot alias,
// etc), but otherwise does no analysis.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_ANALYSIS_BASIC_ALIAS_ANALYSIS_H
#define LLVM_ANALYSIS_BASIC_ALIAS_ANALYSIS_H
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Pass.h"
struct BasicAliasAnalysis : public ImmutablePass, public AliasAnalysis {
// Pass Implementation stuff. This isn't much of a pass.
//
bool runOnFunction(Function &) { return false; }
// getAnalysisUsage - Does not modify anything.
//
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
}
// alias - This is the only method here that does anything interesting...
//
Result alias(const Value *V1, const Value *V2) const;
/// canCallModify - We are not interprocedural, so we do nothing exciting.
///
Result canCallModify(const CallInst &CI, const Value *Ptr) const {
return MayAlias;
}
/// canInvokeModify - We are not interprocedural, so we do nothing exciting.
///
Result canInvokeModify(const InvokeInst &I, const Value *Ptr) const {
return MayAlias; // We are not interprocedural
}
};
#endif
| Convert BasicAA to be an immutable pass instead of a FunctionPass | Convert BasicAA to be an immutable pass instead of a FunctionPass
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@3922 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm |
4ced8ab4d70ab9c420e0f22a2668f4a58fc76d40 | spotify-fs.c | spotify-fs.c | #include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <errno.h>
#include "spotify-fs.h"
int main(int argc, char *argv[])
{
int retval = 0;
char *password = NULL;
char *username = malloc(SPOTIFY_USERNAME_MAXLEN);
if ((getuid() == 0) || (geteuid() == 0)) {
fprintf(stderr, "Running %s as root is not a good idea\n", application_name);
return 1;
}
printf("spotify username: ");
username = fgets(username, SPOTIFY_USERNAME_MAXLEN, stdin);
password = getpass("spotify password: ");
if (strlen(password) <= 0)
{
password = NULL;
}
/* should we do something about this, really?
* Maybe put error logging here instead of in
* spotify_session_init()*/
(void) spotify_session_init(username, password, NULL);
retval = fuse_main(argc, argv, &spfs_operations, NULL);
return retval;
}
| #include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <errno.h>
#include "spotify-fs.h"
int main(int argc, char *argv[])
{
int retval = 0;
char *password = NULL;
char *username = malloc(SPOTIFY_USERNAME_MAXLEN);
if ((getuid() == 0) || (geteuid() == 0)) {
fprintf(stderr, "Running %s as root is not a good idea\n", application_name);
return 1;
}
printf("spotify username: ");
username = fgets(username, SPOTIFY_USERNAME_MAXLEN, stdin);
long username_len = strlen(username);
if(username[username_len-1] == '\n') {
username[username_len-1] = '\0';
}
password = getpass("spotify password: ");
if (strlen(password) <= 0)
{
password = NULL;
}
/* should we do something about this, really?
* Maybe put error logging here instead of in
* spotify_session_init()*/
(void) spotify_session_init(username, password, NULL);
retval = fuse_main(argc, argv, &spfs_operations, NULL);
return retval;
}
| Trim newline off of username | fs: Trim newline off of username
Anton, be prepared to do cleanup commits after my mess.
Signed-off-by: Carl Helmertz <[email protected]>
| C | bsd-3-clause | raoulh/spotifile,chelmertz/spotifile,catharsis/spotifile,raoulh/spotifile,raoulh/spotifile,chelmertz/spotifile,catharsis/spotifile,catharsis/spotifile,chelmertz/spotifile |
1d7cf43c8a668c22d053595702d241dc937c4142 | src/animation/scene/duipageswitchanimation_p.h | src/animation/scene/duipageswitchanimation_p.h | /***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation ([email protected])
**
** This file is part of libdui.
**
** If you have questions regarding the use of this file, please contact
** Nokia at [email protected].
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/
#ifndef DUIPAGESWITCHANIMATION_P_H
#define DUIPAGESWITCHANIMATION_P_H
#include "duipageswitchanimation.h"
#include "duiparallelanimationgroup_p.h"
class DuiSceneWindow;
class QPropertyAnimation;
class DuiPageSwitchAnimationPrivate : public DuiParallelAnimationGroupPrivate
{
Q_DECLARE_PUBLIC(DuiPageSwitchAnimation)
public:
DuiSceneWindow *sceneWindow;
protected:
DuiSceneWindow *newPage;
DuiSceneWindow *oldPage;
QPropertyAnimation *positionNewPageAnimation;
QPropertyAnimation *positionOldPageAnimation;
DuiPageSwitchAnimation::PageTransitionDirection direction;
};
#endif
| /***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation ([email protected])
**
** This file is part of libdui.
**
** If you have questions regarding the use of this file, please contact
** Nokia at [email protected].
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/
#ifndef DUIPAGESWITCHANIMATION_P_H
#define DUIPAGESWITCHANIMATION_P_H
#include "duipageswitchanimation.h"
#include "duiparallelanimationgroup_p.h"
#include <QPointer>
class DuiSceneWindow;
class QPropertyAnimation;
class DuiPageSwitchAnimationPrivate : public DuiParallelAnimationGroupPrivate
{
Q_DECLARE_PUBLIC(DuiPageSwitchAnimation)
public:
DuiSceneWindow *sceneWindow;
protected:
QPointer<DuiSceneWindow> newPage;
QPointer<DuiSceneWindow> oldPage;
QPropertyAnimation *positionNewPageAnimation;
QPropertyAnimation *positionOldPageAnimation;
DuiPageSwitchAnimation::PageTransitionDirection direction;
};
#endif
| Make DuiPageSwitchAnimation not use dangling pointers. | Changes: Make DuiPageSwitchAnimation not use dangling pointers.
RevBy: TrustMe
Details: That was causing a crash if it had pointers to pages
that had been deleted.
| C | lgpl-2.1 | nemomobile-graveyard/libmeegotouch,nemomobile-graveyard/libmeegotouch,nemomobile-graveyard/libmeegotouch,nemomobile-graveyard/libmeegotouch,nemomobile-graveyard/libmeegotouch,nemomobile-graveyard/libmeegotouch |
718ff1293ce15fe3f7deb0a6498b215f38704357 | Pod/ILGClasses/ILGClasses.h | Pod/ILGClasses/ILGClasses.h | //
// ILGClasses.h
// Pods
//
// Created by Isaac Greenspan on 6/22/15.
//
//
#import <Foundation/Foundation.h>
typedef BOOL(^ILGClassesClassTestBlock)(__strong Class class);
@interface ILGClasses : NSObject
/**
* Get a set of all of the classes passing a given test.
*
* @param test The block with which to test each class
*
* @return A set of all of the classes passing the test
*/
+ (NSSet *)classesPassingTest:(ILGClassesClassTestBlock)test;
/**
* Get a set of all of the classes that are a subclass of the given class.
*
* Includes any class for which the given class is an ancestor, no matter how far back. Does not include the given
* class in the result.
*
* @param superclass The superclass to look for
*
* @return A set of all of the subclasses of the given class, including indirect subclasses.
*/
+ (NSSet *)subclassesOfClass:(Class)superclass;
/**
* Get a set of all of the classes that conform to the given protocol.
*
* @param protocol The protocol to look for
*
* @return A set of all of the classes that conform to the given protocol, as well as their direct and indirect subclasses.
*/
+ (NSSet *)classesConformingToProtocol:(Protocol *)protocol;
@end
| //
// ILGClasses.h
// Pods
//
// Created by Isaac Greenspan on 6/22/15.
//
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef BOOL(^ILGClassesClassTestBlock)(__strong Class class);
@interface ILGClasses : NSObject
/**
* Get a set of all of the classes passing a given test.
*
* @param test The block with which to test each class
*
* @return A set of all of the classes passing the test
*/
+ (NSSet<Class> *__nullable)classesPassingTest:(ILGClassesClassTestBlock)test;
/**
* Get a set of all of the classes that are a subclass of the given class.
*
* Includes any class for which the given class is an ancestor, no matter how far back. Does not include the given
* class in the result.
*
* @param superclass The superclass to look for
*
* @return A set of all of the subclasses of the given class, including indirect subclasses.
*/
+ (NSSet<Class> *__nullable)subclassesOfClass:(Class)superclass;
/**
* Get a set of all of the classes that conform to the given protocol.
*
* @param protocol The protocol to look for
*
* @return A set of all of the classes that conform to the given protocol, as well as their direct and indirect subclasses.
*/
+ (NSSet<Class> *__nullable)classesConformingToProtocol:(Protocol *)protocol;
NS_ASSUME_NONNULL_END
@end
| Add nullability annotations to classes header | Add nullability annotations to classes header
| C | mit | designatednerd/ILGDynamicObjC,designatednerd/ILGDynamicObjC,designatednerd/ILGDynamicObjC |
848692131a7081d789aa4e58e4cc5ec94c4f520a | src/include/commands/schemacmds.h | src/include/commands/schemacmds.h | /*-------------------------------------------------------------------------
*
* schemacmds.h
* prototypes for schemacmds.c.
*
*
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/commands/schemacmds.h,v 1.13 2006/03/05 15:58:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef SCHEMACMDS_H
#define SCHEMACMDS_H
#include "nodes/parsenodes.h"
extern void CreateSchemaCommand(CreateSchemaStmt *parsetree);
extern void RemoveSchema(List *names, DropBehavior behavior, bool missing_ok);
extern void RemoveSchemaById(Oid schemaOid);
extern void RenameSchema(const char *oldname, const char *newname);
extern void AlterSchemaOwner(const char *name, Oid newOwnerId);
extern void AlterSchemaOwner_oid(const Oid schemaOid, Oid newOwnerId);
#endif /* SCHEMACMDS_H */
| /*-------------------------------------------------------------------------
*
* schemacmds.h
* prototypes for schemacmds.c.
*
*
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/commands/schemacmds.h,v 1.14 2006/04/09 22:01:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef SCHEMACMDS_H
#define SCHEMACMDS_H
#include "nodes/parsenodes.h"
extern void CreateSchemaCommand(CreateSchemaStmt *parsetree);
extern void RemoveSchema(List *names, DropBehavior behavior, bool missing_ok);
extern void RemoveSchemaById(Oid schemaOid);
extern void RenameSchema(const char *oldname, const char *newname);
extern void AlterSchemaOwner(const char *name, Oid newOwnerId);
extern void AlterSchemaOwner_oid(Oid schemaOid, Oid newOwnerId);
#endif /* SCHEMACMDS_H */
| Fix another const-decoration mismatch, per Magnus. | Fix another const-decoration mismatch, per Magnus.
| C | apache-2.0 | randomtask1155/gpdb,tangp3/gpdb,rubikloud/gpdb,arcivanov/postgres-xl,rubikloud/gpdb,yazun/postgres-xl,tpostgres-projects/tPostgres,edespino/gpdb,foyzur/gpdb,xuegang/gpdb,adam8157/gpdb,foyzur/gpdb,xuegang/gpdb,ashwinstar/gpdb,janebeckman/gpdb,yazun/postgres-xl,0x0FFF/gpdb,janebeckman/gpdb,edespino/gpdb,tpostgres-projects/tPostgres,xinzweb/gpdb,edespino/gpdb,chrishajas/gpdb,CraigHarris/gpdb,lpetrov-pivotal/gpdb,cjcjameson/gpdb,Chibin/gpdb,postmind-net/postgres-xl,lpetrov-pivotal/gpdb,lintzc/gpdb,lisakowen/gpdb,0x0FFF/gpdb,foyzur/gpdb,oberstet/postgres-xl,arcivanov/postgres-xl,rvs/gpdb,techdragon/Postgres-XL,pavanvd/postgres-xl,xuegang/gpdb,jmcatamney/gpdb,zaksoup/gpdb,Quikling/gpdb,lintzc/gpdb,zaksoup/gpdb,adam8157/gpdb,lisakowen/gpdb,tangp3/gpdb,Chibin/gpdb,xinzweb/gpdb,greenplum-db/gpdb,CraigHarris/gpdb,kaknikhil/gpdb,lintzc/gpdb,jmcatamney/gpdb,ahachete/gpdb,edespino/gpdb,chrishajas/gpdb,postmind-net/postgres-xl,xinzweb/gpdb,snaga/postgres-xl,snaga/postgres-xl,zaksoup/gpdb,jmcatamney/gpdb,chrishajas/gpdb,rvs/gpdb,oberstet/postgres-xl,edespino/gpdb,snaga/postgres-xl,50wu/gpdb,yuanzhao/gpdb,greenplum-db/gpdb,rvs/gpdb,jmcatamney/gpdb,randomtask1155/gpdb,arcivanov/postgres-xl,lintzc/gpdb,jmcatamney/gpdb,janebeckman/gpdb,lintzc/gpdb,Quikling/gpdb,kmjungersen/PostgresXL,CraigHarris/gpdb,yuanzhao/gpdb,Chibin/gpdb,zeroae/postgres-xl,greenplum-db/gpdb,Quikling/gpdb,xuegang/gpdb,foyzur/gpdb,50wu/gpdb,50wu/gpdb,greenplum-db/gpdb,0x0FFF/gpdb,ashwinstar/gpdb,Chibin/gpdb,Chibin/gpdb,kmjungersen/PostgresXL,yuanzhao/gpdb,yuanzhao/gpdb,kaknikhil/gpdb,adam8157/gpdb,atris/gpdb,Quikling/gpdb,techdragon/Postgres-XL,kaknikhil/gpdb,ovr/postgres-xl,ovr/postgres-xl,oberstet/postgres-xl,lpetrov-pivotal/gpdb,yazun/postgres-xl,tangp3/gpdb,lintzc/gpdb,50wu/gpdb,zaksoup/gpdb,rubikloud/gpdb,ovr/postgres-xl,zaksoup/gpdb,edespino/gpdb,rubikloud/gpdb,oberstet/postgres-xl,tpostgres-projects/tPostgres,royc1/gpdb,cjcjameson/gpdb,zeroae/postgres-xl,randomtask1155/gpdb,adam8157/gpdb,janebeckman/gpdb,lisakowen/gpdb,tpostgres-projects/tPostgres,zeroae/postgres-xl,ovr/postgres-xl,arcivanov/postgres-xl,xuegang/gpdb,rvs/gpdb,CraigHarris/gpdb,lisakowen/gpdb,cjcjameson/gpdb,atris/gpdb,50wu/gpdb,CraigHarris/gpdb,edespino/gpdb,0x0FFF/gpdb,tangp3/gpdb,royc1/gpdb,pavanvd/postgres-xl,ashwinstar/gpdb,greenplum-db/gpdb,atris/gpdb,edespino/gpdb,ashwinstar/gpdb,lpetrov-pivotal/gpdb,rubikloud/gpdb,0x0FFF/gpdb,cjcjameson/gpdb,Quikling/gpdb,0x0FFF/gpdb,yazun/postgres-xl,royc1/gpdb,atris/gpdb,0x0FFF/gpdb,CraigHarris/gpdb,xinzweb/gpdb,kaknikhil/gpdb,ashwinstar/gpdb,yuanzhao/gpdb,xuegang/gpdb,edespino/gpdb,zaksoup/gpdb,royc1/gpdb,tangp3/gpdb,lpetrov-pivotal/gpdb,tpostgres-projects/tPostgres,arcivanov/postgres-xl,kaknikhil/gpdb,kmjungersen/PostgresXL,ahachete/gpdb,royc1/gpdb,ahachete/gpdb,ashwinstar/gpdb,janebeckman/gpdb,Chibin/gpdb,kaknikhil/gpdb,rvs/gpdb,janebeckman/gpdb,ahachete/gpdb,zaksoup/gpdb,ashwinstar/gpdb,50wu/gpdb,rvs/gpdb,postmind-net/postgres-xl,foyzur/gpdb,cjcjameson/gpdb,ahachete/gpdb,atris/gpdb,ahachete/gpdb,techdragon/Postgres-XL,adam8157/gpdb,ahachete/gpdb,Chibin/gpdb,tangp3/gpdb,yuanzhao/gpdb,xinzweb/gpdb,greenplum-db/gpdb,royc1/gpdb,pavanvd/postgres-xl,jmcatamney/gpdb,yuanzhao/gpdb,adam8157/gpdb,rvs/gpdb,Quikling/gpdb,adam8157/gpdb,xuegang/gpdb,Quikling/gpdb,zeroae/postgres-xl,lpetrov-pivotal/gpdb,lisakowen/gpdb,techdragon/Postgres-XL,lpetrov-pivotal/gpdb,postmind-net/postgres-xl,xuegang/gpdb,janebeckman/gpdb,Postgres-XL/Postgres-XL,cjcjameson/gpdb,rvs/gpdb,randomtask1155/gpdb,foyzur/gpdb,CraigHarris/gpdb,kmjungersen/PostgresXL,ashwinstar/gpdb,atris/gpdb,zaksoup/gpdb,greenplum-db/gpdb,Chibin/gpdb,chrishajas/gpdb,chrishajas/gpdb,xinzweb/gpdb,foyzur/gpdb,50wu/gpdb,tangp3/gpdb,lisakowen/gpdb,tangp3/gpdb,adam8157/gpdb,jmcatamney/gpdb,arcivanov/postgres-xl,chrishajas/gpdb,foyzur/gpdb,CraigHarris/gpdb,lintzc/gpdb,kaknikhil/gpdb,edespino/gpdb,randomtask1155/gpdb,xinzweb/gpdb,CraigHarris/gpdb,Quikling/gpdb,chrishajas/gpdb,Postgres-XL/Postgres-XL,rvs/gpdb,pavanvd/postgres-xl,0x0FFF/gpdb,Postgres-XL/Postgres-XL,rvs/gpdb,lisakowen/gpdb,kaknikhil/gpdb,kaknikhil/gpdb,lisakowen/gpdb,xinzweb/gpdb,oberstet/postgres-xl,pavanvd/postgres-xl,yuanzhao/gpdb,atris/gpdb,cjcjameson/gpdb,randomtask1155/gpdb,greenplum-db/gpdb,lintzc/gpdb,Quikling/gpdb,ahachete/gpdb,atris/gpdb,snaga/postgres-xl,janebeckman/gpdb,yuanzhao/gpdb,Postgres-XL/Postgres-XL,Chibin/gpdb,ovr/postgres-xl,royc1/gpdb,cjcjameson/gpdb,50wu/gpdb,rubikloud/gpdb,janebeckman/gpdb,chrishajas/gpdb,lintzc/gpdb,snaga/postgres-xl,randomtask1155/gpdb,randomtask1155/gpdb,janebeckman/gpdb,royc1/gpdb,Chibin/gpdb,Quikling/gpdb,yuanzhao/gpdb,cjcjameson/gpdb,rubikloud/gpdb,jmcatamney/gpdb,cjcjameson/gpdb,lpetrov-pivotal/gpdb,xuegang/gpdb,yazun/postgres-xl,postmind-net/postgres-xl,rubikloud/gpdb,techdragon/Postgres-XL,kmjungersen/PostgresXL,kaknikhil/gpdb,Postgres-XL/Postgres-XL,zeroae/postgres-xl |
5e1e13c695494d5ff63c0f50e4b7641ae23144c3 | sx_slentry.h | sx_slentry.h | #ifndef SX_SLENTRY_H_
#define SX_SLENTRY_H_
#if HAVE_SYS_QUEUE_H
#include <sys/queue.h>
#else
#include "sys_queue.h"
#endif
#if HAVE_SYS_TREE_H
#include <sys/tree.h>
#else
#include "sys_tree.h"
#endif
struct sx_slentry {
STAILQ_ENTRY(sx_slentry) next;
char* text;
};
struct sx_slentry* sx_slentry_new(char* text);
struct sx_tentry {
RB_ENTRY(sx_tentry) entry;
char* text;
};
struct sx_tentry* sx_tentry_new(char* text);
#endif
| #ifndef SX_SLENTRY_H_
#define SX_SLENTRY_H_
#if HAVE_SYS_QUEUE_H
#include <sys/queue.h>
/* OpenBSD-current as of 2015-08-30 does not define STAILQ_ENTRY anymore */
#ifndef STAILQ_ENTRY
#include "sys_queue.h"
#endif
#else
#include "sys_queue.h"
#endif
#if HAVE_SYS_TREE_H
#include <sys/tree.h>
#else
#include "sys_tree.h"
#endif
struct sx_slentry {
STAILQ_ENTRY(sx_slentry) next;
char* text;
};
struct sx_slentry* sx_slentry_new(char* text);
struct sx_tentry {
RB_ENTRY(sx_tentry) entry;
char* text;
};
struct sx_tentry* sx_tentry_new(char* text);
#endif
| Check if sys/queue.h have STAILQ_ interface. At least OpenBSD's one does not... | Check if sys/queue.h have STAILQ_ interface. At least OpenBSD's one does not...
| C | bsd-2-clause | ledeuns/bgpq3,kjniemi/bgpq3,ledeuns/bgpq3,ledeuns/bgpq3,kjniemi/bgpq3,kjniemi/bgpq3 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.