commit
stringlengths 40
40
| old_file
stringlengths 4
237
| new_file
stringlengths 4
237
| old_contents
stringlengths 1
4.24k
| new_contents
stringlengths 1
4.87k
| subject
stringlengths 15
778
| message
stringlengths 15
8.75k
| lang
stringclasses 266
values | license
stringclasses 13
values | repos
stringlengths 5
127k
|
|---|---|---|---|---|---|---|---|---|---|
60dcc9639dd5f36d1049f1d85bfd6bec45b2ab20
|
exercises/rna-transcription/src/example.c
|
exercises/rna-transcription/src/example.c
|
#include <stdlib.h>
#include <string.h>
#include "rna_transcription.h"
char *to_rna(const char *dna) {
size_t len = strlen(dna);
char *rna = malloc(sizeof(char) * len);
for (int i = 0; i < len; i++) {
switch (dna[i]) {
case 'G':
rna[i] = 'C';
break;
case 'C':
rna[i] = 'G';
break;
case 'T':
rna[i] = 'A';
break;
case 'A':
rna[i] = 'U';
break;
default:
free(rna);
return NULL;
}
}
return rna;
}
|
#include <stdlib.h>
#include <string.h>
#include "rna_transcription.h"
char *to_rna(const char *dna) {
size_t len = strlen(dna);
char *rna = malloc(sizeof(char) * len);
for (size_t i = 0; i < len; i++) {
switch (dna[i]) {
case 'G':
rna[i] = 'C';
break;
case 'C':
rna[i] = 'G';
break;
case 'T':
rna[i] = 'A';
break;
case 'A':
rna[i] = 'U';
break;
default:
free(rna);
return NULL;
}
}
return rna;
}
|
Fix signed and unsigned comparison
|
Fix signed and unsigned comparison
|
C
|
mit
|
RealBarrettBrown/xc,RealBarrettBrown/xc,RealBarrettBrown/xc
|
85da0a68e77dd32bd2f55d33e0d93d63b8805c8e
|
src/vast/concept/parseable/vast/key.h
|
src/vast/concept/parseable/vast/key.h
|
#ifndef VAST_CONCEPT_PARSEABLE_VAST_KEY_H
#define VAST_CONCEPT_PARSEABLE_VAST_KEY_H
#include "vast/key.h"
#include "vast/concept/parseable/core/choice.h"
#include "vast/concept/parseable/core/list.h"
#include "vast/concept/parseable/core/operators.h"
#include "vast/concept/parseable/core/parser.h"
#include "vast/concept/parseable/core/plus.h"
#include "vast/concept/parseable/string/char_class.h"
namespace vast {
struct key_parser : parser<key_parser> {
using attribute = key;
template <typename Iterator, typename Attribute>
bool parse(Iterator& f, Iterator const& l, Attribute& a) const {
using namespace parsers;
static auto p = +(alnum | chr{'_'} | chr{':'}) % '.';
return p.parse(f, l, a);
}
};
template <>
struct parser_registry<key> {
using type = key_parser;
};
namespace parsers {
static auto const key = make_parser<vast::key>();
} // namespace parsers
} // namespace vast
#endif
|
#ifndef VAST_CONCEPT_PARSEABLE_VAST_KEY_H
#define VAST_CONCEPT_PARSEABLE_VAST_KEY_H
#include "vast/key.h"
#include "vast/concept/parseable/core/choice.h"
#include "vast/concept/parseable/core/list.h"
#include "vast/concept/parseable/core/operators.h"
#include "vast/concept/parseable/core/parser.h"
#include "vast/concept/parseable/core/plus.h"
#include "vast/concept/parseable/string/char_class.h"
namespace vast {
struct key_parser : parser<key_parser> {
using attribute = key;
template <typename Iterator, typename Attribute>
bool parse(Iterator& f, Iterator const& l, Attribute& a) const {
// FIXME: we currently cannot parse character sequences into containers,
// e.g., (alpha | '_') >> +(alnum ...). Until we have enhanced the
// framework, we'll just bail out when we find a colon at the beginning.
if (f != l && *f == ':')
return false;
using namespace parsers;
static auto p = +(alnum | chr{'_'} | chr{':'}) % '.';
return p.parse(f, l, a);
}
};
template <>
struct parser_registry<key> {
using type = key_parser;
};
namespace parsers {
static auto const key = make_parser<vast::key>();
} // namespace parsers
} // namespace vast
#endif
|
Work around missing parsing functionality
|
Work around missing parsing functionality
|
C
|
bsd-3-clause
|
mavam/vast,pmos69/vast,vast-io/vast,vast-io/vast,vast-io/vast,vast-io/vast,pmos69/vast,pmos69/vast,mavam/vast,vast-io/vast,mavam/vast,mavam/vast,pmos69/vast
|
8f0b7f5f5bc1eb5a1e794497d14560d032bf8dca
|
tests/headers/functions.h
|
tests/headers/functions.h
|
/* Header testing function definitions parsing. */
//Defining a standard function.
void f(int, int);
inline int g(char *ch, char **str);
// Defining a function pointer.
int(*fnPtr)(char, float);
// Adding dllexport and stdcall annotation to a function.
int __declspec(dllexport) __stdcall function1();
|
/* Header testing function definitions parsing. */
//Defining a standard function.
void f(int, int);
// Defining a function with its implementation following
inline int g(char *ch, char **str)
{
JUNK
{ }
int localVariable = 1;
}
// Defining a function pointer.
int(*fnPtr)(char, float);
// Adding dllexport and stdcall annotation to a function.
int __declspec(dllexport) __stdcall function1();
|
Add back Luke test of a function followed by its concrete implementation.
|
Add back Luke test of a function followed by its concrete implementation.
|
C
|
mit
|
mrh1997/pyclibrary,duguxy/pyclibrary,duguxy/pyclibrary,MatthieuDartiailh/pyclibrary,mrh1997/pyclibrary,MatthieuDartiailh/pyclibrary,mrh1997/pyclibrary,duguxy/pyclibrary
|
bfb527e09f6fb22e4547c08c8262deb9a827e9ad
|
kernel/os/include/os/os_fault.h
|
kernel/os/include/os/os_fault.h
|
/*
* licensed to the apache software foundation (asf) under one
* or more contributor license agreements. see the notice file
* distributed with this work for additional information
* regarding copyright ownership. the asf licenses this file
* to you under the apache license, version 2.0 (the
* "license"); you may 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 _OS_FAULT_H
#define _OS_FAULT_H
#ifdef __cplusplus
extern "c" {
#endif
void __assert_func(const char *, int, const char *, const char *)
__attribute((noreturn));
#ifdef __cplusplus
}
#endif
#endif /* _OS_FAULT_H */
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may 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 _OS_FAULT_H
#define _OS_FAULT_H
#ifdef __cplusplus
extern "c" {
#endif
void __assert_func(const char *, int, const char *, const char *)
__attribute((noreturn));
#ifdef __cplusplus
}
#endif
#endif /* _OS_FAULT_H */
|
Update License to match other licenses
|
Update License to match other licenses
|
C
|
apache-2.0
|
andrzej-kaczmarek/incubator-mynewt-core,mlaz/mynewt-core,andrzej-kaczmarek/apache-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,mlaz/mynewt-core,IMGJulian/incubator-mynewt-core,mlaz/mynewt-core,IMGJulian/incubator-mynewt-core,wes3/incubator-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,IMGJulian/incubator-mynewt-core,wes3/incubator-mynewt-core,mlaz/mynewt-core,IMGJulian/incubator-mynewt-core,mlaz/mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,wes3/incubator-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,wes3/incubator-mynewt-core,wes3/incubator-mynewt-core,IMGJulian/incubator-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core
|
d80bdc186a97b2f1e9dee35941422cef15a49ded
|
fitz/stm_filter.c
|
fitz/stm_filter.c
|
#include "fitz_base.h"
#include "fitz_stream.h"
fz_error
fz_process(fz_filter *f, fz_buffer *in, fz_buffer *out)
{
fz_error reason;
unsigned char *oldrp;
unsigned char *oldwp;
assert(!out->eof);
oldrp = in->rp;
oldwp = out->wp;
if (f->done)
return fz_iodone;
reason = f->process(f, in, out);
assert(in->rp <= in->wp);
assert(out->wp <= out->ep);
f->consumed = in->rp > oldrp;
f->produced = out->wp > oldwp;
f->count += out->wp - oldwp;
/* iodone or error */
if (reason != fz_ioneedin && reason != fz_ioneedout)
{
if (reason != fz_iodone)
reason = fz_rethrow(reason, "cannot process filter");
out->eof = 1;
f->done = 1;
}
return reason;
}
fz_filter *
fz_keepfilter(fz_filter *f)
{
f->refs ++;
return f;
}
void
fz_dropfilter(fz_filter *f)
{
if (--f->refs == 0)
{
if (f->drop)
f->drop(f);
fz_free(f);
}
}
|
#include "fitz_base.h"
#include "fitz_stream.h"
fz_error
fz_process(fz_filter *f, fz_buffer *in, fz_buffer *out)
{
fz_error reason;
unsigned char *oldrp;
unsigned char *oldwp;
oldrp = in->rp;
oldwp = out->wp;
if (f->done)
return fz_iodone;
assert(!out->eof);
reason = f->process(f, in, out);
assert(in->rp <= in->wp);
assert(out->wp <= out->ep);
f->consumed = in->rp > oldrp;
f->produced = out->wp > oldwp;
f->count += out->wp - oldwp;
/* iodone or error */
if (reason != fz_ioneedin && reason != fz_ioneedout)
{
if (reason != fz_iodone)
reason = fz_rethrow(reason, "cannot process filter");
out->eof = 1;
f->done = 1;
}
return reason;
}
fz_filter *
fz_keepfilter(fz_filter *f)
{
f->refs ++;
return f;
}
void
fz_dropfilter(fz_filter *f)
{
if (--f->refs == 0)
{
if (f->drop)
f->drop(f);
fz_free(f);
}
}
|
Move assert test of EOF to after testing if a filter is done.
|
Move assert test of EOF to after testing if a filter is done.
darcs-hash:20090823143236-f546f-8a43aacda84fc3a1ab9b24c9cd54bd422912d4ec.gz
|
C
|
agpl-3.0
|
nqv/mupdf,nqv/mupdf,nqv/mupdf,nqv/mupdf,nqv/mupdf,nqv/mupdf
|
eada73f748007102da090de2f6ac65691a9ea9a8
|
src/canopy_os_linux.c
|
src/canopy_os_linux.c
|
// Copyright 2015 SimpleThings, 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.
// Linux implementation of OS Abstraction Layer for Canopy
#include <canopy_os.h>
#include <assert.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
void canopy_os_assert(int condition) {
assert(condition);
}
void * canopy_os_alloc(size_t size) {
return malloc(size);
}
void * canopy_os_calloc(int count, size_t size) {
return calloc(count, size);
}
void canopy_os_free(void *ptr) {
free(ptr);
}
void canopy_os_log(const char *format, ...) {
va_list ap;
va_start(ap, format);
vfprintf(stderr, format, ap);
va_end(ap);
}
|
// Copyright 2015 SimpleThings, 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.
// Linux implementation of OS Abstraction Layer for Canopy
#include <canopy_os.h>
#include <assert.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
void * canopy_os_alloc(size_t size) {
return malloc(size);
}
void * canopy_os_calloc(int count, size_t size) {
return calloc(count, size);
}
void canopy_os_free(void *ptr) {
free(ptr);
}
void canopy_os_log(const char *format, ...) {
va_list ap;
va_start(ap, format);
vfprintf(stderr, format, ap);
va_end(ap);
}
|
Remove canopy_os_assert implementation because linux implementation now just expands to assert macro in header file
|
Remove canopy_os_assert implementation because linux implementation now just expands to assert macro in header file
|
C
|
apache-2.0
|
canopy-project/canopy_os_linux
|
0a1ed2795d54f9295335b1ab9203eb41c34f2701
|
include/core/SkMilestone.h
|
include/core/SkMilestone.h
|
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 104
#endif
|
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 105
#endif
|
Update Skia milestone to 105
|
Update Skia milestone to 105
Change-Id: I0925a52cc3a504c95ec4453e74c4580ce692275c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548896
Reviewed-by: Eric Boren <0e499112533c8544f0505ea0d08394fb5ad7d8fa@google.com>
Reviewed-by: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>
Auto-Submit: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>
Commit-Queue: Eric Boren <0e499112533c8544f0505ea0d08394fb5ad7d8fa@google.com>
|
C
|
bsd-3-clause
|
google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia
|
982dacf245ebe0aa75d19fe27c2ec74e35f180cb
|
bikepath/SearchItem.h
|
bikepath/SearchItem.h
|
//
// SearchItem.h
// bikepath
//
// Created by Farheen Malik on 8/15/14.
// Copyright (c) 2014 Bike Path. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
#import <GoogleMaps/GoogleMaps.h>
@interface SearchItem : NSObject
@property NSString *searchQuery;
@property CLLocationDegrees lati;
@property CLLocationDegrees longi;
@property CLLocationCoordinate2D position;
@property (readonly) NSDate *creationDate;
@end
|
//
// SearchItem.h
// bikepath
//
// Created by Farheen Malik on 8/15/14.
// Copyright (c) 2014 Bike Path. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
#import <GoogleMaps/GoogleMaps.h>
@interface SearchItem : NSObject
@property NSString *searchQuery;
@property CLLocationDegrees lati;
@property CLLocationDegrees longi;
@property CLLocationCoordinate2D position;
@property NSString *address;
@property (readonly) NSDate *creationDate;
@end
|
Add address as property of Search Item object
|
Add address as property of Search Item object
|
C
|
apache-2.0
|
red-spotted-newts-2014/bike-path,hushifei/bike-path,red-spotted-newts-2014/bike-path
|
10e6aefe5410267b5998df8417a16a1674e2f12b
|
src/modtypes/socket.h
|
src/modtypes/socket.h
|
#pragma once
#include "../main.h"
class Socket {
public:
virtual ~Socket() {}
virtual unsigned int apiVersion() = 0;
virtual void connect(const std::string& server, const std::string& port, const std::string& bind = "") {}
virtual std::string receive() { return ""; }
virtual void send(const std::string& data) {}
virtual void closeConnection() {}
bool isConnected() { return connected; }
protected:
bool connected;
};
|
#pragma once
#include "../main.h"
class Socket {
public:
virtual ~Socket() {}
virtual unsigned int apiVersion() = 0;
virtual void connect(const std::string& server, const std::string& port, const std::string& bindAddr = "") {}
virtual std::string receive() { return ""; }
virtual void send(const std::string& data) {}
virtual void closeConnection() {}
bool isConnected() { return connected; }
protected:
bool connected;
};
|
Rename parameter to not be the same as the name of the function that does it
|
Rename parameter to not be the same as the name of the function that does it
|
C
|
mit
|
ElementalAlchemist/RoBoBo,ElementalAlchemist/RoBoBo
|
7bab840edb4a175eaa914e9fecbe8811d60e5d7e
|
Core/Code/Testing/mitkRenderingTestHelper.h
|
Core/Code/Testing/mitkRenderingTestHelper.h
|
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date: 2010-03-31 17:34:48 +0200 (Wed, 31 Mar 2010) $
Version: $Revision: 21985 $
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef mitkRenderingTestHelper_h
#define mitkRenderingTestHelper_h
#include <string>
#include <vtkSmartPointer.h>
#include <vtkRenderWindow.h>
#include <mitkRenderWindow.h>
class vtkRenderWindow;
class vtkRenderer;
namespace mitk
{
class DataStorage;
}
class MITK_CORE_EXPORT mitkRenderingTestHelper
{
public:
mitkRenderingTestHelper(int width, int height, mitk::DataStorage* ds);
~mitkRenderingTestHelper();
vtkRenderer* GetVtkRenderer();
vtkRenderWindow* GetVtkRenderWindow();
void SaveAsPNG(std::string fileName);
protected:
mitk::RenderWindow::Pointer m_RenderWindow;
};
#endif
|
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date: 2010-03-31 17:34:48 +0200 (Wed, 31 Mar 2010) $
Version: $Revision: 21985 $
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef mitkRenderingTestHelper_h
#define mitkRenderingTestHelper_h
#include <string>
#include <vtkSmartPointer.h>
#include <vtkRenderWindow.h>
#include <mitkRenderWindow.h>
class vtkRenderWindow;
class vtkRenderer;
namespace mitk
{
class DataStorage;
}
class mitkRenderingTestHelper
{
public:
mitkRenderingTestHelper(int width, int height, mitk::DataStorage* ds);
~mitkRenderingTestHelper();
vtkRenderer* GetVtkRenderer();
vtkRenderWindow* GetVtkRenderWindow();
void SaveAsPNG(std::string fileName);
protected:
mitk::RenderWindow::Pointer m_RenderWindow;
};
#endif
|
Fix linker warnings in rendering tests
|
Fix linker warnings in rendering tests
|
C
|
bsd-3-clause
|
fmilano/mitk,NifTK/MITK,NifTK/MITK,NifTK/MITK,rfloca/MITK,danielknorr/MITK,nocnokneo/MITK,rfloca/MITK,MITK/MITK,nocnokneo/MITK,RabadanLab/MITKats,lsanzdiaz/MITK-BiiG,rfloca/MITK,danielknorr/MITK,lsanzdiaz/MITK-BiiG,fmilano/mitk,RabadanLab/MITKats,iwegner/MITK,fmilano/mitk,MITK/MITK,nocnokneo/MITK,lsanzdiaz/MITK-BiiG,rfloca/MITK,NifTK/MITK,MITK/MITK,RabadanLab/MITKats,lsanzdiaz/MITK-BiiG,iwegner/MITK,lsanzdiaz/MITK-BiiG,nocnokneo/MITK,NifTK/MITK,lsanzdiaz/MITK-BiiG,MITK/MITK,danielknorr/MITK,iwegner/MITK,MITK/MITK,RabadanLab/MITKats,fmilano/mitk,fmilano/mitk,nocnokneo/MITK,nocnokneo/MITK,danielknorr/MITK,RabadanLab/MITKats,danielknorr/MITK,lsanzdiaz/MITK-BiiG,MITK/MITK,lsanzdiaz/MITK-BiiG,iwegner/MITK,rfloca/MITK,danielknorr/MITK,iwegner/MITK,NifTK/MITK,iwegner/MITK,rfloca/MITK,rfloca/MITK,fmilano/mitk,danielknorr/MITK,fmilano/mitk,RabadanLab/MITKats,nocnokneo/MITK
|
73aef2d1d8a0fe417df1ab4a35029be74891ee37
|
src/gallium/winsys/sw/hgl/hgl_sw_winsys.h
|
src/gallium/winsys/sw/hgl/hgl_sw_winsys.h
|
/**************************************************************************
*
* Copyright 2009 Artur Wyszynski <harakash@gmail.com>
* Copyright 2013 Alexander von Gluck IV <kallisti5@unixzen.com>
*
* 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, sub license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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.
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
**************************************************************************/
#ifndef _HGL_SOFTWAREWINSYS_H
#define _HGL_SOFTWAREWINSYS_H
struct sw_winsys;
struct sw_winsys* hgl_create_sw_winsys(void);
#endif
|
/**************************************************************************
*
* Copyright 2009 Artur Wyszynski <harakash@gmail.com>
* Copyright 2013 Alexander von Gluck IV <kallisti5@unixzen.com>
*
* 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, sub license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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.
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
**************************************************************************/
#ifndef _HGL_SOFTWAREWINSYS_H
#define _HGL_SOFTWAREWINSYS_H
#ifdef __cplusplus
extern "C" {
#endif
struct sw_winsys;
struct sw_winsys* hgl_create_sw_winsys(void);
#ifdef __cplusplus
}
#endif
#endif
|
Add needed extern "C" to hgl winsys
|
winsys/hgl: Add needed extern "C" to hgl winsys
Reviewed-by: Brian Paul <3cb4e1df5ec4da2c7c4af7c52cec8cf340a55a10@vmware.com>
|
C
|
mit
|
metora/MesaGLSLCompiler,metora/MesaGLSLCompiler,metora/MesaGLSLCompiler
|
7f728dc9ea358c56458b5145bc8e78006fca190d
|
build/config/ios/WeaveProjectConfig.h
|
build/config/ios/WeaveProjectConfig.h
|
/*
*
* Copyright (c) 2016-2017 Nest Labs, Inc.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* Project-specific configuration file for iOS builds.
*
*/
#ifndef WEAVEPROJECTCONFIG_H
#define WEAVEPROJECTCONFIG_H
#endif /* WEAVEPROJECTCONFIG_H */
|
/*
*
* Copyright (c) 2016-2017 Nest Labs, Inc.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* Project-specific configuration file for iOS builds.
*
*/
#ifndef WEAVEPROJECTCONFIG_H
#define WEAVEPROJECTCONFIG_H
#define INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT 0
#endif /* WEAVEPROJECTCONFIG_H */
|
Disable unsupported Inet configuration breaking iOS integration.
|
Disable unsupported Inet configuration breaking iOS integration.
For a yet-unknown reason, trying to read the TCP Tx buffer with ioctl on iOS fails with ENXIO. Since this code was written primarily for embedded Linux platforms, and is not needed for mobile clients, this CL turns off that bit of code for iOS builds.
|
C
|
apache-2.0
|
openweave/openweave-core,openweave/openweave-core,openweave/openweave-core,openweave/openweave-core,openweave/openweave-core,openweave/openweave-core
|
f7ec6e5c53d147637fafde9d908b9f24814ecce5
|
Settings/Updater/UpdaterWindow.h
|
Settings/Updater/UpdaterWindow.h
|
#pragma once
#include "../3RVX/Window.h"
class NotifyIcon;
class Settings;
class UpdaterWindow : public Window {
public:
UpdaterWindow();
~UpdaterWindow();
void DoModal();
private:
HICON _smallIcon;
HICON _largeIcon;
NotifyIcon *_notifyIcon;
HMENU _menu;
UINT _menuFlags;
Settings *_settings;
std::pair<int, int> _version;
std::wstring _versionString;
void InstallUpdate();
virtual LRESULT WndProc(HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
public:
static const int MENU_INSTALL = 0;
static const int MENU_IGNORE = 1;
static const int MENU_REMIND = 2;
};
|
#pragma once
#include "../../3RVX/Window.h"
#include "Version.h"
class NotifyIcon;
class Settings;
class UpdaterWindow : public Window {
public:
UpdaterWindow();
~UpdaterWindow();
void DoModal();
private:
HICON _smallIcon;
HICON _largeIcon;
NotifyIcon *_notifyIcon;
HMENU _menu;
UINT _menuFlags;
Settings *_settings;
Version _version;
void InstallUpdate();
virtual LRESULT WndProc(HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
public:
static const int MENU_INSTALL = 0;
static const int MENU_IGNORE = 1;
static const int MENU_REMIND = 2;
};
|
Clean up instance variables and imports
|
Clean up instance variables and imports
|
C
|
bsd-2-clause
|
malensek/3RVX,malensek/3RVX,malensek/3RVX
|
a77e006fa0a5c215e4b48a21e70dd323d165a5b4
|
test/CodeGen/2004-06-17-UnorderedCompares.c
|
test/CodeGen/2004-06-17-UnorderedCompares.c
|
// RUN: %clang_cc1 -std=c99 %s -emit-llvm -o - | grep -v llvm.isunordered | not grep call
_Bool A, B, C, D, E, F;
void TestF(float X, float Y) {
A = __builtin_isgreater(X, Y);
B = __builtin_isgreaterequal(X, Y);
C = __builtin_isless(X, Y);
D = __builtin_islessequal(X, Y);
E = __builtin_islessgreater(X, Y);
F = __builtin_isunordered(X, Y);
}
void TestD(double X, double Y) {
A = __builtin_isgreater(X, Y);
B = __builtin_isgreaterequal(X, Y);
C = __builtin_isless(X, Y);
D = __builtin_islessequal(X, Y);
E = __builtin_islessgreater(X, Y);
F = __builtin_isunordered(X, Y);
}
|
// RUN: %clang_cc1 -std=c99 %s -emit-llvm -o - | FileCheck %s
// CHECK: @Test
// CHECK-NOT: call
_Bool A, B, C, D, E, F;
void TestF(float X, float Y) {
A = __builtin_isgreater(X, Y);
B = __builtin_isgreaterequal(X, Y);
C = __builtin_isless(X, Y);
D = __builtin_islessequal(X, Y);
E = __builtin_islessgreater(X, Y);
F = __builtin_isunordered(X, Y);
}
void TestD(double X, double Y) {
A = __builtin_isgreater(X, Y);
B = __builtin_isgreaterequal(X, Y);
C = __builtin_isless(X, Y);
D = __builtin_islessequal(X, Y);
E = __builtin_islessgreater(X, Y);
F = __builtin_isunordered(X, Y);
}
|
Remove pathname dependence. Also rewrite test to use FileCheck at the same time.
|
Remove pathname dependence. Also rewrite test to use FileCheck
at the same time.
Patch by David Callahan.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@226331 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
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,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
|
3eec82ff013efb8ecd9a40fd58173e28331fe3d9
|
test2/code_gen/deref_reg.c
|
test2/code_gen/deref_reg.c
|
// RUN: %ucc -DFIRST -S -o- %s | grep -F 'movl (%%rax), %%eax'
// RUN: %ucc -DSECOND -S -o- %s | grep -F 'movl 4(%%rbx), %%ebx'
#ifdef FIRST
f(int *p)
{
return *p;
// should see that p isn't used after/.retains==1 and not create a new reg,
// but re-use the current
}
#elif defined(SECOND)
struct A
{
int i, j;
};
g(struct A *p)
{
return p->i + p->j;
}
#else
# error neither
#endif
|
// RUN: %ucc -DFIRST -S -o- %s | grep -F 'movl (%%rax), %%eax'
// RUN: %ucc -DSECOND -S -o- %s | grep -F 'movl 4(%%rcx), %%ecx'
#ifdef FIRST
f(int *p)
{
return *p;
// should see that p isn't used after/.retains==1 and not create a new reg,
// but re-use the current
}
#elif defined(SECOND)
struct A
{
int i, j;
};
g(struct A *p)
{
return p->i + p->j;
}
#else
# error neither
#endif
|
Change test now %ebx is callee-save
|
Change test now %ebx is callee-save
|
C
|
mit
|
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
|
4a4095c360fc29f766e8baba3529a78b6d736b19
|
json-glib/json-glib.h
|
json-glib/json-glib.h
|
#ifndef __JSON_GLIB_H__
#define __JSON_GLIB_H__
#include <json-glib/json-types.h>
#include <json-glib/json-generator.h>
#include <json-glib/json-parser.h>
#include <json-glib/json-version.h>
#endif /* __JSON_GLIB_H__ */
|
#ifndef __JSON_GLIB_H__
#define __JSON_GLIB_H__
#include <json-glib/json-types.h>
#include <json-glib/json-scanner.h>
#include <json-glib/json-generator.h>
#include <json-glib/json-parser.h>
#include <json-glib/json-version.h>
#endif /* __JSON_GLIB_H__ */
|
Add json-scanner.h to the exported headers
|
Add json-scanner.h to the exported headers
|
C
|
lgpl-2.1
|
robtaylor/json-glib-gvariant,GNOME/json-glib,frida/json-glib,ebassi/json-glib,oerdnj/json-glib,oerdnj/json-glib,Distrotech/json-glib,ebassi/json-glib,robtaylor/json-glib-gvariant,ebassi/json-glib,oerdnj/json-glib,Distrotech/json-glib,GNOME/json-glib,brauliobo/json-glib,oerdnj/json-glib,frida/json-glib,brauliobo/json-glib,brauliobo/json-glib,Distrotech/json-glib
|
81c02ef3db6901655f8a7117e5e2675d37096daf
|
json-glib/json-glib.h
|
json-glib/json-glib.h
|
#ifndef __JSON_GLIB_H__
#define __JSON_GLIB_H__
#include <json-glib/json-types.h>
#include <json-glib/json-scanner.h>
#include <json-glib/json-generator.h>
#include <json-glib/json-parser.h>
#include <json-glib/json-version.h>
#include <json-glib/json-enum-types.h>
#endif /* __JSON_GLIB_H__ */
|
#ifndef __JSON_GLIB_H__
#define __JSON_GLIB_H__
#include <json-glib/json-types.h>
#include <json-glib/json-generator.h>
#include <json-glib/json-parser.h>
#include <json-glib/json-version.h>
#include <json-glib/json-enum-types.h>
#endif /* __JSON_GLIB_H__ */
|
Remove the include for json-scanner.h
|
Remove the include for json-scanner.h
The json-scanner.h header file is not shipped with JSON-GLib anymore.
|
C
|
lgpl-2.1
|
Distrotech/json-glib,GNOME/json-glib,brauliobo/json-glib,ebassi/json-glib,oerdnj/json-glib,Distrotech/json-glib,frida/json-glib,GNOME/json-glib,robtaylor/json-glib-gvariant,oerdnj/json-glib,robtaylor/json-glib-gvariant,brauliobo/json-glib,ebassi/json-glib,oerdnj/json-glib,oerdnj/json-glib,frida/json-glib,brauliobo/json-glib,ebassi/json-glib,Distrotech/json-glib
|
4024adee156f12bbeb884c5a2c5ea1af1c108b5a
|
test/test_chip8.c
|
test/test_chip8.c
|
#include <assert.h>
#include "../src/chip8.c"
void test_clear_screen(void) {
int i;
chip8_t * chip8 = chip8_new();
chip8->memory[0x200] = 0x00;
chip8->memory[0x201] = 0xE0;
chip8_fetch_current_opcode(chip8);
chip8_decode_current_opcode(chip8);
i = 0;
while (i < 64 * 32) {
assert(chip8->memory[i++] == 0);
}
}
void test_instruction_jump(void) {
chip8_t * chip8 = chip8_new();
chip8->memory[0x200] = 0x11;
chip8->memory[0x201] = 0x23;
chip8_fetch_current_opcode(chip8);
chip8_decode_current_opcode(chip8);
assert(chip8->program_counter == 0x123);
}
int main(int argc, char ** argv) {
test_clear_screen();
test_instruction_jump();
}
|
#include <assert.h>
#include "../src/chip8.c"
void test_clear_screen(void) {
int i;
chip8_t * chip8 = chip8_new();
chip8->memory[0x200] = 0x00;
chip8->memory[0x201] = 0xE0;
chip8_fetch_current_opcode(chip8);
chip8_decode_current_opcode(chip8);
i = 0;
while (i < 64 * 32) {
assert(chip8->memory[i++] == 0);
}
}
void test_instruction_jump(void) {
chip8_t * chip8 = chip8_new();
chip8->memory[0x200] = 0x11;
chip8->memory[0x201] = 0x23;
chip8_fetch_current_opcode(chip8);
chip8_decode_current_opcode(chip8);
assert(chip8->program_counter == 0x123);
}
int main(int argc, char ** argv) {
test_clear_screen();
test_instruction_jump();
return 0;
}
|
Exit the tests with success if they aren't failing
|
Exit the tests with success if they aren't failing
|
C
|
mit
|
gsamokovarov/chip8.c,gsamokovarov/chip8.c
|
b09bd3d3896c448f8817ee7515e3af0314605ab1
|
plrCommon/plrCompare.c
|
plrCommon/plrCompare.c
|
#include "plrCompare.h"
int plrC_compareArgs(const syscallArgs_t *args1, const syscallArgs_t *args2) {
int foundDiff = 0;
if (args1->addr != args2->addr) { foundDiff = 1; }
else if (args1->arg[0] != args2->arg[0]) { foundDiff = 2; }
else if (args1->arg[1] != args2->arg[1]) { foundDiff = 3; }
else if (args1->arg[2] != args2->arg[2]) { foundDiff = 4; }
else if (args1->arg[3] != args2->arg[3]) { foundDiff = 5; }
else if (args1->arg[4] != args2->arg[4]) { foundDiff = 6; }
else if (args1->arg[5] != args2->arg[5]) { foundDiff = 7; }
return foundDiff;
}
|
#include "plrCompare.h"
#include <stdio.h>
int plrC_compareArgs(const syscallArgs_t *args1, const syscallArgs_t *args2) {
int faultVal = 0;
#define CompareElement(elem, faultBit) \
if (args1->elem != args2->elem) { \
faultVal |= 1 << faultBit; \
printf("Argument miscompare in " #elem ", 0x%lX != 0x%lX\n", \
(unsigned long)args1->elem, (unsigned long)args2->elem); \
}
CompareElement(addr, 0);
CompareElement(arg[0], 1);
CompareElement(arg[1], 2);
CompareElement(arg[2], 3);
CompareElement(arg[3], 4);
CompareElement(arg[4], 5);
CompareElement(arg[5], 6);
return faultVal;
}
|
Add logging to syscall arg compare for debugging purposes
|
Add logging to syscall arg compare for debugging purposes
|
C
|
mit
|
apogeedev/plr,apogeedev/plr
|
e1e5b704393cc348af07e62e1ec69521f9a6ab9e
|
src/simply/simply_window_stack.h
|
src/simply/simply_window_stack.h
|
#pragma once
#include "simply_window.h"
#include "simply_msg.h"
#include "simply.h"
#include "util/sdk.h"
#include <pebble.h>
typedef struct SimplyWindowStack SimplyWindowStack;
struct SimplyWindowStack {
Simply *simply;
#ifdef PBL_SDK_2
Window *pusher;
#endif
bool is_showing:1;
bool is_hiding:1;
};
SimplyWindowStack *simply_window_stack_create(Simply *simply);
void simply_window_stack_destroy(SimplyWindowStack *self);
bool simply_window_stack_set_broadcast(bool broadcast);
SimplyWindow *simply_window_stack_get_top_window(Simply *simply);
void simply_window_stack_show(SimplyWindowStack *self, SimplyWindow *window, bool is_push);
void simply_window_stack_pop(SimplyWindowStack *self, SimplyWindow *window);
void simply_window_stack_back(SimplyWindowStack *self, SimplyWindow *window);
void simply_window_stack_send_show(SimplyWindowStack *self, SimplyWindow *window);
void simply_window_stack_send_hide(SimplyWindowStack *self, SimplyWindow *window);
bool simply_window_stack_handle_packet(Simply *simply, Packet *packet);
|
#pragma once
#include "simply_window.h"
#include "simply_msg.h"
#include "simply.h"
#include "util/sdk.h"
#include <pebble.h>
typedef struct SimplyWindowStack SimplyWindowStack;
struct SimplyWindowStack {
Simply *simply;
SDK_SELECT(NONE, Window *pusher);
bool is_showing:1;
bool is_hiding:1;
};
SimplyWindowStack *simply_window_stack_create(Simply *simply);
void simply_window_stack_destroy(SimplyWindowStack *self);
bool simply_window_stack_set_broadcast(bool broadcast);
SimplyWindow *simply_window_stack_get_top_window(Simply *simply);
void simply_window_stack_show(SimplyWindowStack *self, SimplyWindow *window, bool is_push);
void simply_window_stack_pop(SimplyWindowStack *self, SimplyWindow *window);
void simply_window_stack_back(SimplyWindowStack *self, SimplyWindow *window);
void simply_window_stack_send_show(SimplyWindowStack *self, SimplyWindow *window);
void simply_window_stack_send_hide(SimplyWindowStack *self, SimplyWindow *window);
bool simply_window_stack_handle_packet(Simply *simply, Packet *packet);
|
Use SDK_SELECT for the window stack pusher member field
|
Use SDK_SELECT for the window stack pusher member field
|
C
|
mit
|
frizzr/CatchOneBus,youtux/PebbleShows,fletchto99/pebblejs,carlo-colombo/dublin-bus-pebble,ishepard/TransmissionTorrent,ishepard/TransmissionTorrent,frizzr/CatchOneBus,carlo-colombo/dublin-bus-pebble,pebble/pebblejs,ento/pebblejs,demophoon/Trimet-Tracker,carlo-colombo/dublin-bus-pebble,gwijsman/OpenRemotePebble,youtux/PebbleShows,jsfi/pebblejs,youtux/pebblejs,youtux/pebblejs,pebble/pebblejs,sunshineyyy/CatchOneBus,sunshineyyy/CatchOneBus,gwijsman/OpenRemotePebble,demophoon/Trimet-Tracker,effata/pebblejs,youtux/pebblejs,daduke/LMSController,bkbilly/Tvheadend-EPG,demophoon/Trimet-Tracker,frizzr/CatchOneBus,pebble/pebblejs,fletchto99/pebblejs,daduke/LMSController,bkbilly/Tvheadend-EPG,jiangege/pebblejs-project,youtux/PebbleShows,youtux/PebbleShows,fletchto99/pebblejs,jsfi/pebblejs,daduke/LMSController,jiangege/pebblejs-project,gwijsman/OpenRemotePebble,bkbilly/Tvheadend-EPG,pebble/pebblejs,sunshineyyy/CatchOneBus,effata/pebblejs,bkbilly/Tvheadend-EPG,daduke/LMSController,gwijsman/OpenRemotePebble,fletchto99/pebblejs,sunshineyyy/CatchOneBus,bkbilly/Tvheadend-EPG,daduke/LMSController,jiangege/pebblejs-project,gwijsman/OpenRemotePebble,carlo-colombo/dublin-bus-pebble,ento/pebblejs,ishepard/TransmissionTorrent,jsfi/pebblejs,effata/pebblejs,carlo-colombo/dublin-bus-pebble,fletchto99/pebblejs,pebble/pebblejs,ishepard/TransmissionTorrent,jiangege/pebblejs-project,sunshineyyy/CatchOneBus,youtux/pebblejs,effata/pebblejs,demophoon/Trimet-Tracker,ento/pebblejs,effata/pebblejs,jsfi/pebblejs,jiangege/pebblejs-project,ento/pebblejs,youtux/pebblejs,frizzr/CatchOneBus,demophoon/Trimet-Tracker,jsfi/pebblejs,ishepard/TransmissionTorrent,ento/pebblejs
|
b8aff13260f0ed1de59387e899cb65b75a10c3c9
|
src/compat/libc/string/inhibit_libcall.h
|
src/compat/libc/string/inhibit_libcall.h
|
/**
* @file
* @brief
*
* @author Anton Kozlov
* @date 21.07.2015
*/
#ifndef STR_INHIBIT_LIBCALL_H_
#define STR_INHIBIT_LIBCALL_H_
/* FIXME __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
* can be not supported in cross-compiler
*/
#define HAVE_CC_INHIBIT_LOOP_TO_LIBCALL 1
#ifdef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
# define inhibit_loop_to_libcall \
__attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
#else
# define inhibit_loop_to_libcall
#endif
#endif /* STR_INHIBIT_LIBCALL_H_ */
|
/**
* @file
* @brief
*
* @author Anton Kozlov
* @date 21.07.2015
*/
#ifndef STR_INHIBIT_LIBCALL_H_
#define STR_INHIBIT_LIBCALL_H_
/* FIXME __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
* can be not supported in cross-compiler
*/
#ifndef __e2k__
#define HAVE_CC_INHIBIT_LOOP_TO_LIBCALL 1
#endif /* __e2k__ */
#ifdef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
# define inhibit_loop_to_libcall \
__attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
#else
# define inhibit_loop_to_libcall
#endif
#endif /* STR_INHIBIT_LIBCALL_H_ */
|
Fix inhibit_loop_to_libcall compilation on e2k
|
compat: Fix inhibit_loop_to_libcall compilation on e2k
|
C
|
bsd-2-clause
|
embox/embox,embox/embox,embox/embox,embox/embox,embox/embox,embox/embox
|
259598230240544af945254ed834a32eebec2608
|
Pod/Classes/Utils/UIColor+HKHex.h
|
Pod/Classes/Utils/UIColor+HKHex.h
|
//
// UIColor+HKHex.h
// HKProjectBase-Sample
//
// Created by Harley.xk on 15/8/26.
// Copyright (c) 2015年 Harley.xk. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIColor (HKHex)
+ (UIColor *)colorWithHexString:(NSString *)hexString;
+ (UIColor *)colorWithHexString:(NSString *)hexString alpha:(CGFloat)alpha;
@end
|
//
// UIColor+HKHex.h
// HKProjectBase-Sample
//
// Created by Harley.xk on 15/8/26.
// Copyright (c) 2015年 Harley.xk. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIColor (HKHex)
/**
* 使用16进制字符串创建颜色
*
* @param hexString 16进制字符串,可以是 0XFFFFFF/#FFFFFF/FFFFFF 三种格式之一
*
* @return 返回创建的UIColor对象
*/
+ (UIColor *)colorWithHexString:(NSString *)hexString;
+ (UIColor *)colorWithHexString:(NSString *)hexString alpha:(CGFloat)alpha;
@end
|
Add comment to Hex color category
|
Add comment to Hex color category
|
C
|
mit
|
Harley-xk/HKProjectBase,Harley-xk/HKProjectBase,Harley-xk/HKProjectBase
|
21b2d73ef61e40b611792ce772a774438b2f459d
|
src/ConfigFileReader.h
|
src/ConfigFileReader.h
|
#pragma once
#include <iostream>
#include <fstream>
#include <string>
#include <unordered_map>
#include <algorithm>
//#include <locale>
class ConfigFileReader
{
public:
ConfigFileReader(const char* file_name);
std::string find(std::string key);
private:
std::ifstream iniFile;
std::unordered_map<std::string, std::string> hashmap;
};
|
#pragma once
#include <iostream>
#include <fstream>
#include <string>
#include <unordered_map>
#include <algorithm>
class ConfigFileReader
{
public:
ConfigFileReader(const char* file_name);
std::string find(std::string key);
private:
std::ifstream iniFile;
std::unordered_map<std::string, std::string> hashmap;
};
|
Remove unnecessary includes and newlines
|
Remove unnecessary includes and newlines
|
C
|
agpl-3.0
|
UCSolarCarTeam/Schulich-Delta-OnBoard-Media-Control,UCSolarCarTeam/Schulich-Delta-OnBoard-Media-Control
|
412799711a2b6ae29c865159df88e0bbe19fd2df
|
src/lib/str-sanitize.c
|
src/lib/str-sanitize.c
|
/* Copyright (c) 2004 Timo Sirainen */
#include "lib.h"
#include "str.h"
#include "str-sanitize.h"
void str_sanitize_append(string_t *dest, const char *src, size_t max_len)
{
const char *p;
for (p = src; *p != '\0'; p++) {
if ((unsigned char)*p < 32)
break;
}
str_append_n(dest, src, (size_t)(p - src));
for (; *p != '\0' && max_len > 0; p++, max_len--) {
if ((unsigned char)*p < 32)
str_append_c(dest, '?');
else
str_append_c(dest, *p);
}
if (*p != '\0') {
str_truncate(dest, str_len(dest)-3);
str_append(dest, "...");
}
}
const char *str_sanitize(const char *src, size_t max_len)
{
string_t *str;
str = t_str_new(I_MIN(max_len, 256));
str_sanitize_append(str, src, max_len);
return str_c(str);
}
|
/* Copyright (c) 2004 Timo Sirainen */
#include "lib.h"
#include "str.h"
#include "str-sanitize.h"
void str_sanitize_append(string_t *dest, const char *src, size_t max_len)
{
const char *p;
for (p = src; *p != '\0'; p++) {
if (((unsigned char)*p & 0x7f) < 32)
break;
}
str_append_n(dest, src, (size_t)(p - src));
for (; *p != '\0' && max_len > 0; p++, max_len--) {
if (((unsigned char)*p & 0x7f) < 32)
str_append_c(dest, '?');
else
str_append_c(dest, *p);
}
if (*p != '\0') {
str_truncate(dest, str_len(dest)-3);
str_append(dest, "...");
}
}
const char *str_sanitize(const char *src, size_t max_len)
{
string_t *str;
str = t_str_new(I_MIN(max_len, 256));
str_sanitize_append(str, src, max_len);
return str_c(str);
}
|
Convert also 0x80..0x9f characters to '?'
|
Convert also 0x80..0x9f characters to '?'
|
C
|
mit
|
damoxc/dovecot,damoxc/dovecot,damoxc/dovecot,damoxc/dovecot,damoxc/dovecot
|
a42c50b4ccc19c05ccf6dd1fa066677eea12ee6a
|
src/host/os_copyfile.c
|
src/host/os_copyfile.c
|
/**
* \file os_copyfile.c
* \brief Copy a file from one location to another.
* \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
*/
#include <stdlib.h>
#include "premake.h"
int os_copyfile(lua_State* L)
{
int z;
const char* src = luaL_checkstring(L, 1);
const char* dst = luaL_checkstring(L, 2);
#if PLATFORM_WINDOWS
z = CopyFileA(src, dst, FALSE);
#else
lua_pushfstring(L, "cp %s %s", src, dst);
z = (system(lua_tostring(L, -1)) == 0);
#endif
if (!z)
{
lua_pushnil(L);
lua_pushfstring(L, "unable to copy file to '%s'", dst);
return 2;
}
else
{
lua_pushboolean(L, 1);
return 1;
}
}
|
/**
* \file os_copyfile.c
* \brief Copy a file from one location to another.
* \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
*/
#include <stdlib.h>
#include "premake.h"
int os_copyfile(lua_State* L)
{
int z;
const char* src = luaL_checkstring(L, 1);
const char* dst = luaL_checkstring(L, 2);
#if PLATFORM_WINDOWS
z = CopyFileA(src, dst, FALSE);
#else
lua_pushfstring(L, "cp \"%s\" \"%s\"", src, dst);
z = (system(lua_tostring(L, -1)) == 0);
#endif
if (!z)
{
lua_pushnil(L);
lua_pushfstring(L, "unable to copy file to '%s'", dst);
return 2;
}
else
{
lua_pushboolean(L, 1);
return 1;
}
}
|
Fix os.copyfile with spaces in argument paths.
|
Host/Posix: Fix os.copyfile with spaces in argument paths.
|
C
|
bsd-3-clause
|
tvandijck/premake-core,Zefiros-Software/premake-core,noresources/premake-core,sleepingwit/premake-core,xriss/premake-core,LORgames/premake-core,mendsley/premake-core,bravnsgaard/premake-core,LORgames/premake-core,noresources/premake-core,jstewart-amd/premake-core,LORgames/premake-core,dcourtois/premake-core,tvandijck/premake-core,premake/premake-core,TurkeyMan/premake-core,resetnow/premake-core,Blizzard/premake-core,aleksijuvani/premake-core,xriss/premake-core,TurkeyMan/premake-core,Blizzard/premake-core,tvandijck/premake-core,sleepingwit/premake-core,bravnsgaard/premake-core,mandersan/premake-core,CodeAnxiety/premake-core,starkos/premake-core,LORgames/premake-core,CodeAnxiety/premake-core,dcourtois/premake-core,resetnow/premake-core,starkos/premake-core,noresources/premake-core,mandersan/premake-core,starkos/premake-core,Zefiros-Software/premake-core,jstewart-amd/premake-core,TurkeyMan/premake-core,xriss/premake-core,mendsley/premake-core,mendsley/premake-core,CodeAnxiety/premake-core,premake/premake-core,aleksijuvani/premake-core,premake/premake-core,tvandijck/premake-core,aleksijuvani/premake-core,dcourtois/premake-core,dcourtois/premake-core,Zefiros-Software/premake-core,Blizzard/premake-core,noresources/premake-core,CodeAnxiety/premake-core,aleksijuvani/premake-core,dcourtois/premake-core,resetnow/premake-core,Blizzard/premake-core,jstewart-amd/premake-core,CodeAnxiety/premake-core,jstewart-amd/premake-core,premake/premake-core,sleepingwit/premake-core,Zefiros-Software/premake-core,soundsrc/premake-core,sleepingwit/premake-core,noresources/premake-core,mendsley/premake-core,resetnow/premake-core,xriss/premake-core,soundsrc/premake-core,premake/premake-core,starkos/premake-core,resetnow/premake-core,premake/premake-core,starkos/premake-core,soundsrc/premake-core,lizh06/premake-core,mandersan/premake-core,lizh06/premake-core,bravnsgaard/premake-core,premake/premake-core,lizh06/premake-core,lizh06/premake-core,Blizzard/premake-core,soundsrc/premake-core,soundsrc/premake-core,bravnsgaard/premake-core,aleksijuvani/premake-core,TurkeyMan/premake-core,xriss/premake-core,noresources/premake-core,jstewart-amd/premake-core,starkos/premake-core,bravnsgaard/premake-core,Zefiros-Software/premake-core,LORgames/premake-core,dcourtois/premake-core,mandersan/premake-core,dcourtois/premake-core,Blizzard/premake-core,mandersan/premake-core,TurkeyMan/premake-core,sleepingwit/premake-core,tvandijck/premake-core,noresources/premake-core,mendsley/premake-core,starkos/premake-core
|
58d8ac057e53be1a71a519fe4db7d83e7cf8056a
|
submission_test/Role.h
|
submission_test/Role.h
|
#ifndef ROLE_H_
#define ROLE_H_
#include "State.h"
class Role{
public:
State& state;
int x,y;
Role(State _state, int _id = 0, int _x = 0, int _y = 0) : state(_state), id(_id), x(_x), y(_y) {}
int getID(){
return id;
}
virtual void move() = 0;
private:
//changing id is impossible
int id;
};
#endif
|
#ifndef ROLE_H_
#define ROLE_H_
#include "State.h"
#include "Location.h"
#include <vector>
// this class is partial abstract
class Role {
public:
// reference to the main state
State& state;
// neighbors
std::vector<int> neighbors;
private:
// position of the ant
int x, y;
// ant's id
int id;
public:
// -- virtual functions that will be implemented separately
// communicate
virtual void receive ( int msg ) {
// do nothing
}
// action move
virtual int move() = 0;
void run(void) const {
int result = move();
if ( 0 < result and result < TDIRECTION ) {
state.makeMove( getLocation(), result );
}
}
// helper functions
// return location of the ant
Location getLocation(void) const {
return Location( x, y );
}
// return the id of the ant
int getID() const {
return id;
}
// constructor
Role(State _state, int _id = 0, int _x = 0, int _y = 0) : state(_state), id(_id), x(_x), y(_y) {}
};
#endif
|
Add more features ( made it more functional )
|
Add more features ( made it more functional )
|
C
|
mit
|
KorlaMarch/Ant-bot,KorlaMarch/Ant-bot,KorlaMarch/Ant-bot,KorlaMarch/Ant-bot,KorlaMarch/Ant-bot,KorlaMarch/Ant-bot,KorlaMarch/Ant-bot
|
d569c69ea1a361ada0e09f2c58bd611b686d82e9
|
modules/dcc_chat.h
|
modules/dcc_chat.h
|
class dccChat : public Module {
public:
void onDCCReceive(std::string dccid, std::string message);
};
class dccSender : public Module {
public:
void dccSend(std::string dccid, std::string message);
};
|
class dccChat : public Module {
public:
virtual void onDCCReceive(std::string dccid, std::string message);
};
class dccSender : public Module {
public:
virtual void dccSend(std::string dccid, std::string message);
virtual bool hookDCCMessage(std::string modName, std::string hookMsg);
};
|
Fix those functions not being virtual.
|
Fix those functions not being virtual.
|
C
|
mit
|
ElementalAlchemist/RoBoBo,ElementalAlchemist/RoBoBo
|
dadb6d44743b45f60dc95d833b22f3de1e6dbd7d
|
qtcreator/cutelyst/classes/controller.h
|
qtcreator/cutelyst/classes/controller.h
|
%{Cpp:LicenseTemplate}\
#ifndef %{GUARD}
#define %{GUARD}
#include <Cutelyst/Controller>
%{JS: Cpp.openNamespaces('%{Class}')}\
using namespace Cutelyst;
class %{CN} : public Controller
{
Q_OBJECT
@if %{CustomNamespace}
C_NAMESPACE("%{CustomNamespaceValue}")
@endif
public:
explicit %{CN}(QObject *parent = 0);
C_ATTR(index, :Path)
void index(Context *c);
private Q_SLOTS:
@if %{BeginMethod}
bool Begin(Context *c) override;
@endif
@if %{AutoMethod}
bool Auto(Context *c) override;
@endif
@if %{EndMethod}
bool End(Context *c) override;
@endif
};
%{JS: Cpp.closeNamespaces('%{Class}')}
#endif // %{GUARD}\
|
%{Cpp:LicenseTemplate}\
#ifndef %{GUARD}
#define %{GUARD}
#include <Cutelyst/Controller>
%{JS: Cpp.openNamespaces('%{Class}')}\
using namespace Cutelyst;
class %{CN} : public Controller
{
Q_OBJECT
@if %{CustomNamespace}
C_NAMESPACE("%{CustomNamespaceValue}")
@endif
public:
explicit %{CN}(QObject *parent = 0);
C_ATTR(index, :Path)
void index(Context *c);
private Q_SLOTS:
@if %{BeginMethod}
bool Begin(Context *c);
@endif
@if %{AutoMethod}
bool Auto(Context *c);
@endif
@if %{EndMethod}
bool End(Context *c);
@endif
};
%{JS: Cpp.closeNamespaces('%{Class}')}
#endif // %{GUARD}\
|
Remove override form Begin Auto End methods of QtCreator plugin as they don't override anymore
|
Remove override form Begin Auto End methods of QtCreator plugin as they don't override anymore
|
C
|
bsd-3-clause
|
buschmann23/cutelyst,cutelyst/cutelyst,simonaw/cutelyst,buschmann23/cutelyst,buschmann23/cutelyst,cutelyst/cutelyst,cutelyst/cutelyst,simonaw/cutelyst
|
0b2b76601a160cc5e38f5c1720084e6b872bc246
|
test/CodeGen/struct-matching-constraint.c
|
test/CodeGen/struct-matching-constraint.c
|
// RUN: %clang_cc1 -emit-llvm -march=armv7a %s
// XFAIL: *
// XTARGET: arm
typedef struct __simd128_uint16_t
{
__neon_uint16x8_t val;
} uint16x8_t;
void b(uint16x8_t sat, uint16x8_t luma)
{
__asm__("vmov.16 %1, %0 \n\t"
"vtrn.16 %0, %1 \n\t"
:"=w"(luma), "=w"(sat)
:"0"(luma)
);
}
|
// RUN: %clang -S -emit-llvm -arch arm -march=armv7a %s
typedef unsigned short uint16_t;
typedef __attribute__((neon_vector_type(8))) uint16_t uint16x8_t;
void b(uint16x8_t sat, uint16x8_t luma)
{
__asm__("vmov.16 %1, %0 \n\t"
"vtrn.16 %0, %1 \n\t"
:"=w"(luma), "=w"(sat)
:"0"(luma)
);
}
|
Fix this test to work for arm and on all platforms.
|
Fix this test to work for arm and on all platforms.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@136307 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,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,apple/swift-clang
|
7ae187e075b4b6678732b1b82e3d4c59ed5f8dcc
|
src/popover/main.c
|
src/popover/main.c
|
/*
* This file is part of ui-tests
*
* Copyright © 2016 Ikey Doherty <ikey@solus-project.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*/
#include "util.h"
#include <stdlib.h>
BUDGIE_BEGIN_PEDANTIC
#include "popover.h"
BUDGIE_END_PEDANTIC
int main(int argc, char **argv)
{
gtk_init(&argc, &argv);
return EXIT_FAILURE;
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=8 tabstop=8 expandtab:
* :indentSize=8:tabSize=8:noTabs=true:
*/
|
/*
* This file is part of ui-tests
*
* Copyright © 2016 Ikey Doherty <ikey@solus-project.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*/
#include "util.h"
#include <stdlib.h>
BUDGIE_BEGIN_PEDANTIC
#include "popover.h"
BUDGIE_END_PEDANTIC
int main(int argc, char **argv)
{
gtk_init(&argc, &argv);
GtkWidget *window = NULL;
window = budgie_popover_new();
g_signal_connect(window, "destroy", gtk_main_quit, NULL);
gtk_widget_show_all(window);
gtk_main();
return EXIT_SUCCESS;
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=8 tabstop=8 expandtab:
* :indentSize=8:tabSize=8:noTabs=true:
*/
|
Make the demo use the popover
|
Make the demo use the popover
Signed-off-by: Ikey Doherty <d8d992cf0016e35c2a8339d5e7d44bebd12a2d77@solus-project.com>
|
C
|
lgpl-2.1
|
ikeydoherty/ui-tests,ikeydoherty/ui-tests
|
504905fd4b5334c8763fa4b9c61e618fa68d4b8b
|
include/llvm/Target/TargetMachineImpls.h
|
include/llvm/Target/TargetMachineImpls.h
|
//===-- llvm/Target/TargetMachineImpls.h - Target Descriptions --*- C++ -*-===//
//
// This file defines the entry point to getting access to the various target
// machine implementations available to LLVM.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TARGET_TARGETMACHINEIMPLS_H
#define LLVM_TARGET_TARGETMACHINEIMPLS_H
namespace TM {
enum {
PtrSizeMask = 1,
PtrSize32 = 0,
PtrSize64 = 1,
EndianMask = 2,
LittleEndian = 0,
BigEndian = 2,
};
}
class TargetMachine;
// allocateSparcTargetMachine - Allocate and return a subclass of TargetMachine
// that implements the Sparc backend.
//
TargetMachine *allocateSparcTargetMachine();
// allocateX86TargetMachine - Allocate and return a subclass of TargetMachine
// that implements the X86 backend. The X86 target machine can run in
// "emulation" mode, where it is capable of emulating machines of larger pointer
// size and different endianness if desired.
//
TargetMachine *allocateX86TargetMachine(unsigned Configuration =
TM::PtrSize32|TM::LittleEndian);
#endif
|
//===-- llvm/Target/TargetMachineImpls.h - Target Descriptions --*- C++ -*-===//
//
// This file defines the entry point to getting access to the various target
// machine implementations available to LLVM.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TARGET_TARGETMACHINEIMPLS_H
#define LLVM_TARGET_TARGETMACHINEIMPLS_H
namespace TM {
enum {
PtrSizeMask = 1,
PtrSize32 = 0,
PtrSize64 = 1,
EndianMask = 2,
LittleEndian = 0,
BigEndian = 2,
};
}
class TargetMachine;
// allocateSparcTargetMachine - Allocate and return a subclass of TargetMachine
// that implements the Sparc backend.
//
TargetMachine *allocateSparcTargetMachine(unsigned Configuration =
TM::PtrSize64|TM::BigEndian);
// allocateX86TargetMachine - Allocate and return a subclass of TargetMachine
// that implements the X86 backend. The X86 target machine can run in
// "emulation" mode, where it is capable of emulating machines of larger pointer
// size and different endianness if desired.
//
TargetMachine *allocateX86TargetMachine(unsigned Configuration =
TM::PtrSize32|TM::LittleEndian);
#endif
|
Allow allocation of a Sparc TargetMachine.
|
Allow allocation of a Sparc TargetMachine.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@6364 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap
|
5869dc005e829ed07b066746b01d24f264a47113
|
test/FrontendC/pr5406.c
|
test/FrontendC/pr5406.c
|
// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | FileCheck %s
// PR 5406
// XFAIL: *
// XTARGET: arm
typedef struct { char x[3]; } A0;
void foo (int i, ...);
// CHECK: call arm_aapcscc void (i32, ...)* @foo(i32 1, i32 {{.*}}) nounwind
int main (void)
{
A0 a3;
a3.x[0] = 0;
a3.x[0] = 0;
a3.x[2] = 26;
foo (1, a3 );
return 0;
}
|
// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | FileCheck %s
// PR 5406
// XFAIL: *
// XTARGET: arm
typedef struct { char x[3]; } A0;
void foo (int i, ...);
// CHECK: call void (i32, ...)* @foo(i32 1, i32 {{.*}}) nounwind
int main (void)
{
A0 a3;
a3.x[0] = 0;
a3.x[0] = 0;
a3.x[2] = 26;
foo (1, a3 );
return 0;
}
|
Update test to match recent llvm-gcc change.
|
Update test to match recent llvm-gcc change.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@106056 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
bsd-2-clause
|
dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm
|
d4c28b0d467d667632489fa8f14d597f85a90f05
|
src/bin/e_signals.c
|
src/bin/e_signals.c
|
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
#include <execinfo.h>
/* a tricky little devil, requires e and it's libs to be built
* with the -rdynamic flag to GCC for any sort of decent output.
*/
void e_sigseg_act(int x, siginfo_t *info, void *data){
void *array[255];
size_t size;
write(2, "**** SEGMENTATION FAULT ****\n", 29);
write(2, "**** Printing Backtrace... *****\n\n", 34);
size = backtrace(array, 255);
backtrace_symbols_fd(array, size, 2);
exit(-11);
}
|
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
* NOTE TO FreeBSD users. Install libexecinfo from
* ports/devel/libexecinfo and add -lexecinfo to LDFLAGS
* to add backtrace support.
*/
#include "e.h"
#include <execinfo.h>
/* a tricky little devil, requires e and it's libs to be built
* with the -rdynamic flag to GCC for any sort of decent output.
*/
void e_sigseg_act(int x, siginfo_t *info, void *data){
void *array[255];
size_t size;
write(2, "**** SEGMENTATION FAULT ****\n", 29);
write(2, "**** Printing Backtrace... *****\n\n", 34);
size = backtrace(array, 255);
backtrace_symbols_fd(array, size, 2);
exit(-11);
}
|
Add note to help FreeBSD users.
|
Add note to help FreeBSD users.
git-svn-id: 0f3f1c46c6da7ffd142db61e503a7ff63af3a195@13781 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
|
C
|
bsd-2-clause
|
jordemort/e17,jordemort/e17,jordemort/e17
|
d1c5ca9d6c830a597ebdeaaadb73254b265f647b
|
source/common/d3d_util.h
|
source/common/d3d_util.h
|
/* The Halfling Project - A Graphics Engine and Projects
*
* The Halfling Project is the legal property of Adrian Astley
* Copyright Adrian Astley 2013
*/
#ifndef COMMON_D3D_UTIL_H
#define COMMON_D3D_UTIL_H
#include "common/dxerr.h"
//---------------------------------------------------------------------------------------
// Simple d3d error checker
//---------------------------------------------------------------------------------------
#if defined(DEBUG) | defined(_DEBUG)
#ifndef HR
#define HR(x) { \
HRESULT hr = (x); \
if (FAILED(hr)) { \
DXTrace(__FILEW__, (DWORD)__LINE__, hr, L#x, true); \
} \
}
#endif
#else
#ifndef HR
#define HR(x) (x)
#endif
#endif
//---------------------------------------------------------------------------------------
// Convenience macro for releasing COM objects.
//---------------------------------------------------------------------------------------
#define ReleaseCOM(x) { if(x){ x->Release(); x = 0; } }
#endif
|
/* The Halfling Project - A Graphics Engine and Projects
*
* The Halfling Project is the legal property of Adrian Astley
* Copyright Adrian Astley 2013
*/
#ifndef COMMON_D3D_UTIL_H
#define COMMON_D3D_UTIL_H
#include "common/dxerr.h"
//---------------------------------------------------------------------------------------
// Simple d3d error checker
//---------------------------------------------------------------------------------------
#if defined(DEBUG) | defined(_DEBUG)
#ifndef HR
#define HR(x) { \
HRESULT hr = (x); \
if (FAILED(hr)) { \
DXTrace(__FILEW__, (DWORD)__LINE__, hr, L#x, true); \
} \
}
#endif
#else
#ifndef HR
#define HR(x) (x)
#endif
#endif
//---------------------------------------------------------------------------------------
// Convenience macro for releasing COM objects.
//---------------------------------------------------------------------------------------
#define ReleaseCOM(x) { if(x){ x->Release(); x = nullptr; } }
#endif
|
Use nullptr instead of 0
|
COMMON: Use nullptr instead of 0
|
C
|
apache-2.0
|
RichieSams/thehalflingproject,RichieSams/thehalflingproject,RichieSams/thehalflingproject
|
050cf2fe7cc047b55d81a5b9d38bcc1a63225e13
|
base/include/mem.h
|
base/include/mem.h
|
size_t align_to(size_t offset, size_t align);
|
#define container_of(p,T,memb) (T *)((char *)(p) - offsetof(T,member))
#define length_of(array) (sizeof (array) / sizeof 0[array])
size_t align_to(size_t offset, size_t align);
|
Add container_of and length_of macros to base
|
Add container_of and length_of macros to base
|
C
|
isc
|
cventus/otivm,cventus/otivm,cventus/otivm
|
13a7868be57942e1e27bf9767a2cd85a4a0b288d
|
lib/debug_msg.c
|
lib/debug_msg.c
|
/**
* @file debug_msg.c Debug Message function
*/
/* $Id$ */
#include "gangliaconf.h"
int debug_level = 0;
/**
* @fn void debug_msg(const char *format, ...)
* Prints the message to STDERR if DEBUG is #defined
* @param format The format of the msg (see printf manpage)
* @param ... Optional arguments
*/
void
debug_msg(const char *format, ...)
{
if (debug_level && format)
{
va_list ap;
va_start(ap, format);
vfprintf(stderr, format, ap);
fprintf(stderr,"\n");
va_end(ap);
}
return;
}
|
/**
* @file debug_msg.c Debug Message function
*/
/* $Id$ */
#include "gangliaconf.h"
int debug_level = 0;
/**
* @fn void debug_msg(const char *format, ...)
* Prints the message to STDERR if DEBUG is #defined
* @param format The format of the msg (see printf manpage)
* @param ... Optional arguments
*/
void
debug_msg(const char *format, ...)
{
if (debug_level > 1 && format)
{
va_list ap;
va_start(ap, format);
vfprintf(stderr, format, ap);
fprintf(stderr,"\n");
va_end(ap);
}
return;
}
|
Debug level 1 now only shows error messages (and no backgrounding in gmetad).
|
Debug level 1 now only shows error messages (and no backgrounding in gmetad).
git-svn-id: 27e0aca8c7a52a9ae65dfba2e16879604119af8c@188 93a4e39c-3214-0410-bb16-828d8e3bcd0f
|
C
|
bsd-3-clause
|
fastly/ganglia,fastly/ganglia,fastly/ganglia,fastly/ganglia,fastly/ganglia
|
d1db59b4fa389e5f73ae9de7c4f75802102d1756
|
fmpz_poly_factor/clear.c
|
fmpz_poly_factor/clear.c
|
/*
Copyright (C) 2011 Sebastian Pancratz
This file is part of FLINT.
FLINT is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See <http://www.gnu.org/licenses/>.
*/
#include <gmp.h>
#include <stdlib.h>
#include "flint.h"
#include "fmpz.h"
#include "fmpz_poly.h"
void fmpz_poly_factor_clear(fmpz_poly_factor_t fac)
{
if (fac->alloc)
{
slong i;
for (i = 0; i < fac->alloc; i++)
{
fmpz_poly_clear(fac->p + i);
}
fmpz_clear(&(fac->c));
flint_free(fac->p);
flint_free(fac->exp);
fac->p = NULL;
fac->exp = NULL;
}
}
|
/*
Copyright (C) 2011 Sebastian Pancratz
This file is part of FLINT.
FLINT is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See <http://www.gnu.org/licenses/>.
*/
#include <gmp.h>
#include <stdlib.h>
#include "flint.h"
#include "fmpz.h"
#include "fmpz_poly.h"
void fmpz_poly_factor_clear(fmpz_poly_factor_t fac)
{
if (fac->alloc)
{
slong i;
for (i = 0; i < fac->alloc; i++)
{
fmpz_poly_clear(fac->p + i);
}
flint_free(fac->p);
flint_free(fac->exp);
fac->p = NULL;
fac->exp = NULL;
}
fmpz_clear(&(fac->c));
}
|
Fix a memory leak in t-factor.
|
Fix a memory leak in t-factor.
|
C
|
lgpl-2.1
|
fredrik-johansson/flint2,wbhart/flint2,wbhart/flint2,fredrik-johansson/flint2,fredrik-johansson/flint2,wbhart/flint2
|
aacb03000dad63a8f336e18ed2a9e8179f5bbc33
|
UnitTests/Source/GITTreeEntryTests.h
|
UnitTests/Source/GITTreeEntryTests.h
|
//
// GITTreeEntryTests.h
// CocoaGit
//
// Created by Geoffrey Garside on 06/10/2008.
// Copyright 2008 ManicPanda.com. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@class GITRepo, GITTree;
@interface GITTreeEntryTests : GHTestCase {
GITRepo * repo;
GITTree * tree;
NSUInteger entryMode;
NSString * entryName;
NSString * entrySHA1;
NSString * entryLine;
}
@property(readwrite,retain) GITRepo * repo;
@property(readwrite,retain) GITTree * tree;
@property(readwrite,assign) NSUInteger entryMode;
@property(readwrite,copy) NSString * entryName;
@property(readwrite,copy) NSString * entrySHA1;
@property(readwrite,copy) NSString * entryLine;
- (void)testShouldParseEntryLine;
- (void)testShouldInitWithModeNameAndHash;
- (void)testShouldInitWithModeStringNameAndHash;
@end
|
//
// GITTreeEntryTests.h
// CocoaGit
//
// Created by Geoffrey Garside on 06/10/2008.
// Copyright 2008 ManicPanda.com. All rights reserved.
//
#import <GHUnit/GHUnit.h>
@class GITRepo, GITTree;
@interface GITTreeEntryTests : GHTestCase {
GITRepo * repo;
GITTree * tree;
NSUInteger entryMode;
NSString * entryName;
NSString * entrySHA1;
NSString * entryLine;
}
@property(readwrite,retain) GITRepo * repo;
@property(readwrite,retain) GITTree * tree;
@property(readwrite,assign) NSUInteger entryMode;
@property(readwrite,copy) NSString * entryName;
@property(readwrite,copy) NSString * entrySHA1;
@property(readwrite,copy) NSString * entryLine;
- (void)testShouldParseEntryLine;
- (void)testShouldInitWithModeNameAndHash;
- (void)testShouldInitWithModeStringNameAndHash;
@end
|
Update GITTreeEntry tests to use GHUnit framework instead of SenTestKit
|
Update GITTreeEntry tests to use GHUnit framework instead of SenTestKit
|
C
|
mit
|
schacon/cocoagit,schacon/cocoagit,geoffgarside/cocoagit,geoffgarside/cocoagit
|
2067da7189ec2e5d0266e16578b156f6a6bbf215
|
src/udon2xml.c
|
src/udon2xml.c
|
#include <stdio.h>
#include <stdlib.h>
#include "udon.h"
int main (int argc, char *argv[]) {
int i;
int found = 0;
if(argc < 2) return 1;
UdonParser *udon = udon_new_parser_from_file(argv[1]);
if(udon == NULL) {
udon_emit_error(stderr);
return udon_error_value();
}
for(i=0; i<10000; i++) {
found += udon_parse(udon);
udon_reset_parser(udon);
}
udon_free_parser(udon);
printf("%d\n", found);
}
|
#include <stdio.h>
#include <stdlib.h>
#include "udon.h"
int main (int argc, char *argv[]) {
int i;
if(argc < 2) return 1;
UdonParser *udon = udon_new_parser_from_file(argv[1]);
if(udon == NULL) {
udon_emit_error(stderr);
return udon_error_value();
}
int res = udon_parse(udon);
if(res) udon_emit_error(stderr);
udon_reset_parser(udon);
udon_free_parser(udon);
return res;
}
|
Remove older benchmarking loop and do correct error handling with real parse interface.
|
Remove older benchmarking loop and do correct error handling with real parse
interface.
|
C
|
mit
|
josephwecker/udon-c,josephwecker/udon-c,josephwecker/udon-c,josephwecker/udon-c
|
c9996dfdabcc6e4639240ec90ac3a97912b686ec
|
utils/lstopo-xml.c
|
utils/lstopo-xml.c
|
/*
* Copyright © 2009 CNRS
* Copyright © 2009-2010 INRIA. All rights reserved.
* Copyright © 2009 Université Bordeaux 1
* Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
*/
#include <private/autogen/config.h>
#ifdef HWLOC_HAVE_XML
#include <hwloc.h>
#include <string.h>
#include "lstopo.h"
void output_xml(hwloc_topology_t topology, const char *filename, int logical __hwloc_attribute_unused, int legend __hwloc_attribute_unused, int verbose_mode __hwloc_attribute_unused)
{
if (!filename || !strcasecmp(filename, "-.xml"))
filename = "-";
hwloc_topology_export_xml(topology, filename);
}
#endif /* HWLOC_HAVE_XML */
|
/*
* Copyright © 2009 CNRS
* Copyright © 2009-2010 INRIA. All rights reserved.
* Copyright © 2009 Université Bordeaux 1
* Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
*/
#include <private/autogen/config.h>
#ifdef HWLOC_HAVE_XML
#include <hwloc.h>
#include <string.h>
#include "lstopo.h"
void output_xml(hwloc_topology_t topology, const char *filename, int logical __hwloc_attribute_unused, int legend __hwloc_attribute_unused, int verbose_mode __hwloc_attribute_unused)
{
if (!filename || !strcasecmp(filename, "-.xml"))
filename = "-";
if (hwloc_topology_export_xml(topology, filename) < 0) {
fprintf(stderr, "Failed to export XML to %s (%s)\n", filename, strerror(errno));
return;
}
}
#endif /* HWLOC_HAVE_XML */
|
Print an error when lstopo fails to export to XML
|
Print an error when lstopo fails to export to XML
git-svn-id: 14be032f8f42541b1a281b51ae8ea69814daf20e@3691 4b44e086-7f34-40ce-a3bd-00e031736276
|
C
|
bsd-3-clause
|
BlueBrain/hwloc,BlueBrain/hwloc,BlueBrain/hwloc,BlueBrain/hwloc
|
eaa2b2534e5d7115be1d5d9efcfe1ce28e0b0721
|
fast-xattr-test/fast-xattr-test/main.c
|
fast-xattr-test/fast-xattr-test/main.c
|
//
// main.c
// fast-xattr-test
//
// Created by David Schlachter on 2015-07-09.
// Copyright (c) 2015 David Schlachter. All rights reserved.
//
#include <stdio.h>
int main(int argc, const char * argv[]) {
// insert code here...
printf("Hello, World!\n");
return 0;
}
|
//
// main.c
// fast-xattr-test
//
// Created by David Schlachter on 2015-07-09.
// Copyright (c) 2015 David Schlachter. All rights reserved.
//
#include <stdio.h>
#include <sys/xattr.h>
#include <stdlib.h>
int main(int argc, const char * argv[]) {
const char *path;
const char *name;
void *value = malloc(15);
size_t size;
u_int32_t position;
int options = 0;
path = argv[1];
name = argv[2];
size = 14;
position = 0;
if (!getxattr(path, name, value, size, position, options)) {
return 0;
} else {
return 1;
};
}
|
Set up the getxattr function
|
Set up the getxattr function
|
C
|
mit
|
davidschlachter/fast-xattr-test
|
49fef60bc607ebb56b979b78f157b31619fea2eb
|
test/regression/filter-badenc-segv.c
|
test/regression/filter-badenc-segv.c
|
#include <stdio.h>
#include <stdlib.h>
#include <parserutils/parserutils.h>
#include "input/filter.h"
#include "testutils.h"
static void *myrealloc(void *ptr, size_t len, void *pw)
{
UNUSED(pw);
return realloc(ptr, len);
}
int main(int argc, char **argv)
{
parserutils_filter *input;
parserutils_filter_optparams params;
if (argc != 2) {
printf("Usage: %s <filename>\n", argv[0]);
return 1;
}
assert(parserutils_initialise(argv[1], myrealloc, NULL) ==
PARSERUTILS_OK);
assert(parserutils_filter_create("UTF-8", myrealloc, NULL, &input) ==
PARSERUTILS_OK);
params.encoding.name = "GBK";
assert(parserutils_filter_setopt(input,
PARSERUTILS_FILTER_SET_ENCODING, ¶ms) ==
PARSERUTILS_BADENCODING);
params.encoding.name = "GBK";
assert(parserutils_filter_setopt(input,
PARSERUTILS_FILTER_SET_ENCODING, ¶ms) ==
PARSERUTILS_BADENCODING);
parserutils_filter_destroy(input);
assert(parserutils_finalise(myrealloc, NULL) == PARSERUTILS_OK);
printf("PASS\n");
return 0;
}
|
#include <stdio.h>
#include <stdlib.h>
#include <parserutils/parserutils.h>
#include "input/filter.h"
#include "testutils.h"
static void *myrealloc(void *ptr, size_t len, void *pw)
{
UNUSED(pw);
return realloc(ptr, len);
}
int main(int argc, char **argv)
{
parserutils_filter *input;
parserutils_filter_optparams params;
parserutils_error expected;
#ifdef WITH_ICONV_FILTER
expected = PARSERUTILS_OK;
#else
expected = PARSERUTILS_BADENCODING;
#endif
if (argc != 2) {
printf("Usage: %s <filename>\n", argv[0]);
return 1;
}
assert(parserutils_initialise(argv[1], myrealloc, NULL) ==
PARSERUTILS_OK);
assert(parserutils_filter_create("UTF-8", myrealloc, NULL, &input) ==
PARSERUTILS_OK);
params.encoding.name = "GBK";
assert(parserutils_filter_setopt(input,
PARSERUTILS_FILTER_SET_ENCODING, ¶ms) ==
expected);
params.encoding.name = "GBK";
assert(parserutils_filter_setopt(input,
PARSERUTILS_FILTER_SET_ENCODING, ¶ms) ==
expected);
parserutils_filter_destroy(input);
assert(parserutils_finalise(myrealloc, NULL) == PARSERUTILS_OK);
printf("PASS\n");
return 0;
}
|
Fix regression test to work with iconv filter enabled
|
Fix regression test to work with iconv filter enabled
svn path=/trunk/libparserutils/; revision=5662
|
C
|
mit
|
servo/libparserutils,dunkelstern/libparserutils,servo/libparserutils,servo/libparserutils,dunkelstern/libparserutils,dunkelstern/libparserutils
|
8012d2842d234a838b2ff27c27c5222a665cf7f7
|
src/UserSpaceInstrumentation/include/UserSpaceInstrumentation/Attach.h
|
src/UserSpaceInstrumentation/include/UserSpaceInstrumentation/Attach.h
|
// Copyright (c) 2021 The Orbit 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 USER_SPACE_INSTRUMENTATION_ATTACH_H_
#define USER_SPACE_INSTRUMENTATION_ATTACH_H_
#include <sys/types.h>
#include "OrbitBase/Result.h"
namespace orbit_user_space_instrumentation {
[[nodiscard]] ErrorMessageOr<void> AttachAndStopProcess(pid_t pid);
[[nodiscard]] ErrorMessageOr<void> DetachAndContinueProcess(pid_t pid);
} // namespace orbit_user_space_instrumentation
#endif // USER_SPACE_INSTRUMENTATION_ATTACH_H_
|
// Copyright (c) 2021 The Orbit 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 USER_SPACE_INSTRUMENTATION_ATTACH_H_
#define USER_SPACE_INSTRUMENTATION_ATTACH_H_
#include <sys/types.h>
#include "OrbitBase/Result.h"
namespace orbit_user_space_instrumentation {
// Attaches to and stops all threads of the process `pid` using `PTRACE_ATTACH`. Being attached to a
// process using this function is a precondition for using any of the tooling provided here.
[[nodiscard]] ErrorMessageOr<void> AttachAndStopProcess(pid_t pid);
// Detaches from all threads of the process `pid` and continues the execution.
[[nodiscard]] ErrorMessageOr<void> DetachAndContinueProcess(pid_t pid);
} // namespace orbit_user_space_instrumentation
#endif // USER_SPACE_INSTRUMENTATION_ATTACH_H_
|
Fix missing comment in header.
|
Fix missing comment in header.
|
C
|
bsd-2-clause
|
google/orbit,google/orbit,google/orbit,google/orbit
|
bda2fe3ebaff006d6ff0c7252940033308020dca
|
lib/rgph.h
|
lib/rgph.h
|
/*-
* Copyright (c) 2015 Alexander Nasonov.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef RGPH_H_INCLUDED
#define RGPH_H_INCLUDED
#include <rhph_defs.h>
#include <rhph_hash.h>
#include <rhph_graph.h>
#endif /* !RGPH_H_INCLUDED */
|
/*-
* Copyright (c) 2015 Alexander Nasonov.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef RGPH_H_INCLUDED
#define RGPH_H_INCLUDED
#include <rgph_defs.h>
#include <rgph_hash.h>
#include <rgph_graph.h>
#endif /* !RGPH_H_INCLUDED */
|
Fix typo in include file names.
|
Fix typo in include file names.
|
C
|
bsd-2-clause
|
alnsn/rgph,alnsn/rgph
|
02a229b409fe2026efd86c54df9205c907e85ab1
|
location.c
|
location.c
|
#include "location.h"
#include "inventory.h"
#include "person.h"
void location_init(struct location *location, char *name, char *description)
{
location->name = name;
location->description = description;
inventory_init(&location->inventory);
vector_init(&location->people, sizeof(struct person *));
}
void location_free(struct location *location)
{
for (int i = 0; i < location->people.size; i++) {
person_free(location->people.data[i]);
}
vector_free(&location->people);
inventory_free(&location->inventory);
}
|
#include "location.h"
#include "inventory.h"
#include "person.h"
void location_init(struct location *location, char *name, char *description)
{
location->name = name;
location->description = description;
inventory_init(&location->inventory);
vector_init(&location->people, sizeof(struct person *));
}
void location_free(struct location *location)
{
for (int i = 0; i < location->people.size; i++) {
person_free(vector_get(&location->people, i));
}
vector_free(&location->people);
inventory_free(&location->inventory);
}
|
Use vector_get rather than accessing array directly
|
Use vector_get rather than accessing array directly
|
C
|
mit
|
kouroshp/text-game,kouroshp/text-game
|
38bcd605bc3a57bf3bd354826e16e41d74d87933
|
test.c
|
test.c
|
#include <stdio.h>
int main(int argc, char ** argv){
printf("Test\n");
return 0;
}
|
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char ** argv){
printf("Test\n");
void* test = malloc(1024*1024);
if(test > 0){
printf("Malloc\n");
free(test);
printf("Free\n");
}else{
printf("Malloc Failed\n");
}
return 0;
}
|
Fix bugs with libc, executor
|
WIP: Fix bugs with libc, executor
|
C
|
mit
|
redox-os/libc,redox-os/libc,redox-os/libc
|
81418d19ccfd34af55de37f16f1dcd9a6111eb2f
|
kilo.c
|
kilo.c
|
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
struct termios orig_termios;
void disable_raw_mode() {
tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios);
}
void enable_raw_mode() {
tcgetattr(STDIN_FILENO, &orig_termios);
atexit(disable_raw_mode);
struct termios raw = orig_termios;
raw.c_iflag &= ~(ICRNL | IXON);
raw.c_oflag &= ~(OPOST);
raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw);
}
int main() {
enable_raw_mode();
char c;
while (read(STDIN_FILENO, &c, 1) == 1 && c != 'q') {
if (iscntrl(c)) {
printf("%d\n", c);
} else {
printf("%d ('%c')\n", c, c);
}
}
return 0;
}
|
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
struct termios orig_termios;
void disable_raw_mode() {
tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios);
}
void enable_raw_mode() {
tcgetattr(STDIN_FILENO, &orig_termios);
atexit(disable_raw_mode);
struct termios raw = orig_termios;
raw.c_iflag &= ~(ICRNL | IXON);
raw.c_oflag &= ~(OPOST);
raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw);
}
int main() {
enable_raw_mode();
char c;
while (read(STDIN_FILENO, &c, 1) == 1 && c != 'q') {
if (iscntrl(c)) {
printf("%d\r\n", c);
} else {
printf("%d ('%c')\r\n", c, c);
}
}
return 0;
}
|
Fix printf() by adding CR manually
|
Fix printf() by adding CR manually
|
C
|
bsd-2-clause
|
oldsharp/kilo,oldsharp/kilo
|
e9e7ffa10d1af2f0b11528c1be16ab406c02f136
|
runtime/libprofile/LineProfiling.c
|
runtime/libprofile/LineProfiling.c
|
/*===- LineProfiling.c - Support library for line profiling ---------------===*\
|*
|* The LLVM Compiler Infrastructure
|*
|* This file is distributed under the University of Illinois Open Source
|* License. See LICENSE.TXT for details.
|*
|*===----------------------------------------------------------------------===*|
|*
|* This file implements the call back routines for the line profiling
|* instrumentation pass. Link against this library when running code through
|* the -insert-line-profiling LLVM pass.
|*
\*===----------------------------------------------------------------------===*/
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
/* A file in this case is a translation unit. Each .o file built with line
* profiling enabled will emit to a different file. Only one file may be
* started at a time.
*/
void llvm_prof_linectr_start_file(const char *orig_filename) {
printf("[%s]\n", orig_filename);
}
/* Emit data about a counter to the data file. */
void llvm_prof_linectr_emit_counter(const char *dir, const char *file,
uint32_t line, uint32_t column,
uint64_t *counter) {
printf("%s/%s:%u:%u %lu\n", dir, file, line, column, *counter);
}
void llvm_prof_linectr_end_file() {
printf("-----\n");
}
|
/*===- LineProfiling.c - Support library for line profiling ---------------===*\
|*
|* The LLVM Compiler Infrastructure
|*
|* This file is distributed under the University of Illinois Open Source
|* License. See LICENSE.TXT for details.
|*
|*===----------------------------------------------------------------------===*|
|*
|* This file implements the call back routines for the line profiling
|* instrumentation pass. Link against this library when running code through
|* the -insert-line-profiling LLVM pass.
|*
\*===----------------------------------------------------------------------===*/
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include "llvm/Support/DataTypes.h"
/* A file in this case is a translation unit. Each .o file built with line
* profiling enabled will emit to a different file. Only one file may be
* started at a time.
*/
void llvm_prof_linectr_start_file(const char *orig_filename) {
printf("[%s]\n", orig_filename);
}
/* Emit data about a counter to the data file. */
void llvm_prof_linectr_emit_counter(const char *dir, const char *file,
uint32_t line, uint32_t column,
uint64_t *counter) {
printf("%s/%s:%u:%u %" PRIu64 "\n", dir, file, line, column, *counter);
}
void llvm_prof_linectr_end_file() {
printf("-----\n");
}
|
Print our uint64_t with the more portable (C99 and C++0x) %PRIu64 format specifier.
|
Print our uint64_t with the more portable (C99 and C++0x) %PRIu64 format
specifier.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@129384 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
bsd-2-clause
|
dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm
|
b1167684c00877fac8bb3ebe120f088ff99daa57
|
list.h
|
list.h
|
#include <stdlib.h>
#ifndef __LIST_H__
#define __LIST_H__
struct ListNode;
struct List;
typedef struct ListNode ListNode;
typedef struct List List;
List* List_Create(void);
void List_Destroy(List* l);
ListNode* ListNode_Create(void *);
void ListNode_Destroy(ListNode* n);
ListNode* List_Search(List* l, void* k, int f(void*, void*));
#endif
|
#include <stdlib.h>
#ifndef __LIST_H__
#define __LIST_H__
struct ListNode;
struct List;
typedef struct ListNode ListNode;
typedef struct List List;
List* List_Create(void);
void List_Destroy(List* l);
ListNode* ListNode_Create(void *);
void ListNode_Destroy(ListNode* n);
ListNode* List_Search(List* l, void* k, int (f)(void*, void*));
#endif
|
Fix missing parenthesis around f as parameter
|
Fix missing parenthesis around f as parameter
|
C
|
mit
|
MaxLikelihood/CADT
|
eb477c92d61c1f2db3d5fd98e842050a4313ba3a
|
main.c
|
main.c
|
#include "kms-endpoint.h"
#include <glib.h>
int main(int argc, char **argv) {
GObject *ep;
GValue val = G_VALUE_INIT;
GError *err = NULL;
KmsConnection *conn = NULL;
g_type_init();
ep = g_object_new(KMS_TYPE_ENDPOINT, "localname", "test_ep", NULL);
if (ep == NULL) {
g_print("Create endpont is: NULL\n");
return 1;
}
g_value_init(&val, G_TYPE_STRING);
g_object_get_property(ep, "localname", &val);
g_print("Created ep with localname: %s\n", g_value_get_string(&val));
conn = kms_endpoint_create_connection(KMS_ENDPOINT(ep),
KMS_CONNECTION_TYPE_RTP, &err);
if (conn == NULL) {
g_print("Connection can not be created: %s\n", err->message);;
g_error_free(err);
goto end;
}
end:
g_object_unref(ep);
return 0;
}
|
#include "kms-endpoint.h"
#include <glib.h>
int main(int argc, char **argv) {
GObject *ep;
GValue val = G_VALUE_INIT;
GError *err = NULL;
KmsConnection *conn = NULL;
g_type_init();
ep = g_object_new(KMS_TYPE_ENDPOINT, "localname", "test_ep", NULL);
if (ep == NULL) {
g_print("Create endpont is: NULL\n");
return 1;
}
g_value_init(&val, G_TYPE_STRING);
g_object_get_property(ep, "localname", &val);
g_print("Created ep with localname: %s\n", g_value_get_string(&val));
conn = kms_endpoint_create_connection(KMS_ENDPOINT(ep),
KMS_CONNECTION_TYPE_RTP, &err);
if (conn == NULL) {
g_print("Connection can not be created: %s\n", err->message);;
g_error_free(err);
goto end;
}
g_object_get_property(G_OBJECT(conn), "id", &val);
g_print("Created local connection with id: %s\n",
g_value_get_string(&val));
if (!kms_endpoint_delete_connection(KMS_ENDPOINT(ep), conn, &err)) {
g_printerr("Connection can not be deleted: %s", err->message);
g_error_free(err);
goto end;
}
end:
g_object_unref(ep);
return 0;
}
|
Add test for delete connection method
|
Add test for delete connection method
|
C
|
lgpl-2.1
|
mparis/kurento-media-server,lulufei/kurento-media-server,lulufei/kurento-media-server,mparis/kurento-media-server,Kurento/kurento-media-server,todotobe1/kurento-media-server,TribeMedia/kurento-media-server,shelsonjava/kurento-media-server,TribeMedia/kurento-media-server,shelsonjava/kurento-media-server,Kurento/kurento-media-server,todotobe1/kurento-media-server
|
4cb0d352ed7208fc9ac71b006dcb1b0ff8d65ca2
|
src/xpiks-qt/Models/logsmodel.h
|
src/xpiks-qt/Models/logsmodel.h
|
#ifndef LOGSMODEL
#define LOGSMODEL
#include <QString>
#include <QFile>
#include <QDir>
#include <QDebug>
#include <QTextStream>
#include <QStandardPaths>
#include "Helpers/constants.h"
namespace Models {
class LogsModel : public QObject {
Q_OBJECT
public:
Q_INVOKABLE QString getAllLogsText() {
QString result;
#ifdef QT_NO_DEBUG
QDir logFileDir(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation));
QString logFilePath = logFileDir.filePath(Constants::LOG_FILENAME);
QFile f(logFilePath);
if (f.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream in(&f);
result = in.readAll();
}
#else
result = "Logs are available in Release version";
#endif
return result;
}
};
}
#endif // LOGSMODEL
|
#ifndef LOGSMODEL
#define LOGSMODEL
#include <QString>
#include <QFile>
#include <QDir>
#include <QDebug>
#include <QTextStream>
#include <QStandardPaths>
#include "../Helpers/constants.h"
namespace Models {
class LogsModel : public QObject {
Q_OBJECT
public:
Q_INVOKABLE QString getAllLogsText() {
QString result;
#ifdef QT_NO_DEBUG
QDir logFileDir(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation));
QString logFilePath = logFileDir.filePath(Constants::LOG_FILENAME);
QFile f(logFilePath);
if (f.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream in(&f);
result = in.readAll();
}
#else
result = "Logs are available in Release version";
#endif
return result;
}
};
}
#endif // LOGSMODEL
|
Fix for compilation in Windows
|
Fix for compilation in Windows
|
C
|
mpl-2.0
|
Ribtoks/xpiks,Artiom-M/xpiks,Ribtoks/xpiks,Ribtoks/xpiks,Ribtoks/xpiks,Artiom-M/xpiks,Artiom-M/xpiks,Artiom-M/xpiks
|
fd440beaf95128b12f2abc279525192bfcc5eca0
|
percolation/main.c
|
percolation/main.c
|
/* headers */
#include <stdlib.h>
#include <time.h>
#include "lattice.h"
#include "clusters.h"
#include "io_helpers.h"
/* main body function */
int main()
{
int L; /* square lattice size */
double p; /* occupation probability of each lattice site */
int *lattice; /* lattice array */
/* initialize random number generator seed */
srand(time(NULL));
/* allocate lattice */
L = 10;
lattice = allocate_lattice(L, L);
/* populate lattice with given probability */
p = 0.4;
populate_lattice(p, lattice, L, L);
/* print the generated lattice for visualization */
print_lattice(lattice, L, L, 1);
/* label clusters and print result */
label_clusters(lattice, L, L);
print_lattice(lattice, L, L, 1);
/* free memory before leaving */
free(lattice);
return 0;
}
|
/* headers */
#include <stdlib.h>
#include <time.h>
#include "lattice.h"
#include "clusters.h"
#include "io_helpers.h"
/* main body function */
int main(int argc, char ** argv)
{
int L; /* square lattice size */
double p; /* occupation probability of each lattice site */
int *lattice; /* lattice array */
/* read input arguments; if none provided fallback to default values */
if (argc == 3) {
L = atoi(argv[1]);
p = atof(argv[2]);
} else {
L = 10;
p = 0.4;
}
/* initialize random number generator seed */
srand(time(NULL));
/* allocate lattice */
lattice = allocate_lattice(L, L);
/* populate lattice with given probability */
populate_lattice(p, lattice, L, L);
/* print the generated lattice for visualization */
print_lattice(lattice, L, L, 1);
/* label clusters and print result */
label_clusters(lattice, L, L);
print_lattice(lattice, L, L, 1);
/* free memory before leaving */
free(lattice);
return 0;
}
|
Add passing problem parameters as program arguments
|
[percolation] Add passing problem parameters as program arguments
|
C
|
mit
|
cerisola/fiscomp,cerisola/fiscomp,cerisola/fiscomp
|
115f2b95d5756319855249fe60aa91e273e3c191
|
test/Driver/noexecstack.c
|
test/Driver/noexecstack.c
|
// RUN: %clang -### %s -c -o tmp.o -Wa,--noexecstack 2>&1 | grep "mnoexecstack"
|
// RUN: %clang -### %s -c -o tmp.o -triple i686-pc-linux-gnu -integrated-as -Wa,--noexecstack 2>&1 | grep "mnoexecstack"
|
Fix this test on machines that don't run clang -cc1as when asked to assemble.
|
Fix this test on machines that don't run clang -cc1as when asked to assemble.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@133688 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
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,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,apple/swift-clang
|
8d7d203342f1573938e99d984ca335f05e1415bb
|
test/tools/llvm-cov/zeroFunctionFile.c
|
test/tools/llvm-cov/zeroFunctionFile.c
|
#include "Inputs/zeroFunctionFile.h"
int foo(int x) {
return NOFUNCTIONS(x);
}
int main() {
return foo(2);
}
// RUN: llvm-profdata merge %S/Inputs/zeroFunctionFile.proftext -o %t.profdata
// RUN: llvm-cov report %S/Inputs/zeroFunctionFile.covmapping -instr-profile %t.profdata 2>&1 | FileCheck --check-prefix=REPORT --strict-whitespace %s
// REPORT: 0 0 - 0 0 - 0 0 - 0 0 -
// REPORT-NO: 0%
// RUN: llvm-cov show %S/Inputs/zeroFunctionFile.covmapping -format html -instr-profile %t.profdata -o %t.dir
// RUN: FileCheck %s -input-file=%t.dir/index.html -check-prefix=HTML
// HTML: <td class='column-entry-green'><pre>- (0/0)
// HTML-NO: 0.00% (0/0)
|
#include "Inputs/zeroFunctionFile.h"
int foo(int x) {
return NOFUNCTIONS(x);
}
int main() {
return foo(2);
}
// RUN: llvm-profdata merge %S/Inputs/zeroFunctionFile.proftext -o %t.profdata
// RUN: llvm-cov report %S/Inputs/zeroFunctionFile.covmapping -instr-profile %t.profdata 2>&1 | FileCheck --check-prefix=REPORT --strict-whitespace %s
// REPORT: 0 0 - 0 0 - 0 0 - 0 0 -
// REPORT-NO: 0%
// RUN: llvm-cov show -j 1 %S/Inputs/zeroFunctionFile.covmapping -format html -instr-profile %t.profdata -o %t.dir
// RUN: FileCheck %s -input-file=%t.dir/index.html -check-prefix=HTML
// HTML: <td class='column-entry-green'><pre>- (0/0)
// HTML-NO: 0.00% (0/0)
|
Disable threading in a test. NFC.
|
[llvm-cov] Disable threading in a test. NFC.
PR30735 reports an issue where llvm-cov hangs with a worker thread
waiting on a condition, and the main thread waiting to join() the
workers. While this doesn't appear to be a bug in llvm-cov or the
ThreadPool implementation, it would be helpful to disable the use of
threading in the llvm-cov tests where no test coverage is added.
More context: https://bugs.llvm.org/show_bug.cgi?id=30735
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@307610 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm
|
38f81754a540d7e1212e8b6247aff174aceefced
|
src/user.c
|
src/user.c
|
task blink();
task usercontrol(){
int DY, DT;
bool isReset = false;
startTask(blink);
//Enable Positioning System
startTask(positionsystem);
while(true){
//Driving
DY = threshold(PAIRED_CH2^2 / MAX_POWER, 5);
DT = threshold(PAIRED_CH1^2 / MAX_POWER, 5);
drive(DY, DT);
//Mogo
mogo(threshold(PAIRED_CH3, 15));
//Arm
arm((PAIRED_BTN6U - PAIRED_BTN6D) * MAX_POWER);
//Lift
lift((PAIRED_BTN7U - PAIRED_BTN7D) * MAX_POWER);
//Intake
intake((PAIRED_BTN5U - PAIRED_BTN5D) * MAX_POWER);
//Reset (can be done multiple times, only required once)
if(SensorValue[resetButton]){
resetAll();
isReset = true;
stopTask(blink);
SensorValue[resetLED] = false;
waitUntil(!SensorValue[resetButton]);
}
}
}
task blink(){
while(true){
SensorValue[resetLED] = !SensorValue[resetLED];
wait1Msec(1000);
}
}
|
task blink();
task usercontrol(){
int DY, DT;
bool isReset = false;
startTask(blink);
//Enable Positioning System
startTask(positionsystem);
while(true){
//Driving
DY = threshold(PAIRED_CH2^2 / MAX_POWER, 5) + ((PAIRED_BTN8U - PAIRED_BTN8D) * MAX_POWER);
DT = threshold(PAIRED_CH1^2 / MAX_POWER, 5) + ((PAIRED_BTN8R - PAIRED_BTN8L) * MAX_POWER);
drive(DY, DT);
//Mogo
mogo(threshold(PAIRED_CH3, 15));
//Arm
arm((PAIRED_BTN6U - PAIRED_BTN6D) * MAX_POWER);
//Lift
lift((PAIRED_BTN7U - PAIRED_BTN7D) * MAX_POWER);
//Intake
intake((PAIRED_BTN5U - PAIRED_BTN5D) * MAX_POWER);
//Reset (can be done multiple times, only required once)
if(abs(SensorValue[aclZ]) > 50){
startTask(blink);
}
if(SensorValue[resetButton]){
resetAll();
isReset = true;
stopTask(blink);
SensorValue[resetLED] = false;
waitUntil(!SensorValue[resetButton]);
}
}
}
task blink(){
while(true){
SensorValue[resetLED] = !SensorValue[resetLED];
wait1Msec(1000);
}
}
|
Add button driving and reset encoder warning when bot picked up
|
Add button driving and reset encoder warning when bot picked up
|
C
|
mit
|
18moorei/code-red-in-the-zone
|
a995514733949a433e39edec0966ba2789b57ada
|
libavutil/pca.h
|
libavutil/pca.h
|
/*
* Principal component analysis
* Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
*
* 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
/**
* @file pca.h
* Principal component analysis
*/
struct PCA *ff_pca_init(int n);
void ff_pca_free(struct PCA *pca);
void ff_pca_add(struct PCA *pca, double *v);
int ff_pca(struct PCA *pca, double *eigenvector, double *eigenvalue);
|
/*
* Principal component analysis
* Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
*
* 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
/**
* @file pca.h
* Principal component analysis
*/
#ifndef FFMPEG_PCA_H
#define FFMPEG_PCA_H
struct PCA *ff_pca_init(int n);
void ff_pca_free(struct PCA *pca);
void ff_pca_add(struct PCA *pca, double *v);
int ff_pca(struct PCA *pca, double *eigenvector, double *eigenvalue);
#endif /* FFMPEG_PCA_H */
|
Make diego happy before he notices.
|
Make diego happy before he notices.
git-svn-id: a4d7c1866f8397a4106e0b57fc4fbf792bbdaaaf@14810 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
|
C
|
lgpl-2.1
|
prajnashi/ffmpeg,prajnashi/ffmpeg,prajnashi/ffmpeg,prajnashi/ffmpeg
|
89de24b762d3032816d918392725d6ce41d21092
|
src/Config.h
|
src/Config.h
|
/*
Config (Singleton), extends ofxXMLSettings
Loads app configuration properties from xml file.
*/
#pragma once
#ifndef BBC_CONFIG
#define BBC_CONFIG
#include "XmlSettingsEx.h"
#define CONFIG_GET(_key, _attr, _def) bbc::utils::Config::instance()->getAttribute("config:"_key, _attr, _def)
namespace bbc {
namespace utils {
class Config : public XmlSettingsEx {
public:
static string data_file_path;
static Config* instance(); // pointer to itself
bool load_success;
protected:
Config(); // protected constuctor
};
}
}
#endif
|
/*
Config (Singleton), extends ofxXMLSettings
Loads app configuration properties from xml file.
*/
#pragma once
#ifndef BBC_CONFIG
#define BBC_CONFIG
#include "XmlSettingsEx.h"
#define CONFIG_GET(_key, _attr, _def) bbc::utils::Config::instance()->getAttribute("config:"_key, _attr, _def)
namespace bbc {
namespace utils {
class Config : public XmlSettingsEx {
public:
static string data_file_path;
static Config* instance(); // pointer to itself
bool load_success;
protected:
Config(); // hidden constuctor
};
}
}
#endif
|
Tweak to test commiting from submodule
|
Tweak to test commiting from submodule
|
C
|
mit
|
radamchin/ofxBBCUtils,radamchin/ofxBBCUtils
|
615cdb92ee442cbfac75e3602df857e06ab9aee6
|
include/llvm/iOperators.h
|
include/llvm/iOperators.h
|
//===-- llvm/iBinary.h - Binary Operator node definitions --------*- C++ -*--=//
//
// This file contains the declarations of all of the Binary Operator classes.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_IBINARY_H
#define LLVM_IBINARY_H
#include "llvm/InstrTypes.h"
//===----------------------------------------------------------------------===//
// Classes to represent Binary operators
//===----------------------------------------------------------------------===//
//
// All of these classes are subclasses of the BinaryOperator class...
//
class GenericBinaryInst : public BinaryOperator {
public:
GenericBinaryInst(BinaryOps Opcode, Value *S1, Value *S2,
const std::string &Name = "")
: BinaryOperator(Opcode, S1, S2, Name) {
}
};
class SetCondInst : public BinaryOperator {
BinaryOps OpType;
public:
SetCondInst(BinaryOps opType, Value *S1, Value *S2,
const std::string &Name = "");
// getInverseCondition - Return the inverse of the current condition opcode.
// For example seteq -> setne, setgt -> setle, setlt -> setge, etc...
//
BinaryOps getInverseCondition() const;
};
#endif
|
//===-- llvm/iBinary.h - Binary Operator node definitions --------*- C++ -*--=//
//
// This file contains the declarations of all of the Binary Operator classes.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_IBINARY_H
#define LLVM_IBINARY_H
#include "llvm/InstrTypes.h"
//===----------------------------------------------------------------------===//
// Classes to represent Binary operators
//===----------------------------------------------------------------------===//
//
// All of these classes are subclasses of the BinaryOperator class...
//
class GenericBinaryInst : public BinaryOperator {
public:
GenericBinaryInst(BinaryOps Opcode, Value *S1, Value *S2,
const std::string &Name = "")
: BinaryOperator(Opcode, S1, S2, Name) {
}
};
class SetCondInst : public BinaryOperator {
BinaryOps OpType;
public:
SetCondInst(BinaryOps opType, Value *S1, Value *S2,
const std::string &Name = "");
// getInverseCondition - Return the inverse of the current condition opcode.
// For example seteq -> setne, setgt -> setle, setlt -> setge, etc...
//
BinaryOps getInverseCondition() const;
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const SetCondInst *) { return true; }
static inline bool classof(const Instruction *I) {
return I->getOpcode() == SetEQ || I->getOpcode() == SetNE ||
I->getOpcode() == SetLE || I->getOpcode() == SetGE ||
I->getOpcode() == SetLT || I->getOpcode() == SetGT;
}
static inline bool classof(const Value *V) {
return isa<Instruction>(V) && classof(cast<Instruction>(V));
}
};
#endif
|
Implement classof for SetCondInst so that instcombine doesn't break on dyn_cast<SetCondInst>
|
Implement classof for SetCondInst so that instcombine doesn't break on dyn_cast<SetCondInst>
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@3493 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm
|
061bf34805bbe88b25f9084b9f99a7096689c5d8
|
library/strings_format.h
|
library/strings_format.h
|
#pragma once
#define TINYFORMAT_USE_VARIADIC_TEMPLATES
#ifdef __GNUC__
// Tinyformat has a number of non-annotated switch fallthrough cases
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#endif
#include "dependencies/tinyformat/tinyformat.h"
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#include "library/strings.h"
namespace OpenApoc
{
template <typename... Args> static UString format(const UString &fmt, Args &&... args)
{
return tfm::format(fmt.cStr(), std::forward<Args>(args)...);
}
UString tr(const UString &str, const UString domain = "ufo_string");
} // namespace OpenApoc
|
#pragma once
#include "fmt/printf.h"
#include "library/strings.h"
namespace OpenApoc
{
template <typename... Args> static UString format(const UString &fmt, Args &&... args)
{
return fmt::sprintf(fmt.str(), std::forward<Args>(args)...);
}
UString tr(const UString &str, const UString domain = "ufo_string");
} // namespace OpenApoc
template <> struct fmt::formatter<OpenApoc::UString> : formatter<std::string>
{
template <typename FormatContext> auto format(const OpenApoc::UString &s, FormatContext &ctx)
{
return formatter<std::string>::format(s.str(), ctx);
}
};
|
Use fmtlib's sprintf instead of tinyformat
|
Use fmtlib's sprintf instead of tinyformat
TODO: Move to the indexed formatting strings for fmtlib
|
C
|
mit
|
Istrebitel/OpenApoc,pmprog/OpenApoc,pmprog/OpenApoc,steveschnepp/OpenApoc,Istrebitel/OpenApoc,steveschnepp/OpenApoc
|
c7d9355a433bbd0f82dfa466bf220101e456789a
|
base/type_defs.h
|
base/type_defs.h
|
#pragma once
#include <string>
#include <cstdlib>
// Integer types
typedef char int8_t;
typedef unsigned char uint8_t;
typedef short int16_t;
typedef unsigned short uint16_t;
typedef long int32_t;
typedef unsigned long uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
#ifndef _swap_int
template <typename T>
void _swap_int(T& a, T& b) { T t(a); a = b; b = t; }
#endif // !_swap_int
|
#pragma once
#include <string>
#include <cstdlib>
// Integer types
#ifdef int8_t
typedef char int8_t;
#endif // !int8_t
#ifdef uint8_t
typedef unsigned char uint8_t;
#endif // !uint8_t
#ifdef int16_t
typedef short int16_t;
#endif // !int16_t
#ifdef uint16_t
typedef unsigned short uint16_t;
#endif // !uint16_t
#ifdef int32_t
typedef long int32_t;
#endif // !int32_t
#ifdef uint32_t
typedef unsigned long uint32_t;
#endif // !uint32_t
#ifdef int64_t
typedef long long int64_t;
#endif // !int64_t
#ifdef uint64_t
typedef unsigned long long uint64_t;
#endif // !uint64_t
#ifndef _swap_int
template <typename T>
void _swap_int(T& a, T& b) { T t(a); a = b; b = t; }
#endif // !_swap_int
|
Fix basic type redefinition errors
|
Fix basic type redefinition errors
|
C
|
mit
|
LartSimZ/gameAmbiance
|
4cabeb8a7181b841457efa594287b66bf81956e4
|
src/skbuff.c
|
src/skbuff.c
|
#include "syshead.h"
#include "skbuff.h"
struct sk_buff *alloc_skb(unsigned int size)
{
struct sk_buff *skb = malloc(sizeof(struct sk_buff));
skb->data = malloc(size);
skb->head = skb->data;
skb->tail = skb->data;
skb->end = skb->tail + size;
return skb;
}
void *skb_reserve(struct sk_buff *skb, unsigned int len)
{
skb->data += len;
skb->tail += len;
return skb->data;
}
uint8_t *skb_push(struct sk_buff *skb, unsigned int len)
{
skb->data -= len;
skb->len += len;
return skb->data;
}
void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
{
skb->dst = dst;
}
|
#include "syshead.h"
#include "skbuff.h"
struct sk_buff *alloc_skb(unsigned int size)
{
struct sk_buff *skb = malloc(sizeof(struct sk_buff));
memset(skb, 0, sizeof(struct sk_buff));
skb->data = malloc(size);
memset(skb->data, 0, size);
skb->head = skb->data;
skb->tail = skb->data;
skb->end = skb->tail + size;
return skb;
}
void *skb_reserve(struct sk_buff *skb, unsigned int len)
{
skb->data += len;
skb->tail += len;
return skb->data;
}
uint8_t *skb_push(struct sk_buff *skb, unsigned int len)
{
skb->data -= len;
skb->len += len;
return skb->data;
}
void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
{
skb->dst = dst;
}
|
Fix Valgrind complaint about unitialized heap memory
|
Fix Valgrind complaint about unitialized heap memory
|
C
|
mit
|
saminiir/level-ip,saminiir/level-ip
|
39ec68310c69c7f86f4a2fa638782094ef17ac6b
|
packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c
|
packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c
|
#ifdef _MSC_VER
#include <intrin.h>
#define BREAKPOINT_INTRINSIC() __debugbreak()
#else
#define BREAKPOINT_INTRINSIC() __asm__ __volatile__ ("int3")
#endif
int
bar(int const *foo)
{
int count = 0;
for (int i = 0; i < 10; ++i)
{
count += 1;
BREAKPOINT_INTRINSIC();
count += 1;
}
return *foo;
}
int
main(int argc, char **argv)
{
int foo = 42;
bar(&foo);
return 0;
}
|
#ifdef _MSC_VER
#include <intrin.h>
#define BREAKPOINT_INTRINSIC() __debugbreak()
#else
#define BREAKPOINT_INTRINSIC() __asm__ __volatile__ ("int3")
#endif
int
bar(int const *foo)
{
int count = 0, i = 0;
for (; i < 10; ++i)
{
count += 1;
BREAKPOINT_INTRINSIC();
count += 1;
}
return *foo;
}
int
main(int argc, char **argv)
{
int foo = 42;
bar(&foo);
return 0;
}
|
Fix TestDebugBreak.py failure with gcc, for loop declarations are not allowed by default with gcc
|
Fix TestDebugBreak.py failure with gcc, for loop declarations are not allowed by default with gcc
- fix buildbot breakage after r257186
- move declaration outside of for loop
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@257228 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb
|
79f3cfe1af88a4dd9b2343f14d50289106d5d973
|
firmware/i2c_lcd.c
|
firmware/i2c_lcd.c
|
#include <avr/io.h>
#include <util/delay.h>
#include "slcd.h"
int main()
{
init_lcd();
uint8_t backlit = 1;
while (1)
{
lcd_clrscr();
lcd_goto(LINE1);
lcd_puts("Line 1", backlit);
lcd_goto(LINE2);
lcd_puts("Line 2", backlit);
lcd_goto(LINE3);
lcd_puts("Line 3", backlit);
lcd_goto(LINE4);
lcd_puts("Line 4", backlit);
_delay_ms(500);
// Blink the backlight
for (uint8_t i=0; i<6; i++)
{
send_byte(0, 0x80 + LINE4 + 6, i%2);
_delay_ms(50);
}
_delay_ms(500);
}
return 0;
}
|
#include <avr/io.h>
#include <util/delay.h>
#include "slcd.h"
int main()
{
init_lcd();
uint8_t backlit = 1;
while (1)
{
lcd_clrscr();
lcd_goto(0, 0);
lcd_puts("Line 1", backlit);
lcd_goto(1, 0);
lcd_puts("Line 2", backlit);
lcd_goto(2, 0);
lcd_puts("Line 3", backlit);
lcd_goto(3, 0);
lcd_puts("Line 4", backlit);
_delay_ms(500);
// Blink the backlight
for (uint8_t i=0; i<6; i++)
{
send_byte(0, 0x80 + LCD_LINE3 + 6, i%2);
_delay_ms(50);
}
_delay_ms(500);
// Raster the cursor to check the goto function
lcd_clrscr();
for (uint8_t i=0; i<LCD_LINES; i++)
for (uint8_t j=0; j<LCD_WIDTH; j++)
{
lcd_goto(i, j);
_delay_ms(100);
}
}
return 0;
}
|
Adjust to changes in slcd library
|
Adjust to changes in slcd library
|
C
|
mit
|
andrewadare/avr-breadboarding,andrewadare/avr-breadboarding
|
a5a60654efc3f97ba1cf6cbf7043c28ed9860b02
|
cmd/lefty/exec.h
|
cmd/lefty/exec.h
|
/* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (c) 1994-2004 AT&T Corp. *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Corp. *
* *
* Information and Software Systems Research *
* AT&T Research, Florham Park NJ *
**********************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/* Lefteris Koutsofios - AT&T Bell Laboratories */
#ifndef _EXEC_H
#define _EXEC_H
typedef struct Tonm_t lvar_t;
extern Tobj root, null;
extern Tobj rtno;
extern int Erun;
extern int Eerrlevel, Estackdepth, Eshowbody, Eshowcalls, Eoktorun;
void Einit(void);
void Eterm(void);
Tobj Eunit(Tobj);
Tobj Efunction(Tobj, char *);
#endif /* _EXEC_H */
#ifdef __cplusplus
}
#endif
|
/* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (c) 1994-2004 AT&T Corp. *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Corp. *
* *
* Information and Software Systems Research *
* AT&T Research, Florham Park NJ *
**********************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/* Lefteris Koutsofios - AT&T Labs Research */
#ifndef _EXEC_H
#define _EXEC_H
typedef struct Tonm_t lvar_t;
extern Tobj root, null;
extern Tobj rtno;
extern int Erun;
extern int Eerrlevel, Estackdepth, Eshowbody, Eshowcalls, Eoktorun;
void Einit (void);
void Eterm (void);
Tobj Eunit (Tobj);
Tobj Efunction (Tobj, char *);
#endif /* _EXEC_H */
#ifdef __cplusplus
}
#endif
|
Update with new lefty, fixing many bugs and supporting new features
|
Update with new lefty, fixing many bugs and supporting new features
|
C
|
epl-1.0
|
MjAbuz/graphviz,MjAbuz/graphviz,jho1965us/graphviz,BMJHayward/graphviz,pixelglow/graphviz,kbrock/graphviz,jho1965us/graphviz,kbrock/graphviz,ellson/graphviz,kbrock/graphviz,BMJHayward/graphviz,tkelman/graphviz,jho1965us/graphviz,MjAbuz/graphviz,ellson/graphviz,ellson/graphviz,pixelglow/graphviz,BMJHayward/graphviz,pixelglow/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,tkelman/graphviz,tkelman/graphviz,pixelglow/graphviz,ellson/graphviz,ellson/graphviz,MjAbuz/graphviz,pixelglow/graphviz,jho1965us/graphviz,pixelglow/graphviz,kbrock/graphviz,ellson/graphviz,kbrock/graphviz,pixelglow/graphviz,tkelman/graphviz,BMJHayward/graphviz,jho1965us/graphviz,BMJHayward/graphviz,tkelman/graphviz,kbrock/graphviz,BMJHayward/graphviz,pixelglow/graphviz,tkelman/graphviz,ellson/graphviz,ellson/graphviz,ellson/graphviz,jho1965us/graphviz,pixelglow/graphviz,kbrock/graphviz,tkelman/graphviz,tkelman/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,tkelman/graphviz,MjAbuz/graphviz,kbrock/graphviz,jho1965us/graphviz,BMJHayward/graphviz,jho1965us/graphviz,kbrock/graphviz,ellson/graphviz,jho1965us/graphviz,MjAbuz/graphviz,tkelman/graphviz,BMJHayward/graphviz,tkelman/graphviz,BMJHayward/graphviz,kbrock/graphviz,jho1965us/graphviz,MjAbuz/graphviz,pixelglow/graphviz,jho1965us/graphviz,pixelglow/graphviz,kbrock/graphviz,MjAbuz/graphviz,ellson/graphviz,BMJHayward/graphviz
|
3f37918a0580654ff642a70276f5b94651d224c5
|
DeepLinkSDK/DeepLinkSDK.h
|
DeepLinkSDK/DeepLinkSDK.h
|
#import "DPLTargetViewControllerProtocol.h"
#import "DPLDeepLinkRouter.h"
#import "DPLRouteHandler.h"
#import "DPLDeepLink.h"
#import "DPLErrors.h"
|
#import "DPLTargetViewControllerProtocol.h"
#import "DPLDeepLinkRouter.h"
#import "DPLRouteHandler.h"
#import "DPLDeepLink.h"
#import "DPLMutableDeepLink.h"
#import "DPLErrors.h"
|
Add mutable deep link to sdk header.
|
Add mutable deep link to sdk header.
|
C
|
mit
|
button/DeepLinkKit,button/DeepLinkKit,button/DeepLinkKit,usebutton/DeepLinkKit,button/DeepLinkKit,usebutton/DeepLinkKit,usebutton/DeepLinkKit
|
aab5eceb9b33a5109792ba52bc9f1ddf39059364
|
src/debug.h
|
src/debug.h
|
/*
Copyright libCellML Contributors
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 <iostream>
#include <sstream>
namespace libcellml {
struct dbg
{
dbg() = default;
~dbg()
{
std::cout << mSS.str() << std::endl;
}
public:
dbg &operator<<(const void *p)
{
const void *address = static_cast<const void *>(p);
std::ostringstream ss;
ss << address;
mSS << ss.str();
return *this;
}
// accepts just about anything
template<class T>
dbg &operator<<(const T &x)
{
mSS << x;
return *this;
}
private:
std::ostringstream mSS;
};
} // namespace libcellml
|
/*
Copyright libCellML Contributors
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 <iostream>
#include <sstream>
namespace libcellml {
struct Debug
{
Debug() = default;
~Debug()
{
std::cout << mSS.str() << std::endl;
}
Debug &operator<<(const void *p)
{
const void *address = static_cast<const void *>(p);
std::ostringstream ss;
ss << address;
mSS << ss.str();
return *this;
}
// accepts just about anything
template<class T>
Debug &operator<<(const T &x)
{
mSS << x;
return *this;
}
private:
std::ostringstream mSS;
};
} // namespace libcellml
|
Rename dbg struct to Debug.
|
Rename dbg struct to Debug.
|
C
|
apache-2.0
|
MichaelClerx/libcellml,cellml/libcellml,cellml/libcellml,hsorby/libcellml,cellml/libcellml,nickerso/libcellml,MichaelClerx/libcellml,nickerso/libcellml,hsorby/libcellml,nickerso/libcellml,cellml/libcellml,nickerso/libcellml,MichaelClerx/libcellml,hsorby/libcellml,hsorby/libcellml
|
ec00e8cfc23cb7d04a9b13730607d6c094446f36
|
test/tstsoap1.c
|
test/tstsoap1.c
|
/*
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
* $Id: tstsoap1.c,v 1.1 2005-05-06 11:11:37 adam Exp $
*/
#include <stdlib.h>
#if HAVE_XML2
#include <libxml/parser.h>
#endif
int main(int argc, char **argv)
{
#if HAVE_XML2
LIBXML_TEST_VERSION;
if (argc <= 1)
{
xmlChar *buf_out;
int len_out;
xmlDocPtr doc = xmlNewDoc("1.0");
#if 0
const char *val = "jordbr"; /* makes xmlDocDumpMemory hang .. */
#else
const char *val = "jordbaer"; /* OK */
#endif
xmlNodePtr top = xmlNewNode(0, "top");
xmlNewTextChild(top, 0, "sub", val);
xmlDocSetRootElement(doc, top);
xmlDocDumpMemory(doc, &buf_out, &len_out);
printf("%*s", len_out, buf_out);
}
#endif
return 0;
}
|
/*
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
* $Id: tstsoap1.c,v 1.2 2005-05-08 07:33:12 adam Exp $
*/
#include <stdlib.h>
#if HAVE_XML2
#include <libxml/parser.h>
#endif
int main(int argc, char **argv)
{
#if HAVE_XML2
LIBXML_TEST_VERSION;
if (argc <= 1)
{
xmlChar *buf_out;
int len_out;
xmlDocPtr doc = xmlNewDoc("1.0");
#if 0
const char *val = "jordbr"; /* makes xmlDocDumpMemory hang .. */
#else
const char *val = "jordbaer"; /* OK */
#endif
xmlNodePtr top = xmlNewNode(0, "top");
xmlNewTextChild(top, 0, "sub", val);
xmlDocSetRootElement(doc, top);
xmlDocDumpMemory(doc, &buf_out, &len_out);
#if 0
printf("%*s", len_out, buf_out);
#endif
}
#endif
return 0;
}
|
Comment out debug printf stmt
|
Comment out debug printf stmt
|
C
|
bsd-3-clause
|
nla/yaz,dcrossleyau/yaz,nla/yaz,dcrossleyau/yaz,dcrossleyau/yaz,nla/yaz,nla/yaz
|
a362d5e8273bdafe5be847b7e4020104cf7960c6
|
src/mathml.h
|
src/mathml.h
|
/*
Copyright libCellML Contributors
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 <string>
namespace libcellml {
/**
* @brief Compare math to determine if it is equal.
*
* Compare the given math strings to determin if they are equal or not.
* The current test is a simplistic comparison of string equality.
*
* @param math1 The first parameter to compare against parameter two.
* @param math2 The second parameter to compare against parameter one.
* @return Return @c true if the @p math1 is equal to @p math2, @c false otherwise.
*/
bool compareMath(const std::string &math1, const std::string &math2);
} // namespace libcellml
|
/*
Copyright libCellML Contributors
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 <string>
namespace libcellml {
/**
* @brief Compare math to determine if it is equal.
*
* Compare the given math strings to determine if they are equal or not.
* The current test is a simplistic comparison of string equality.
*
* @param math1 The first parameter to compare against parameter two.
* @param math2 The second parameter to compare against parameter one.
* @return Return @c true if the @p math1 is equal to @p math2, @c false otherwise.
*/
bool compareMath(const std::string &math1, const std::string &math2);
} // namespace libcellml
|
Fix typo in compareMath doxygen documentation.
|
Fix typo in compareMath doxygen documentation.
|
C
|
apache-2.0
|
hsorby/libcellml,cellml/libcellml,nickerso/libcellml,nickerso/libcellml,cellml/libcellml,hsorby/libcellml,cellml/libcellml,nickerso/libcellml,cellml/libcellml,hsorby/libcellml,nickerso/libcellml,hsorby/libcellml
|
4bc83be34066a7a42c6297db983e1d9066e14d3e
|
chrome/renderer/webview_color_overlay.h
|
chrome/renderer/webview_color_overlay.h
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_
#define CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_
#pragma once
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPageOverlay.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h"
namespace content {
class RenderView;
}
// This class draws the given color on a PageOverlay of a WebView.
class WebViewColorOverlay : public WebKit::WebPageOverlay {
public:
WebViewColorOverlay(content::RenderView* render_view, SkColor color);
virtual ~WebViewColorOverlay();
private:
// WebKit::WebPageOverlay implementation:
virtual void paintPageOverlay(WebKit::WebCanvas* canvas);
content::RenderView* render_view_;
SkColor color_;
DISALLOW_COPY_AND_ASSIGN(WebViewColorOverlay);
};
#endif // CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_
#define CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_
#pragma once
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPageOverlay.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h"
namespace content {
class RenderView;
}
// This class draws the given color on a PageOverlay of a WebView.
class WebViewColorOverlay : public WebKit::WebPageOverlay {
public:
WebViewColorOverlay(content::RenderView* render_view, SkColor color);
virtual ~WebViewColorOverlay();
private:
// WebKit::WebPageOverlay implementation:
virtual void paintPageOverlay(WebKit::WebCanvas* canvas);
content::RenderView* render_view_;
SkColor color_;
DISALLOW_COPY_AND_ASSIGN(WebViewColorOverlay);
};
#endif // CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_
|
Fix build break from the future.
|
Fix build break from the future.
TBR=pfeldman
Review URL: http://codereview.chromium.org/8801036
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@113098 0039d316-1c4b-4281-b951-d872f2087c98
|
C
|
bsd-3-clause
|
ropik/chromium,gavinp/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,yitian134/chromium,adobe/chromium,gavinp/chromium,ropik/chromium,ropik/chromium,yitian134/chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,ropik/chromium,adobe/chromium,adobe/chromium,ropik/chromium,gavinp/chromium,yitian134/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,yitian134/chromium,gavinp/chromium,gavinp/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,ropik/chromium
|
17530c3d7eceb106a74066446404117158e8aa93
|
iobuf/ibuf_readall.c
|
iobuf/ibuf_readall.c
|
#include <iobuf/iobuf.h>
#include <str/str.h>
/** Read the remainder of the \c ibuf into the \c str. */
int ibuf_readall(ibuf* in, str* out)
{
for (;;) {
if (!str_catb(out,
in->io.buffer+in->io.bufstart,
in->io.buflen-in->io.bufstart))
return 0;
in->io.bufstart = in->io.buflen;
if (!ibuf_refill(in))
return ibuf_eof(in);
}
}
|
#include <iobuf/iobuf.h>
#include <str/str.h>
/** Read the remainder of the \c ibuf into the \c str. */
int ibuf_readall(ibuf* in, str* out)
{
if (ibuf_eof(in)) return 1;
if (ibuf_error(in)) return 0;
for (;;) {
if (!str_catb(out,
in->io.buffer+in->io.bufstart,
in->io.buflen-in->io.bufstart))
return 0;
in->io.bufstart = in->io.buflen;
if (!ibuf_refill(in))
return ibuf_eof(in);
}
}
|
Make sure to do sanity checking before any of the reading.
|
Make sure to do sanity checking before any of the reading.
|
C
|
lgpl-2.1
|
bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs
|
5d2a4723bcb4ff7913f8ea7e97890aa62d646ccc
|
include/ctache/lexer.h
|
include/ctache/lexer.h
|
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef LEXER_H
#define LEXER_H
#include <stdlib.h>
#include "linked_list.h"
enum ctache_token_type {
/* Terminals */
CTACHE_TOK_STRING,
CTACHE_TOK_SECTION_TAG_START,
CTACHE_TOK_CLOSE_TAG_START,
CTACHE_TOK_VALUE_TAG_START,
CTACHE_TOK_TAG_END,
CTACHE_TOK_EOI,
/* Non-Terminals */
CTACHE_TOK_TEMPLATE,
CTACHE_TOK_TEXT,
CTACHE_TOK_TAG,
CTACHE_TOK_TAG_START
};
#define CTACHE_NUM_TERMINALS (CTACHE_TOK_EOI + 1)
#define CTACHE_NUM_NONTERMINALS (CTACHE_TOK_TAG_START - CTACHE_TOK_TEMPLATE + 1)
struct ctache_token {
char *value;
enum ctache_token_type tok_type;
};
struct linked_list
*ctache_lex(const char *str, size_t str_len);
#endif /* LEXER_H */
|
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef LEXER_H
#define LEXER_H
#include <stdlib.h>
#include "linked_list.h"
enum ctache_token_type {
/* Terminals */
CTACHE_TOK_SECTION_TAG_START,
CTACHE_TOK_CLOSE_TAG_START,
CTACHE_TOK_VALUE_TAG_START,
CTACHE_TOK_TAG_END,
CTACHE_TOK_STRING,
CTACHE_TOK_EOI,
/* Non-Terminals */
CTACHE_TOK_TEMPLATE,
CTACHE_TOK_TEXT,
CTACHE_TOK_TAG,
CTACHE_TOK_TAG_START
};
#define CTACHE_NUM_TERMINALS (CTACHE_TOK_EOI + 1)
#define CTACHE_NUM_NONTERMINALS (CTACHE_TOK_TAG_START - CTACHE_TOK_TEMPLATE + 1)
struct ctache_token {
char *value;
enum ctache_token_type tok_type;
};
struct linked_list
*ctache_lex(const char *str, size_t str_len);
#endif /* LEXER_H */
|
Fix a lexical token ordering issue
|
Fix a lexical token ordering issue
|
C
|
mpl-2.0
|
dwjackson/ctache,dwjackson/ctache
|
cf1943751de987986a59a5a458070a7bf4548fee
|
Josh_Zane_Sebastian/src/parser/types.c
|
Josh_Zane_Sebastian/src/parser/types.c
|
#include <stdlib.h>
#include <stdio.h>
struct llnode;
struct symbol;
struct function;
union value;
struct variable;
struct statement;
struct call;
struct llnode {
struct type* car;
struct llnode* cdr;
};
struct call {
char* name;
struct function func;
struct symbol* arguments;
int numargs;
}
struct symbol {//I guess this is analogous to a symbol in lisp.
char* name; //It has a name, which we use to keep track of it.
struct variable* referant; //And an actual value in memory.
};
struct function {
struct symbol* args; //these are the symbols that the function takes as arguments
char* definition; // this is the function's actual definition, left in text form until parsing.
};
union value { //we have three primitive types, so every variable's value is one of those types
char bit;
struct llnode list;
struct function func;
};
struct variable { //this is essentially an in-program variable
union value val; //it has a value, i.e. what it equals
char typeid; //and a type id that allows us to correctly extract the value from the union value.
};
|
#include <stdlib.h>
#include <stdio.h>
struct llnode;
struct symbol;
struct function;
union value;
struct variable;
struct statement;
struct call;
struct llnode {
struct variable* car;
struct llnode* cdr;
};
struct call {
char* name;
struct function func;
struct symbol* arguments;
int numargs;
}
struct symbol {//I guess this is analogous to a symbol in lisp.
char* name; //It has a name, which we use to keep track of it.
struct variable* referant; //And an actual value in memory.
};
struct function {
struct symbol* args; //these are the symbols that the function takes as arguments
char* definition; // this is the function's actual definition, left in text form until parsing.
int numargs;
};
union value { //we have three primitive types, so every variable's value is one of those types
char bit;
struct llnode list;
struct function func;
};
struct variable { //this is essentially an in-program variable
union value val; //it has a value, i.e. what it equals
char typeid; //and a type id that allows us to correctly extract the value from the union value.
};
|
Add a numargs field to struct function, which refers to the number of arguments the function takes.
|
Add a numargs field to struct function, which refers to the number of arguments the function takes.
|
C
|
mit
|
aacoppa/final,aacoppa/final
|
ef1a586474d7df11fda2a7c3064418e173c38055
|
include/parrot/trace.h
|
include/parrot/trace.h
|
/* trace.h
* Copyright: (When this is determined...it will go here)
* CVS Info
* $Id$
* Overview:
* Tracing support for runops_cores.c.
* Data Structure and Algorithms:
* History:
* Notes:
* References:
*/
#ifndef PARROT_TRACE_H_GUARD
#define PARROT_TRACE_H_GUARD
#include "parrot/parrot.h"
void trace_op_dump(struct Parrot_Interp *interpreter, opcode_t *code_start,
opcode_t *pc);
void trace_op(struct Parrot_Interp *interpreter, opcode_t *code_start,
opcode_t *code_end, opcode_t *pc);
void trace_op_b0(struct Parrot_Interp *interpreter, opcode_t *code_start,
opcode_t *pc);
void trace_op_b1(struct Parrot_Interp *interpreter, opcode_t *code_start,
opcode_t *code_end, code_t *pc);
#endif
/*
* Local variables:
* c-indentation-style: bsd
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*
* vim: expandtab shiftwidth=4:
*/
|
/* trace.h
* Copyright: (When this is determined...it will go here)
* CVS Info
* $Id$
* Overview:
* Tracing support for runops_cores.c.
* Data Structure and Algorithms:
* History:
* Notes:
* References:
*/
#ifndef PARROT_TRACE_H_GUARD
#define PARROT_TRACE_H_GUARD
#include "parrot/parrot.h"
void trace_op_dump(struct Parrot_Interp *interpreter, opcode_t *code_start,
opcode_t *pc);
void trace_op(struct Parrot_Interp *interpreter, opcode_t *code_start,
opcode_t *code_end, opcode_t *pc);
void trace_op_b0(struct Parrot_Interp *interpreter, opcode_t *code_start,
opcode_t *pc);
void trace_op_b1(struct Parrot_Interp *interpreter, opcode_t *code_start,
opcode_t *code_end, opcode_t *pc);
#endif
/*
* Local variables:
* c-indentation-style: bsd
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*
* vim: expandtab shiftwidth=4:
*/
|
Fix a typo in the argument type.
|
Fix a typo in the argument type.
Patch from <daniel.ritz@gmx.ch>
git-svn-id: 6e74a02f85675cec270f5d931b0f6998666294a3@1106 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
|
C
|
artistic-2.0
|
gagern/parrot,FROGGS/parrot,parrot/parrot,youprofit/parrot,parrot/parrot,tkob/parrot,FROGGS/parrot,fernandobrito/parrot,FROGGS/parrot,tkob/parrot,parrot/parrot,tkob/parrot,gagern/parrot,gitster/parrot,FROGGS/parrot,gitster/parrot,tkob/parrot,tewk/parrot-select,fernandobrito/parrot,gagern/parrot,fernandobrito/parrot,gagern/parrot,parrot/parrot,gitster/parrot,fernandobrito/parrot,tewk/parrot-select,youprofit/parrot,youprofit/parrot,youprofit/parrot,youprofit/parrot,gagern/parrot,tewk/parrot-select,tewk/parrot-select,tkob/parrot,youprofit/parrot,gagern/parrot,fernandobrito/parrot,tewk/parrot-select,tkob/parrot,fernandobrito/parrot,FROGGS/parrot,FROGGS/parrot,tkob/parrot,youprofit/parrot,youprofit/parrot,gitster/parrot,tkob/parrot,gitster/parrot,gitster/parrot,tewk/parrot-select,gitster/parrot,tewk/parrot-select,FROGGS/parrot,FROGGS/parrot,fernandobrito/parrot,gagern/parrot,parrot/parrot
|
cc91506dc6cef57bed963d9e4d3aa002624d7a8b
|
drake/systems/plants/material_map.h
|
drake/systems/plants/material_map.h
|
#pragma once
#include <string>
#include <map>
#include <Eigen/Dense>
typedef std::map<std::string, Eigen::Vector4d, std::less<std::string>,
Eigen::aligned_allocator<
std::pair<std::string, Eigen::Vector4d> > > MaterialMap;
|
#pragma once
#include <string>
#include <map>
#include <Eigen/Dense>
typedef std::map<std::string, Eigen::Vector4d, std::less<std::string>,
Eigen::aligned_allocator<
std::pair<const std::string,
Eigen::Vector4d> > > MaterialMap;
|
Use pair<'const' Key, Value> in defining MaterialMap type
|
Use pair<'const' Key, Value> in defining MaterialMap type
Custom allocator to std::map should have std::pair<const Key, Value>
instead of pair<Key, Value>. libc++-3.8.0 actually started checking this
condition by adding static_assert. Without this patch, users (using
libc++>=3.8) see something like the following compiler error message:
/usr/local/Cellar/llvm/3.8.1/bin/../include/c++/v1/map:837:5: error: static_assert failed "Allocator::value_type must be same type as value_type"
static_assert((is_same<typename allocator_type::value_type, value_type>::value),
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/<PATH_TO_DRAKE>/drake/systems/plants/parser_urdf.cc:155:33: note: in instantiation of template class 'std::__1::map<std::__1::basic_string<char>, Eigen::Matrix<double, 4, 1, 0, 4, 1>, std::__1::less<std::__1::basic_string<char> >, Eigen::aligned_allocator<std::__1::pair<std::__1::basic_string<char>, Eigen::Matrix<double, 4, 1, 0, 4, 1> > > >' requested here
auto material_iter = materials->find(material_name);
|
C
|
bsd-3-clause
|
sheim/drake,sheim/drake,sheim/drake,billhoffman/drake,sheim/drake,billhoffman/drake,sheim/drake,sheim/drake,billhoffman/drake,billhoffman/drake,sheim/drake,billhoffman/drake,sheim/drake,billhoffman/drake,billhoffman/drake,billhoffman/drake
|
83dd74f6a0bf69102f807cfb9a904fce2b185594
|
utils/lstopo-xml.c
|
utils/lstopo-xml.c
|
/*
* Copyright © 2009 CNRS
* Copyright © 2009-2010 INRIA. All rights reserved.
* Copyright © 2009 Université Bordeaux 1
* Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
*/
#include <private/autogen/config.h>
#ifdef HWLOC_HAVE_XML
#include <hwloc.h>
#include <string.h>
#include "lstopo.h"
void output_xml(hwloc_topology_t topology, const char *filename, int logical __hwloc_attribute_unused, int legend __hwloc_attribute_unused, int verbose_mode __hwloc_attribute_unused)
{
if (!filename || !strcasecmp(filename, "-.xml"))
filename = "-";
hwloc_topology_export_xml(topology, filename);
}
#endif /* HWLOC_HAVE_XML */
|
/*
* Copyright © 2009 CNRS
* Copyright © 2009-2010 INRIA. All rights reserved.
* Copyright © 2009 Université Bordeaux 1
* Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
*/
#include <private/autogen/config.h>
#ifdef HWLOC_HAVE_XML
#include <hwloc.h>
#include <string.h>
#include "lstopo.h"
void output_xml(hwloc_topology_t topology, const char *filename, int logical __hwloc_attribute_unused, int legend __hwloc_attribute_unused, int verbose_mode __hwloc_attribute_unused)
{
if (!filename || !strcasecmp(filename, "-.xml"))
filename = "-";
if (hwloc_topology_export_xml(topology, filename) < 0) {
fprintf(stderr, "Failed to export XML to %s (%s)\n", filename, strerror(errno));
return;
}
}
#endif /* HWLOC_HAVE_XML */
|
Print an error when lstopo fails to export to X...
|
Print an error when lstopo fails to export to X...
Print an error when lstopo fails to export to XML
This commit was SVN r3691.
|
C
|
bsd-3-clause
|
ggouaillardet/hwloc,shekkbuilder/hwloc,shekkbuilder/hwloc,ggouaillardet/hwloc,shekkbuilder/hwloc,ggouaillardet/hwloc,ggouaillardet/hwloc,shekkbuilder/hwloc
|
02d32b05a69c125b9c30d7002f023de4bd55ab4b
|
src/auth/userdb-passwd.c
|
src/auth/userdb-passwd.c
|
/* Copyright (C) 2002-2003 Timo Sirainen */
#include "config.h"
#undef HAVE_CONFIG_H
#ifdef USERDB_PASSWD
#include "common.h"
#include "userdb.h"
#include <pwd.h>
static void passwd_lookup(const char *user, userdb_callback_t *callback,
void *context)
{
struct user_data data;
struct passwd *pw;
pw = getpwnam(user);
if (pw == NULL) {
if (errno != 0)
i_error("getpwnam(%s) failed: %m", user);
else if (verbose)
i_info("passwd(%s): unknown user", user);
callback(NULL, context);
return;
}
memset(&data, 0, sizeof(data));
data.uid = pw->pw_uid;
data.gid = pw->pw_gid;
data.virtual_user = data.system_user = pw->pw_name;
data.home = pw->pw_dir;
callback(&data, context);
}
struct userdb_module userdb_passwd = {
NULL, NULL,
passwd_lookup
};
#endif
|
/* Copyright (C) 2002-2003 Timo Sirainen */
#include "config.h"
#undef HAVE_CONFIG_H
#ifdef USERDB_PASSWD
#include "common.h"
#include "userdb.h"
#include <pwd.h>
static void passwd_lookup(const char *user, userdb_callback_t *callback,
void *context)
{
struct user_data data;
struct passwd *pw;
size_t len;
pw = getpwnam(user);
if (pw == NULL) {
if (errno != 0)
i_error("getpwnam(%s) failed: %m", user);
else if (verbose)
i_info("passwd(%s): unknown user", user);
callback(NULL, context);
return;
}
memset(&data, 0, sizeof(data));
data.uid = pw->pw_uid;
data.gid = pw->pw_gid;
data.virtual_user = data.system_user = pw->pw_name;
len = strlen(pw->pw_dir);
if (len < 3 || strcmp(pw->pw_dir + len - 3, "/./") != 0)
data.home = pw->pw_dir;
else {
/* wu-ftpd uses <chroot>/./<dir>. We don't support
the dir after chroot, but this should work well enough. */
data.home = t_strndup(pw->pw_dir, len-3);
data.chroot = TRUE;
}
callback(&data, context);
}
struct userdb_module userdb_passwd = {
NULL, NULL,
passwd_lookup
};
#endif
|
Support wu-ftpd-like chrooting in /etc/passwd. If home directory ends with "/./", it's chrooted to.
|
Support wu-ftpd-like chrooting in /etc/passwd. If home directory ends with
"/./", it's chrooted to.
--HG--
branch : HEAD
|
C
|
mit
|
jkerihuel/dovecot,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jkerihuel/dovecot,dscho/dovecot,jkerihuel/dovecot,dscho/dovecot,jkerihuel/dovecot,dscho/dovecot,dscho/dovecot,jkerihuel/dovecot,jwm/dovecot-notmuch,dscho/dovecot
|
92f0a3f1d26eb0a1513a94caa17de980a4979558
|
software/infnoise.h
|
software/infnoise.h
|
#include <stdbool.h>
#include <stdint.h>
#include <sys/types.h>
#include <ftdi.h>
// Structure for parsed command line options
struct opt_struct {
uint32_t outputMultiplier; // We output all the entropy when outputMultiplier == 0
bool daemon; // Run as daemon?
bool debug; // Print debugging info?
bool devRandom; // Feed /dev/random?
bool noOutput; // Supress output?
bool listDevices; // List possible USB-devices?
bool help; // Show help
bool none; // set to true when no valid arguments where detected
bool raw; // No whitening?
bool version; // Show version
char *pidFileName; // Name of optional PID-file
char *serial; // Name of selected device
};
void startDaemon(struct opt_struct *opts);
|
#include <stdbool.h>
#include <stdint.h>
#include <sys/types.h>
#include <linux/limits.h>
#include <ftdi.h>
// Structure for parsed command line options
struct opt_struct {
uint32_t outputMultiplier; // We output all the entropy when outputMultiplier == 0
bool daemon; // Run as daemon?
bool debug; // Print debugging info?
bool devRandom; // Feed /dev/random?
bool noOutput; // Supress output?
bool listDevices; // List possible USB-devices?
bool help; // Show help
bool none; // set to true when no valid arguments where detected
bool raw; // No whitening?
bool version; // Show version
char *pidFileName; // Name of optional PID-file
char *serial; // Name of selected device
};
void startDaemon(struct opt_struct *opts);
|
Fix related to missing include (PATH_MAX)
|
Fix related to missing include (PATH_MAX)
|
C
|
cc0-1.0
|
manuel-domke/infnoise,manuel-domke/infnoise,waywardgeek/infnoise,manuel-domke/infnoise,manuel-domke/infnoise,waywardgeek/infnoise,waywardgeek/infnoise,manuel-domke/infnoise,waywardgeek/infnoise
|
f784d4fd6fa0dc156d4512f40df337e6cc7c1f3c
|
SC4Fix/patcher.h
|
SC4Fix/patcher.h
|
#pragma once
#include <stdint.h>
#define ASMJMP(a) _asm { mov CPatcher::uJumpBuffer, a } _asm { jmp CPatcher::uJumpBuffer }
typedef void (*tfnHookFunc)(void);
class CPatcher {
public:
static void InstallHook(uint32_t uAddress, void (*pfnFunc)(void));
static void UninstallHook(uint32_t uAddress, uint8_t uFirstByte, uint32_t uOtherBytes);
static void InstallCallHook(uint32_t uAddress, void (*pfnFunc)(void));
static void InstallMethodHook(uint32_t uAddress, void (*pfnFunc)(void));
static void UnprotectAll(void);
static uint32_t uJumpBuffer;
};
|
#pragma once
#include <stdint.h>
#define ASMJMP(a) _asm { mov CPatcher::uJumpBuffer, a } _asm { jmp CPatcher::uJumpBuffer }
#define RETJMP(a) _asm { push a } _asm { ret }
typedef void (*tfnHookFunc)(void);
class CPatcher {
public:
static void InstallHook(uint32_t uAddress, void (*pfnFunc)(void));
static void UninstallHook(uint32_t uAddress, uint8_t uFirstByte, uint32_t uOtherBytes);
static void InstallCallHook(uint32_t uAddress, void (*pfnFunc)(void));
static void InstallMethodHook(uint32_t uAddress, void (*pfnFunc)(void));
static void UnprotectAll(void);
static uint32_t uJumpBuffer;
};
|
Add RETJMP for jumping to dynamic addresses
|
Add RETJMP for jumping to dynamic addresses
|
C
|
mit
|
nsgomez/sc4fix,nsgomez/sc4fix,nsgomez/sc4fix
|
a42dff69c2d9260223aa34c0c5c23ab7128644a7
|
gnu/lib/libdialog/notify.c
|
gnu/lib/libdialog/notify.c
|
/*
* File: notify.c
* Author: Marc van Kempen
* Desc: display a notify box with a message
*
* Copyright (c) 1995, Marc van Kempen
*
* All rights reserved.
*
* This software may be used, modified, copied, distributed, and
* sold, in both source and binary form provided that the above
* copyright and these terms are retained, verbatim, as the first
* lines of this file. Under no circumstances is the author
* responsible for the proper functioning of this software, nor does
* the author assume any responsibility for damages incurred with
* its use.
*
*/
#include <dialog.h>
#include <stdio.h>
void
dialog_notify(char *msg)
/*
* Desc: display an error message
*/
{
char *tmphlp;
WINDOW *w;
w = dupwin(newscr);
if (w == NULL) {
endwin();
fprintf(stderr, "\ndupwin(newscr) failed, malloc memory corrupted\n");
exit(1);
}
tmphlp = get_helpline();
use_helpline("Press enter to continue");
dialog_mesgbox("Message", msg, -1, -1, TRUE);
restore_helpline(tmphlp);
touchwin(w);
wrefresh(w);
delwin(w);
return;
} /* dialog_notify() */
|
/*
* File: notify.c
* Author: Marc van Kempen
* Desc: display a notify box with a message
*
* Copyright (c) 1995, Marc van Kempen
*
* All rights reserved.
*
* This software may be used, modified, copied, distributed, and
* sold, in both source and binary form provided that the above
* copyright and these terms are retained, verbatim, as the first
* lines of this file. Under no circumstances is the author
* responsible for the proper functioning of this software, nor does
* the author assume any responsibility for damages incurred with
* its use.
*
*/
#include <dialog.h>
#include <stdio.h>
void
dialog_notify(char *msg)
/*
* Desc: display an error message
*/
{
char *tmphlp;
WINDOW *w;
w = dupwin(newscr);
if (w == NULL) {
endwin();
fprintf(stderr, "\ndupwin(newscr) failed, malloc memory corrupted\n");
exit(1);
}
tmphlp = get_helpline();
use_helpline("Press enter to continue");
dialog_mesgbox("Message", msg, -1, -1);
restore_helpline(tmphlp);
touchwin(w);
wrefresh(w);
delwin(w);
return;
} /* dialog_notify() */
|
Remove extra argument from mesgbox
|
Remove extra argument from mesgbox
|
C
|
bsd-3-clause
|
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
|
e5135809c3e77f8f1cf0e84840220c789421b712
|
src/OsmTileSource.h
|
src/OsmTileSource.h
|
/*
* OsmTileSource.h
* RunParticles
*
* Created by Doug Letterman on 6/30/14.
* Copyright 2014 Doug Letterman. All rights reserved.
*
*/
#ifndef OSMTILESOURCE_H
#define OSMTILESOURCE_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include "Singleton.h"
#include "math.h"
struct OsmTile {
unsigned int x, y, z;
};
template<typename T>
struct OsmTileHash
{
std::size_t operator()(const T& t) const
{
unsigned int offset = 0;
for (unsigned int i=1; i < t.z; i++) {
offset += pow(2, 2*i);
}
unsigned int edge = pow(2, t.z);
return std::size_t(offset + t.x * edge + t.y);
}
};
class OsmTileSource : public QObject
{
Q_OBJECT
public:
void getTile(int x, int y, int z);
signals:
void tileReady(int x, int y, int z);
public slots:
void onRequestFinished(QNetworkReply *reply);
protected:
};
#endif
|
/*
* OsmTileSource.h
* RunParticles
*
* Created by Doug Letterman on 6/30/14.
* Copyright 2014 Doug Letterman. All rights reserved.
*
*/
#ifndef OSMTILESOURCE_H
#define OSMTILESOURCE_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include "Singleton.h"
#include "math.h"
struct OsmTile {
unsigned int x, y, z;
};
template<typename T>
struct OsmTileHash
{
std::size_t operator()(const T& t) const
{
unsigned long offset = 0;
for (int i=1; i < t.z; i++) {
offset += pow(2, 2*i);
}
int edge = pow(2, t.z);
return std::size_t(offset + t.x * edge + t.y);
}
};
class OsmTileSource : public QObject
{
Q_OBJECT
public:
void getTile(int x, int y, int z);
signals:
void tileReady(int x, int y, int z);
public slots:
void onRequestFinished(QNetworkReply *reply);
protected:
};
#endif
|
Use an unsigned long offset instead of int.
|
Use an unsigned long offset instead of int.
|
C
|
mit
|
dal/RunParticles,dal/RunParticles,dal/RunParticles
|
a36438803b5ad4058fd7177d09c851f356e4e69a
|
include/stdlib.h
|
include/stdlib.h
|
#ifndef _FXCG_STDLIB_H
#define _FXCG_STDLIB_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
long abs(long n);
void free(void *p);
void *malloc(size_t sz);
void *realloc(void *p, size_t sz);
int rand(void);
void srand(unsigned seed);
long strtol(const char *str, char **str_end, int base);
void qsort(void *base, size_t nel, size_t width, int (*compar)(const void *, const void *));
void exit(int status);
#ifdef __cplusplus
}
#endif
#endif
|
#ifndef _FXCG_STDLIB_H
#define _FXCG_STDLIB_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
long abs(long n);
void free(void *p);
void *malloc(size_t sz);
void *realloc(void *p, size_t sz);
int rand(void);
void srand(unsigned seed);
long strtol(const char *str, char **str_end, int base);
#define atoi(s) ((int)strtol(s, NULL, 10))
#define atol(s) strtol(s, NULL, 10)
void qsort(void *base, size_t nel, size_t width, int (*compar)(const void *, const void *));
void exit(int status);
#ifdef __cplusplus
}
#endif
#endif
|
Add definitions for atio and atol.
|
Add definitions for atio and atol.
|
C
|
bsd-3-clause
|
Forty-Bot/libfxcg,ComputerNerd/libfxcg-copyleft,ComputerNerd/libfxcg-copyleft,ComputerNerd/libfxcg-copyleft,Forty-Bot/libfxcg,Forty-Bot/libfxcg,Jonimoose/libfxcg,Forty-Bot/libfxcg,Jonimoose/libfxcg,ComputerNerd/libfxcg-copyleft,Jonimoose/libfxcg
|
15b5dd569501f0e4a66d7970238a1a87b0d9c4a7
|
src/file/dl_posix.c
|
src/file/dl_posix.c
|
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include "dl.h"
#include "util/macro.h"
#include "util/logging.h"
#include <stdlib.h>
#include <dlfcn.h>
#include <string.h>
// Note the dlopen takes just the name part. "aacs", internally we
// translate to "libaacs.so" "libaacs.dylib" or "aacs.dll".
void *dl_dlopen ( const char* name )
{
char *path;
int len;
void *result;
#ifdef __APPLE__
len = strlen(name) + 3 + 6 + 1;
path = (char *) malloc(len);
if (!path) return NULL;
snprintf(path, len, "lib%s.dylib", name);
#else
len = strlen(name) + 3 + 3 + 1;
path = (char *) malloc(len);
if (!path) return NULL;
snprintf(path, len, "lib%s.so", name);
#endif
DEBUG(DBG_BDPLUS, "searching for library '%s' ...\n", path);
result = dlopen(path, RTLD_LAZY);
if (!result) {
DEBUG(DBG_FILE | DBG_CRIT, "can't open library '%s': %s\n", path, dlerror());
}
free(path);
return result;
}
void *dl_dlsym ( void* handle, const char* symbol )
{
void *result = dlsym(handle, symbol);
if (!result) {
DEBUG(DBG_FILE | DBG_CRIT, "dlsym(%p, '%s') failed: %s\n", handle, symbol, dlerror());
}
return result;
}
int dl_dlclose ( void* handle )
{
return dlclose(handle);
}
|
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include "dl.h"
#include "util/macro.h"
#include "util/logging.h"
#include <stdlib.h>
#include <dlfcn.h>
#include <string.h>
void *dl_dlopen ( const char* path )
{
DEBUG(DBG_BDPLUS, "searching for library '%s' ...\n", path);
void *result = dlopen(path, RTLD_LAZY);
if (!result) {
DEBUG(DBG_FILE | DBG_CRIT, "can't open library '%s': %s\n", path, dlerror());
}
return result;
}
void *dl_dlsym ( void* handle, const char* symbol )
{
void *result = dlsym(handle, symbol);
if (!result) {
DEBUG(DBG_FILE | DBG_CRIT, "dlsym(%p, '%s') failed: %s\n", handle, symbol, dlerror());
}
return result;
}
int dl_dlclose ( void* handle )
{
return dlclose(handle);
}
|
Change dlopening of libs to call libraries with their major version on linux systems
|
Change dlopening of libs to call libraries with their major version on linux systems
|
C
|
lgpl-2.1
|
ShiftMediaProject/libaacs,zxlooong/libaacs,mwgoldsmith/aacs,ShiftMediaProject/libaacs,mwgoldsmith/aacs,zxlooong/libaacs,rraptorr/libaacs,rraptorr/libaacs
|
7a15de88ba3e92564b3b7bdf6ab6ea6fd246de44
|
include/platform/compiler/msvc.h
|
include/platform/compiler/msvc.h
|
#pragma once
// Clobber previous definitions with extreme prejudice
#ifdef UNUSED
# undef UNUSED
#endif
#ifdef likely
# undef likely
#endif
#ifdef unlikely
# undef unlikely
#endif
#ifdef alignment
# undef alignment
#endif
#define UNUSED __pragma(warning(disable:4100))
#define unlikely(x) (x)
#define likely(x) (x)
#define alignment(x) __declspec(align(x))
#if (_MSC_VER >= 1400)
# define restrict __restrict
#else
# define restrict
#endif
#if (MSC_VER <= 1500) && !defined(cplusplus)
# define inline __inline
#endif
#pragma warning(disable:4201 4214)
#ifndef HAVE_STDINT_H
# include "platform/os/stdint_msvc.h"
#endif
#if !defined(HAVE_STDBOOL_H) && !defined(cplusplus)
# include <Windows.h>
typedef BOOL bool;
# define true TRUE
# define false FALSE
#endif
|
#pragma once
// Clobber previous definitions with extreme prejudice
#ifdef UNUSED
# undef UNUSED
#endif
#ifdef likely
# undef likely
#endif
#ifdef unlikely
# undef unlikely
#endif
#ifdef alignment
# undef alignment
#endif
#define unlikely(x) (x)
#define likely(x) (x)
#define alignment(x) __declspec(align(x))
#if (_MSC_VER >= 1300)
# define UNUSED __pragma(warning(disable:4100))
#else
# define UNUSED
#endif
#if (_MSC_VER >= 1400)
# define restrict __restrict
#else
# define restrict
#endif
#if (MSC_VER <= 1500) && !defined(cplusplus)
# define inline __inline
#endif
#pragma warning(disable:4201 4214)
#ifndef HAVE_STDINT_H
# include "platform/os/stdint_msvc.h"
#endif
#if !defined(HAVE_STDBOOL_H) && !defined(cplusplus)
# include <Windows.h>
typedef BOOL bool;
# define true TRUE
# define false FALSE
#endif
|
Fix build on older MSVC.
|
Fix build on older MSVC.
|
C
|
bsd-3-clause
|
foxkit-us/supergameherm,supergameherm/supergameherm
|
f69f3b12f10e133e9552d15291c1c9c236aed6b8
|
list.h
|
list.h
|
#include <stdlib.h>
#ifndef __LIST_H__
#define __LIST_H__
struct ListNode;
struct List;
typedef struct ListNode ListNode;
typedef struct List List;
List* List_Create(void);
void List_Destroy(List* l);
ListNode* ListNode_Create(void * k);
void ListNode_Destroy(ListNode* n);
ListNode* List_Search(List* l, void* k, int (f)(void*, void*));
void List_Insert(List* l, ListNode* n);
void List_Delete(List* l, ListNode* n);
#endif
|
#include <stdlib.h>
#ifndef __LIST_H__
#define __LIST_H__
struct ListNode;
struct List;
typedef struct ListNode ListNode;
typedef struct List List;
List* List_Create(void);
void List_Destroy(List* l);
ListNode* ListNode_Create(void* k);
void ListNode_Destroy(ListNode* n);
ListNode* List_Search(List* l, void* k, int (f)(void*, void*));
void List_Insert(List* l, ListNode* n);
void List_Delete(List* l, ListNode* n);
#endif
|
Fix spacing in parameter for readability
|
Fix spacing in parameter for readability
|
C
|
mit
|
MaxLikelihood/CADT
|
4981c2107f53231c8a76b6b6ae8ebef10eaea32a
|
src/Numerics/Optimizers/AmoebaOptimizer/ExampleCostFunction.h
|
src/Numerics/Optimizers/AmoebaOptimizer/ExampleCostFunction.h
|
//
// Created by Mathew Seng on 2019-06-03.
//
#ifndef ExampleCostFunction_h
#define ExampleCostFunction_h
#include "itkSingleValuedCostFunction.h"
namespace itk
{
class ExampleCostFunction2 : public SingleValuedCostFunction
{
public:
/** Standard class typedefs. */
typedef ExampleCostFunction2 Self;
typedef SingleValuedCostFunction Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(ExampleCostFunction2, SingleValuedCostfunction);
unsigned int
GetNumberOfParameters(void) const override
{
return 2;
} // itk::CostFunction
MeasureType
GetValue(const ParametersType & parameters) const override
{
return pow(parameters[0] + 5, 2) + pow(parameters[1] - 7, 2) + 5;
}
void
GetDerivative(const ParametersType &, DerivativeType & /*derivative*/) const override
{
throw itk::ExceptionObject(__FILE__, __LINE__, "No derivative is available for this cost function.");
}
protected:
ExampleCostFunction2() = default;
;
~ExampleCostFunction2() override = default;
;
private:
ExampleCostFunction2(const Self &) = delete; // purposely not implemented
void
operator=(const Self &) = delete; // purposely not implemented
};
} // end namespace itk
#endif
|
//
// Created by Mathew Seng on 2019-06-03.
//
#ifndef ExampleCostFunction_h
#define ExampleCostFunction_h
#include "itkSingleValuedCostFunction.h"
namespace itk
{
class ExampleCostFunction2 : public SingleValuedCostFunction
{
public:
/** Standard class typedefs. */
typedef ExampleCostFunction2 Self;
typedef SingleValuedCostFunction Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(ExampleCostFunction2, SingleValuedCostfunction);
unsigned int
GetNumberOfParameters() const override
{
return 2;
} // itk::CostFunction
MeasureType
GetValue(const ParametersType & parameters) const override
{
return pow(parameters[0] + 5, 2) + pow(parameters[1] - 7, 2) + 5;
}
void
GetDerivative(const ParametersType &, DerivativeType & /*derivative*/) const override
{
throw itk::ExceptionObject(__FILE__, __LINE__, "No derivative is available for this cost function.");
}
protected:
ExampleCostFunction2() = default;
;
~ExampleCostFunction2() override = default;
;
private:
ExampleCostFunction2(const Self &) = delete; // purposely not implemented
void
operator=(const Self &) = delete; // purposely not implemented
};
} // end namespace itk
#endif
|
Remove redundant void argument lists
|
STYLE: Remove redundant void argument lists
Find and remove redundant void argument lists.
|
C
|
apache-2.0
|
InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples
|
e80f1b331482c558a01f78b87704bc7c23b40639
|
alura/c/adivinhacao.c
|
alura/c/adivinhacao.c
|
#include <stdio.h>
int main() {
// imprime o cabecalho do nosso jogo
printf("******************************************\n");
printf("* Bem vindo ao nosso jogo de adivinhação *\n");
printf("******************************************\n");
}
|
#include <stdio.h>
int main() {
// imprime o cabecalho do nosso jogo
printf("******************************************\n");
printf("* Bem vindo ao nosso jogo de adivinhação *\n");
printf("******************************************\n");
int numerosecreto = 42;
printf("O número %d é o secreto. Não conta pra ninguém!\n", numerosecreto);
}
|
Update file, Alura, Introdução a C, Aula 1
|
Update file, Alura, Introdução a C, Aula 1
|
C
|
mit
|
fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs
|
646a3d3712809df66fa90bcd7ef21d3659a3e833
|
mudlib/mud/home/Test/initd.c
|
mudlib/mud/home/Test/initd.c
|
/*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2010, 2012, 2013, 2014 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/system.h>
inherit LIB_INITD;
inherit UTILITY_COMPILE;
static void create()
{
KERNELD->set_global_access("Test", 1);
load_dir("obj", 1);
load_dir("sys", 1);
}
|
/*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2010, 2012, 2013, 2014 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/system.h>
inherit LIB_INITD;
inherit UTILITY_COMPILE;
static void create()
{
KERNELD->set_global_access("Test", 1);
load_dir("obj", 1);
load_dir("sys", 1);
}
void bomb(int quota)
{
if (quota) {
quota--;
clone_object("obj/bomb");
call_out("bomb", 0, quota);
}
}
|
Allow test subsystem to set off clone bombs
|
Allow test subsystem to set off clone bombs
|
C
|
agpl-3.0
|
shentino/kotaka,shentino/kotaka,shentino/kotaka
|
42ee2e0938c7adec8da26ac544204d32f3af709b
|
include/fs/fs_interface.h
|
include/fs/fs_interface.h
|
/*
* Copyright (c) 2016 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_
#define ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_
#ifdef __cplusplus
extern "C" {
#endif
#if defined(CONFIG_FILE_SYSTEM_LITTLEFS)
#define MAX_FILE_NAME 256
#else /* FAT_FS */
#define MAX_FILE_NAME 12 /* Uses 8.3 SFN */
#endif
struct fs_mount_t;
/**
* @brief File object representing an open file
*
* @param Pointer to FATFS file object structure
* @param mp Pointer to mount point structure
*/
struct fs_file_t {
void *filep;
const struct fs_mount_t *mp;
};
/**
* @brief Directory object representing an open directory
*
* @param dirp Pointer to directory object structure
* @param mp Pointer to mount point structure
*/
struct fs_dir_t {
void *dirp;
const struct fs_mount_t *mp;
};
#ifdef __cplusplus
}
#endif
#endif /* ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_ */
|
/*
* Copyright (c) 2016 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_
#define ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_
#ifdef __cplusplus
extern "C" {
#endif
#if defined(CONFIG_FILE_SYSTEM_LITTLEFS)
#define MAX_FILE_NAME 256
#elif defined(CONFIG_FAT_FILESYSTEM_ELM)
#if defined(CONFIG_FS_FATFS_LFN)
#define MAX_FILE_NAME CONFIG_FS_FATFS_MAX_LFN
#else /* CONFIG_FS_FATFS_LFN */
#define MAX_FILE_NAME 12 /* Uses 8.3 SFN */
#endif /* CONFIG_FS_FATFS_LFN */
#else /* filesystem selection */
/* Use standard 8.3 when no filesystem is explicitly selected */
#define MAX_FILE_NAME 12
#endif /* filesystem selection */
struct fs_mount_t;
/**
* @brief File object representing an open file
*
* @param Pointer to FATFS file object structure
* @param mp Pointer to mount point structure
*/
struct fs_file_t {
void *filep;
const struct fs_mount_t *mp;
};
/**
* @brief Directory object representing an open directory
*
* @param dirp Pointer to directory object structure
* @param mp Pointer to mount point structure
*/
struct fs_dir_t {
void *dirp;
const struct fs_mount_t *mp;
};
#ifdef __cplusplus
}
#endif
#endif /* ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_ */
|
Set MAX_FILE_NAME appropiately with LFN and FATFS
|
fs: Set MAX_FILE_NAME appropiately with LFN and FATFS
Try to define MAX_FILE_NAME to the appropriate max length based on the
selected filesystm. Otherwise fallback to a standard filename of 12
(made up of 8.3 : <filename>.<extension>)
Signed-off-by: Roman Vaughan <1620c2a00a7840d4515361aacd4b41348f2a8a7d@gmail.com>
|
C
|
apache-2.0
|
galak/zephyr,Vudentz/zephyr,finikorg/zephyr,galak/zephyr,nashif/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,Vudentz/zephyr,finikorg/zephyr,Vudentz/zephyr,finikorg/zephyr,Vudentz/zephyr,nashif/zephyr,Vudentz/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,finikorg/zephyr,galak/zephyr,finikorg/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr
|
cfa41a9669ff7675bf6c92d4cbdf7e142c98e4ab
|
subsys/ChTerrain.h
|
subsys/ChTerrain.h
|
// =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All right reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of the distribution and at
// http://projectchrono.org/license-chrono.txt.
//
// =============================================================================
// Authors: Radu Serban
// =============================================================================
//
// Base class for a terrain subsystem.
//
// =============================================================================
#ifndef CH_TERRAIN_H
#define CH_TERRAIN_H
#include "core/ChShared.h"
#include "subsys/ChApiSubsys.h"
namespace chrono {
class CH_SUBSYS_API ChTerrain : public ChShared {
public:
ChTerrain() {}
virtual ~ChTerrain() {}
virtual void Update(double time) {}
virtual void Advance(double step) {}
virtual double GetHeight(double x, double y) const = 0;
};
} // end namespace chrono
#endif
|
// =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All right reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of the distribution and at
// http://projectchrono.org/license-chrono.txt.
//
// =============================================================================
// Authors: Radu Serban
// =============================================================================
//
// Base class for a terrain subsystem.
//
// =============================================================================
#ifndef CH_TERRAIN_H
#define CH_TERRAIN_H
#include "core/ChShared.h"
#include "core/ChVector.h"
#include "subsys/ChApiSubsys.h"
namespace chrono {
class CH_SUBSYS_API ChTerrain : public ChShared {
public:
ChTerrain() {}
virtual ~ChTerrain() {}
virtual void Update(double time) {}
virtual void Advance(double step) {}
virtual double GetHeight(double x, double y) const = 0;
//// TODO: make this a pure virtual function...
virtual ChVector<> GetNormal(double x, double y) const { return ChVector<>(0, 0, 1); }
};
} // end namespace chrono
#endif
|
Add normal information to terrain.
|
Add normal information to terrain.
|
C
|
bsd-3-clause
|
hsu/chrono-vehicle,hsu/chrono-vehicle,hsu/chrono-vehicle
|
5b8870f2f915415859e794b27d0bfd8d5521cf01
|
include/jwtxx/jwt.h
|
include/jwtxx/jwt.h
|
#pragma once
#include <string>
#include <memory>
#include <stdexcept>
namespace JWTXX
{
enum class Algorithm {
HS256, HS384, HS512,
RS256, RS384, RS512,
ES256, ES384, ES512,
none
};
class Key
{
public:
struct Error : std::runtime_error
{
Error(const std::string& message) : runtime_error(error) {}
};
Key(Algorithm alg, const std::string& keyData);
std::string sign(const void* data, size_t size) const;
bool verify(const void* data, size_t size, const std::string& signature) const;
struct Impl;
private:
std::unique_ptr<Impl> m_impl;
};
class JWT
{
public:
typedef std::unordered_map<std::string, std::string> Pairs;
JWT(const std::string& token, Key key);
JWT(Algorithm alg, Pairs claims, Pairs header = Pairs());
Algorithm alg() const { return m_alg; }
const Pairs& claims() const { return m_claims; }
const Pairs& header() const { return m_header; }
std::string claim(const std::string& name) const;
std::string token(const std::string& keyData) const;
private:
Algorithm m_alg;
Pairs m_header;
Pairs m_claims;
};
}
|
#pragma once
#include <string>
#include <unordered_map>
#include <memory>
#include <stdexcept>
namespace JWTXX
{
enum class Algorithm {
HS256, HS384, HS512,
RS256, RS384, RS512,
ES256, ES384, ES512,
none
};
class Key
{
public:
struct Error : std::runtime_error
{
Error(const std::string& message) : runtime_error(message) {}
};
Key(Algorithm alg, const std::string& keyData);
std::string sign(const void* data, size_t size) const;
bool verify(const void* data, size_t size, const std::string& signature) const;
struct Impl;
private:
std::unique_ptr<Impl> m_impl;
};
class JWT
{
public:
typedef std::unordered_map<std::string, std::string> Pairs;
JWT(const std::string& token, Key key);
JWT(Algorithm alg, Pairs claims, Pairs header = Pairs());
Algorithm alg() const { return m_alg; }
const Pairs& claims() const { return m_claims; }
const Pairs& header() const { return m_header; }
std::string claim(const std::string& name) const;
std::string token(const std::string& keyData) const;
private:
Algorithm m_alg;
Pairs m_header;
Pairs m_claims;
};
}
|
Add missing include, fix variable name.
|
Add missing include, fix variable name.
|
C
|
mit
|
RealImage/jwtxx,RealImage/jwtxx,madf/jwtxx,madf/jwtxx
|
506b70663d252ee7a184356634d98789e25d747e
|
lib.h
|
lib.h
|
#define NULL ((void *)0)
#define MIN(_a, _b) \
({ \
__typeof__(_a) __a = (_a); \
__typeof__(_b) __b = (_b); \
__a <= __b ? __a : __b; \
})
#define MAX(_a, _b) \
({ \
__typeof__(_a) __a = (_a); \
__typeof__(_b) __b = (_b); \
__a >= __b ? __a : __b; \
})
#define NELEM(x) (sizeof(x)/sizeof((x)[0]))
#define cmpswap(ptr, old, new) __sync_bool_compare_and_swap(ptr, old, new)
#define subfetch(ptr, val) __sync_sub_and_fetch(ptr, val)
#define fetchadd(ptr, val) __sync_fetch_and_add(ptr, val)
#define __offsetof offsetof
|
#ifndef NULL
#define NULL ((void *)0)
#endif
#define MIN(_a, _b) \
({ \
__typeof__(_a) __a = (_a); \
__typeof__(_b) __b = (_b); \
__a <= __b ? __a : __b; \
})
#define MAX(_a, _b) \
({ \
__typeof__(_a) __a = (_a); \
__typeof__(_b) __b = (_b); \
__a >= __b ? __a : __b; \
})
#define NELEM(x) (sizeof(x)/sizeof((x)[0]))
#define cmpswap(ptr, old, new) __sync_bool_compare_and_swap(ptr, old, new)
#define subfetch(ptr, val) __sync_sub_and_fetch(ptr, val)
#define fetchadd(ptr, val) __sync_fetch_and_add(ptr, val)
#define __offsetof offsetof
|
Check ifndef NULL before define NULL, because clang stddef.h defines NULL
|
Check ifndef NULL before define NULL, because clang stddef.h defines NULL
|
C
|
mit
|
aclements/sv6,bowlofstew/sv6,bowlofstew/sv6,aclements/sv6,aclements/sv6,aclements/sv6,bowlofstew/sv6,bowlofstew/sv6,aclements/sv6,bowlofstew/sv6
|
c46c6a4191ef841fb9e5c852985cbaef31846329
|
scipy/fftpack/src/zfftnd.c
|
scipy/fftpack/src/zfftnd.c
|
/*
Interface to various FFT libraries.
Double complex FFT and IFFT, arbitrary dimensions.
Author: Pearu Peterson, August 2002
*/
#include "fftpack.h"
/* The following macro convert private backend specific function to the public
* functions exported by the module */
#define GEN_PUBLIC_API(name) \
void destroy_zfftnd_cache(void)\
{\
destroy_zfftnd_##name##_caches();\
}\
\
void zfftnd(complex_double * inout, int rank,\
int *dims, int direction, int howmany, int normalize)\
{\
zfftnd_##name(inout, rank, dims, direction, howmany, normalize);\
}
#if defined(WITH_FFTW) || defined(WITH_MKL)
static
int equal_dims(int rank,int *dims1,int *dims2) {
int i;
for (i=0;i<rank;++i)
if (dims1[i]!=dims2[i])
return 0;
return 1;
}
#endif
#ifdef WITH_FFTW3
#include "zfftnd_fftw3.c"
GEN_PUBLIC_API(fftw3)
#elif defined WITH_FFTW
#include "zfftnd_fftw.c"
GEN_PUBLIC_API(fftw)
#elif defined WITH_MKL
#include "zfftnd_mkl.c"
GEN_PUBLIC_API(mkl)
#else /* Use fftpack by default */
#include "zfftnd_fftpack.c"
GEN_PUBLIC_API(fftpack)
#endif
|
/*
Interface to various FFT libraries.
Double complex FFT and IFFT, arbitrary dimensions.
Author: Pearu Peterson, August 2002
*/
#include "fftpack.h"
/* The following macro convert private backend specific function to the public
* functions exported by the module */
#define GEN_PUBLIC_API(name) \
void destroy_zfftnd_cache(void)\
{\
destroy_zfftnd_##name##_caches();\
}\
\
void zfftnd(complex_double * inout, int rank,\
int *dims, int direction, int howmany, int normalize)\
{\
zfftnd_##name(inout, rank, dims, direction, howmany, normalize);\
}
#include "zfftnd_fftpack.c"
GEN_PUBLIC_API(fftpack)
|
Remove any non-fftpack code for complex, multi-dimension fft.
|
Remove any non-fftpack code for complex, multi-dimension fft.
|
C
|
bsd-3-clause
|
lhilt/scipy,zaxliu/scipy,behzadnouri/scipy,andyfaff/scipy,andim/scipy,newemailjdm/scipy,gef756/scipy,jor-/scipy,fernand/scipy,witcxc/scipy,Eric89GXL/scipy,behzadnouri/scipy,futurulus/scipy,gef756/scipy,gfyoung/scipy,ogrisel/scipy,mdhaber/scipy,maciejkula/scipy,bkendzior/scipy,ilayn/scipy,chatcannon/scipy,aarchiba/scipy,cpaulik/scipy,juliantaylor/scipy,pyramania/scipy,felipebetancur/scipy,jseabold/scipy,juliantaylor/scipy,Dapid/scipy,minhlongdo/scipy,haudren/scipy,petebachant/scipy,fernand/scipy,sargas/scipy,jsilter/scipy,minhlongdo/scipy,jor-/scipy,mingwpy/scipy,felipebetancur/scipy,maciejkula/scipy,vhaasteren/scipy,matthewalbani/scipy,mortonjt/scipy,niknow/scipy,pschella/scipy,vberaudi/scipy,felipebetancur/scipy,mortada/scipy,vanpact/scipy,zxsted/scipy,FRidh/scipy,aman-iitj/scipy,ales-erjavec/scipy,maciejkula/scipy,zerothi/scipy,perimosocordiae/scipy,jamestwebber/scipy,jor-/scipy,jakevdp/scipy,sauliusl/scipy,vigna/scipy,ales-erjavec/scipy,mgaitan/scipy,vberaudi/scipy,fernand/scipy,chatcannon/scipy,mortonjt/scipy,dominicelse/scipy,juliantaylor/scipy,mingwpy/scipy,dominicelse/scipy,WillieMaddox/scipy,mingwpy/scipy,surhudm/scipy,sriki18/scipy,anntzer/scipy,piyush0609/scipy,matthewalbani/scipy,mdhaber/scipy,surhudm/scipy,pyramania/scipy,juliantaylor/scipy,Kamp9/scipy,sauliusl/scipy,apbard/scipy,aarchiba/scipy,richardotis/scipy,aeklant/scipy,raoulbq/scipy,sargas/scipy,aman-iitj/scipy,sonnyhu/scipy,mortada/scipy,trankmichael/scipy,Kamp9/scipy,kleskjr/scipy,jakevdp/scipy,ales-erjavec/scipy,lukauskas/scipy,giorgiop/scipy,hainm/scipy,cpaulik/scipy,pnedunuri/scipy,Stefan-Endres/scipy,giorgiop/scipy,zerothi/scipy,mgaitan/scipy,Dapid/scipy,ales-erjavec/scipy,hainm/scipy,newemailjdm/scipy,jsilter/scipy,matthew-brett/scipy,nvoron23/scipy,rgommers/scipy,lhilt/scipy,befelix/scipy,nmayorov/scipy,minhlongdo/scipy,bkendzior/scipy,endolith/scipy,andyfaff/scipy,nvoron23/scipy,behzadnouri/scipy,kleskjr/scipy,haudren/scipy,gfyoung/scipy,sonnyhu/scipy,vhaasteren/scipy,raoulbq/scipy,dch312/scipy,FRidh/scipy,perimosocordiae/scipy,woodscn/scipy,aeklant/scipy,aman-iitj/scipy,pizzathief/scipy,mgaitan/scipy,pschella/scipy,newemailjdm/scipy,mgaitan/scipy,mhogg/scipy,kleskjr/scipy,jor-/scipy,rgommers/scipy,sonnyhu/scipy,dominicelse/scipy,mikebenfield/scipy,anntzer/scipy,witcxc/scipy,jakevdp/scipy,zxsted/scipy,e-q/scipy,petebachant/scipy,richardotis/scipy,nmayorov/scipy,rmcgibbo/scipy,gfyoung/scipy,pbrod/scipy,njwilson23/scipy,anntzer/scipy,gfyoung/scipy,vberaudi/scipy,grlee77/scipy,richardotis/scipy,ilayn/scipy,lukauskas/scipy,matthew-brett/scipy,andim/scipy,nvoron23/scipy,vhaasteren/scipy,larsmans/scipy,vigna/scipy,person142/scipy,trankmichael/scipy,lukauskas/scipy,matthewalbani/scipy,Stefan-Endres/scipy,ChanderG/scipy,gfyoung/scipy,befelix/scipy,mortonjt/scipy,apbard/scipy,witcxc/scipy,argriffing/scipy,pnedunuri/scipy,sauliusl/scipy,cpaulik/scipy,pyramania/scipy,WarrenWeckesser/scipy,piyush0609/scipy,vhaasteren/scipy,person142/scipy,vanpact/scipy,maniteja123/scipy,Shaswat27/scipy,andim/scipy,witcxc/scipy,apbard/scipy,trankmichael/scipy,kleskjr/scipy,e-q/scipy,Dapid/scipy,zxsted/scipy,niknow/scipy,sonnyhu/scipy,futurulus/scipy,mortada/scipy,cpaulik/scipy,piyush0609/scipy,Srisai85/scipy,FRidh/scipy,futurulus/scipy,sauliusl/scipy,njwilson23/scipy,woodscn/scipy,FRidh/scipy,scipy/scipy,teoliphant/scipy,rgommers/scipy,ilayn/scipy,argriffing/scipy,mtrbean/scipy,Gillu13/scipy,Gillu13/scipy,teoliphant/scipy,Newman101/scipy,zxsted/scipy,mhogg/scipy,mikebenfield/scipy,behzadnouri/scipy,haudren/scipy,felipebetancur/scipy,lhilt/scipy,rmcgibbo/scipy,maniteja123/scipy,futurulus/scipy,fredrikw/scipy,chatcannon/scipy,jseabold/scipy,surhudm/scipy,pbrod/scipy,njwilson23/scipy,anntzer/scipy,josephcslater/scipy,njwilson23/scipy,ogrisel/scipy,vigna/scipy,tylerjereddy/scipy,fredrikw/scipy,maniteja123/scipy,gertingold/scipy,cpaulik/scipy,grlee77/scipy,grlee77/scipy,piyush0609/scipy,pnedunuri/scipy,ilayn/scipy,Srisai85/scipy,pyramania/scipy,mhogg/scipy,Kamp9/scipy,Stefan-Endres/scipy,jseabold/scipy,WarrenWeckesser/scipy,raoulbq/scipy,lhilt/scipy,lukauskas/scipy,apbard/scipy,gertingold/scipy,kalvdans/scipy,aeklant/scipy,pbrod/scipy,jsilter/scipy,petebachant/scipy,Kamp9/scipy,mtrbean/scipy,argriffing/scipy,juliantaylor/scipy,andyfaff/scipy,Eric89GXL/scipy,haudren/scipy,mtrbean/scipy,hainm/scipy,hainm/scipy,pyramania/scipy,aman-iitj/scipy,pnedunuri/scipy,gertingold/scipy,vhaasteren/scipy,mdhaber/scipy,argriffing/scipy,gdooper/scipy,sriki18/scipy,ChanderG/scipy,zerothi/scipy,ilayn/scipy,zaxliu/scipy,befelix/scipy,Gillu13/scipy,matthewalbani/scipy,larsmans/scipy,mhogg/scipy,mtrbean/scipy,aeklant/scipy,Gillu13/scipy,anielsen001/scipy,nonhermitian/scipy,vigna/scipy,trankmichael/scipy,jamestwebber/scipy,Gillu13/scipy,zerothi/scipy,kalvdans/scipy,rmcgibbo/scipy,richardotis/scipy,WarrenWeckesser/scipy,aarchiba/scipy,person142/scipy,woodscn/scipy,pbrod/scipy,efiring/scipy,gef756/scipy,ortylp/scipy,WillieMaddox/scipy,pizzathief/scipy,arokem/scipy,zaxliu/scipy,vanpact/scipy,fredrikw/scipy,ortylp/scipy,Stefan-Endres/scipy,vanpact/scipy,anielsen001/scipy,e-q/scipy,petebachant/scipy,mhogg/scipy,fredrikw/scipy,pschella/scipy,ales-erjavec/scipy,WillieMaddox/scipy,anielsen001/scipy,ndchorley/scipy,ortylp/scipy,vanpact/scipy,ilayn/scipy,anielsen001/scipy,fredrikw/scipy,kalvdans/scipy,sargas/scipy,trankmichael/scipy,jakevdp/scipy,felipebetancur/scipy,Srisai85/scipy,mingwpy/scipy,kalvdans/scipy,behzadnouri/scipy,Gillu13/scipy,Srisai85/scipy,futurulus/scipy,jseabold/scipy,ogrisel/scipy,anntzer/scipy,chatcannon/scipy,hainm/scipy,efiring/scipy,tylerjereddy/scipy,perimosocordiae/scipy,petebachant/scipy,ortylp/scipy,pbrod/scipy,e-q/scipy,nonhermitian/scipy,raoulbq/scipy,andyfaff/scipy,raoulbq/scipy,rgommers/scipy,ChanderG/scipy,gdooper/scipy,minhlongdo/scipy,Eric89GXL/scipy,Kamp9/scipy,petebachant/scipy,woodscn/scipy,Dapid/scipy,argriffing/scipy,futurulus/scipy,scipy/scipy,endolith/scipy,richardotis/scipy,gdooper/scipy,gef756/scipy,perimosocordiae/scipy,nmayorov/scipy,Srisai85/scipy,sonnyhu/scipy,grlee77/scipy,jor-/scipy,vberaudi/scipy,jonycgn/scipy,maciejkula/scipy,pnedunuri/scipy,zaxliu/scipy,fernand/scipy,newemailjdm/scipy,grlee77/scipy,chatcannon/scipy,pizzathief/scipy,matthew-brett/scipy,jamestwebber/scipy,nvoron23/scipy,dch312/scipy,josephcslater/scipy,Newman101/scipy,jonycgn/scipy,jamestwebber/scipy,sriki18/scipy,mortada/scipy,woodscn/scipy,pbrod/scipy,WarrenWeckesser/scipy,woodscn/scipy,argriffing/scipy,ndchorley/scipy,ndchorley/scipy,ogrisel/scipy,josephcslater/scipy,tylerjereddy/scipy,apbard/scipy,bkendzior/scipy,anntzer/scipy,giorgiop/scipy,haudren/scipy,arokem/scipy,jonycgn/scipy,WillieMaddox/scipy,vberaudi/scipy,andim/scipy,niknow/scipy,sauliusl/scipy,dch312/scipy,sriki18/scipy,surhudm/scipy,mdhaber/scipy,zerothi/scipy,teoliphant/scipy,endolith/scipy,behzadnouri/scipy,jsilter/scipy,person142/scipy,scipy/scipy,ndchorley/scipy,larsmans/scipy,person142/scipy,jamestwebber/scipy,jjhelmus/scipy,jseabold/scipy,mtrbean/scipy,lukauskas/scipy,andyfaff/scipy,larsmans/scipy,Dapid/scipy,perimosocordiae/scipy,matthew-brett/scipy,fredrikw/scipy,mikebenfield/scipy,nonhermitian/scipy,ortylp/scipy,gef756/scipy,aman-iitj/scipy,rgommers/scipy,niknow/scipy,jjhelmus/scipy,rmcgibbo/scipy,sauliusl/scipy,Dapid/scipy,efiring/scipy,sargas/scipy,WillieMaddox/scipy,efiring/scipy,nvoron23/scipy,Stefan-Endres/scipy,Stefan-Endres/scipy,efiring/scipy,tylerjereddy/scipy,ChanderG/scipy,josephcslater/scipy,lukauskas/scipy,maciejkula/scipy,anielsen001/scipy,felipebetancur/scipy,mdhaber/scipy,vhaasteren/scipy,tylerjereddy/scipy,giorgiop/scipy,bkendzior/scipy,chatcannon/scipy,Kamp9/scipy,richardotis/scipy,sriki18/scipy,maniteja123/scipy,raoulbq/scipy,piyush0609/scipy,Newman101/scipy,mikebenfield/scipy,ChanderG/scipy,giorgiop/scipy,arokem/scipy,giorgiop/scipy,gdooper/scipy,niknow/scipy,ortylp/scipy,dominicelse/scipy,matthew-brett/scipy,minhlongdo/scipy,zerothi/scipy,Eric89GXL/scipy,mtrbean/scipy,aarchiba/scipy,Shaswat27/scipy,scipy/scipy,hainm/scipy,aman-iitj/scipy,rmcgibbo/scipy,lhilt/scipy,fernand/scipy,gef756/scipy,mingwpy/scipy,maniteja123/scipy,larsmans/scipy,dch312/scipy,sriki18/scipy,Shaswat27/scipy,mortonjt/scipy,pnedunuri/scipy,arokem/scipy,befelix/scipy,jjhelmus/scipy,andyfaff/scipy,nvoron23/scipy,pschella/scipy,Newman101/scipy,FRidh/scipy,nmayorov/scipy,teoliphant/scipy,jakevdp/scipy,pschella/scipy,jseabold/scipy,kleskjr/scipy,Newman101/scipy,mortada/scipy,ndchorley/scipy,ales-erjavec/scipy,ogrisel/scipy,endolith/scipy,jsilter/scipy,gertingold/scipy,Shaswat27/scipy,Newman101/scipy,efiring/scipy,matthewalbani/scipy,minhlongdo/scipy,cpaulik/scipy,rmcgibbo/scipy,mikebenfield/scipy,Shaswat27/scipy,newemailjdm/scipy,piyush0609/scipy,anielsen001/scipy,maniteja123/scipy,vigna/scipy,ChanderG/scipy,josephcslater/scipy,zaxliu/scipy,endolith/scipy,sargas/scipy,bkendzior/scipy,mgaitan/scipy,gdooper/scipy,kalvdans/scipy,zaxliu/scipy,surhudm/scipy,fernand/scipy,arokem/scipy,pizzathief/scipy,aeklant/scipy,kleskjr/scipy,mgaitan/scipy,Shaswat27/scipy,zxsted/scipy,teoliphant/scipy,aarchiba/scipy,trankmichael/scipy,nmayorov/scipy,dch312/scipy,gertingold/scipy,vberaudi/scipy,endolith/scipy,mdhaber/scipy,zxsted/scipy,jjhelmus/scipy,mortonjt/scipy,andim/scipy,jonycgn/scipy,dominicelse/scipy,njwilson23/scipy,pizzathief/scipy,Eric89GXL/scipy,nonhermitian/scipy,mhogg/scipy,FRidh/scipy,vanpact/scipy,WarrenWeckesser/scipy,WarrenWeckesser/scipy,witcxc/scipy,njwilson23/scipy,mortada/scipy,haudren/scipy,jonycgn/scipy,surhudm/scipy,andim/scipy,e-q/scipy,larsmans/scipy,perimosocordiae/scipy,newemailjdm/scipy,scipy/scipy,sonnyhu/scipy,mingwpy/scipy,Srisai85/scipy,niknow/scipy,nonhermitian/scipy,mortonjt/scipy,ndchorley/scipy,jonycgn/scipy,scipy/scipy,WillieMaddox/scipy,Eric89GXL/scipy,jjhelmus/scipy,befelix/scipy
|
9ae82cb0b9b30a8276acf36d7abd6fdaefbdaab8
|
test/CodeGen/preserve-as-comments.c
|
test/CodeGen/preserve-as-comments.c
|
// RUN: %clang_cc1 -S -fno-preserve-as-comments %s -o - | FileCheck %s --check-prefix=NOASM --check-prefix=CHECK
// RUN: %clang_cc1 -S %s -o - | FileCheck %s --check-prefix=ASM --check-prefix=CHECK
// CHECK-LABEL: main
// CHECK: #APP
// ASM: #comment
// NOASM-NOT: #comment
// CHECK: #NO_APP
int main() {
__asm__("/*comment*/");
return 0;
}
|
// RUN: %clang_cc1 -S -triple=x86_64-unknown-unknown -fno-preserve-as-comments %s -o - | FileCheck %s --check-prefix=NOASM --check-prefix=CHECK
// RUN: %clang_cc1 -S %s -triple=x86_64-unknown-unknown -o - | FileCheck %s --check-prefix=ASM --check-prefix=CHECK
// CHECK-LABEL: main
// CHECK: #APP
// ASM: #comment
// NOASM-NOT: #comment
// CHECK: #NO_APP
int main() {
__asm__("/*comment*/");
return 0;
}
|
Add target triple in test
|
Add target triple in test
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@276915 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
|
b3dff4d84df5f1b4b0ad59ac760c32f531321d32
|
test/CodeGen/link-bitcode-file.c
|
test/CodeGen/link-bitcode-file.c
|
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -emit-llvm-bc -o %t.bc %s
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -mlink-bitcode-file %t.bc -O3 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-NO-BC %s
// RUN: not %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -mlink-bitcode-file %t.bc -O3 -emit-llvm -o - %s 2>&1 | FileCheck -check-prefix=CHECK-BC %s
int f(void);
#ifdef BITCODE
// CHECK-BC: 'f': symbol multiply defined
int f(void) {
return 42;
}
#else
// CHECK-NO-BC-LABEL: define i32 @g
// CHECK-NO-BC: ret i32 42
int g(void) {
return f();
}
// CHECK-NO-BC-LABEL: define i32 @f
#endif
|
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -emit-llvm-bc -o %t.bc %s
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -mlink-bitcode-file %t.bc -O3 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-NO-BC %s
// RUN: not %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -mlink-bitcode-file %t.bc -O3 -emit-llvm -o - %s 2>&1 | FileCheck -check-prefix=CHECK-BC %s
int f(void);
#ifdef BITCODE
// CHECK-BC: fatal error: cannot link module {{.*}}'f': symbol multiply defined
int f(void) {
return 42;
}
#else
// CHECK-NO-BC-LABEL: define i32 @g
// CHECK-NO-BC: ret i32 42
int g(void) {
return f();
}
// CHECK-NO-BC-LABEL: define i32 @f
#endif
|
Make this test a bit stricter by checking clang's output too.
|
Make this test a bit stricter by checking clang's output too.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@220604 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/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,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
|
ca910100761ba025d9b7156d1030184a42bdd486
|
test/Analysis/null-deref-path-notes.c
|
test/Analysis/null-deref-path-notes.c
|
// RUN: %clang_analyze_cc1 -w -x c -analyzer-checker=core -analyzer-output=text -verify %s
// Avoid the crash when finding the expression for tracking the origins
// of the null pointer for path notes. Apparently, not much actual tracking
// needs to be done in this example.
void pr34373() {
int *a = 0; // expected-note{{'a' initialized to a null pointer value}}
(a + 0)[0]; // expected-warning{{Array access results in a null pointer dereference}}
// expected-note@-1{{Array access results in a null pointer dereference}}
}
|
// RUN: %clang_analyze_cc1 -w -x c -analyzer-checker=core -analyzer-output=text -verify %s
// Avoid the crash when finding the expression for tracking the origins
// of the null pointer for path notes.
void pr34373() {
int *a = 0; // expected-note{{'a' initialized to a null pointer value}}
(a + 0)[0]; // expected-warning{{Array access results in a null pointer dereference}}
// expected-note@-1{{Array access results in a null pointer dereference}}
}
|
Fix an outdated comment in a test. NFC.
|
[analyzer] Fix an outdated comment in a test. NFC.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@314298 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit a0d7ea7ad167665974775befd200847e5d84dd02)
|
C
|
apache-2.0
|
apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang
|
b35bac92d94f94f957ff680de05f36a0100219c0
|
Classes/EEEOperationCenter.h
|
Classes/EEEOperationCenter.h
|
#import <Foundation/Foundation.h>
#define EEEPrepareBlockSelf() __weak __typeof__(self) __weakSelf = self
#define EEEUseBlockSelf() __typeof__(__weakSelf) __weak blockSelf = __weakSelf
@class EEEInjector;
@class EEEOperation;
@interface EEEOperationCenter : NSObject
@property(nonatomic, strong) NSOperationQueue *mainCommandQueue;
@property(nonatomic, strong) NSOperationQueue *backgroundCommandQueue;
@property NSInteger maxConcurrentOperationCount;
+ (EEEOperationCenter *)currentOperationCenter;
+ (EEEOperationCenter *)setCurrentOperationCenter:(EEEOperationCenter *)defaultCenter;
- (id)initWithInjector:(EEEInjector *)injector;
- (id)queueOperation:(EEEOperation *)operation;
- (id)inlineOperation:(EEEOperation *)operation withTimeout:(NSTimeInterval)seconds;
@end
|
#import <Foundation/Foundation.h>
#define EEEPrepareBlockSelf() __weak __typeof__(self) __weakSelf = self
#define EEEUseBlockSelf() __strong __typeof__(__weakSelf) blockSelf = __weakSelf
@class EEEInjector;
@class EEEOperation;
@interface EEEOperationCenter : NSObject
@property(nonatomic, strong) NSOperationQueue *mainCommandQueue;
@property(nonatomic, strong) NSOperationQueue *backgroundCommandQueue;
@property NSInteger maxConcurrentOperationCount;
+ (EEEOperationCenter *)currentOperationCenter;
+ (EEEOperationCenter *)setCurrentOperationCenter:(EEEOperationCenter *)defaultCenter;
- (id)initWithInjector:(EEEInjector *)injector;
- (id)queueOperation:(EEEOperation *)operation;
- (id)inlineOperation:(EEEOperation *)operation withTimeout:(NSTimeInterval)seconds;
@end
|
Fix the two-step-macro behavior, tests pass
|
Fix the two-step-macro behavior, tests pass
|
C
|
unlicense
|
epologee/EEEOperationCenter,epologee/EEEOperationCenter,epologee/EEEOperationCenter
|
60f44581f2077d3f5a00cad006a2bb1c86d80f2a
|
src/condor_includes/condor_fix_stdio.h
|
src/condor_includes/condor_fix_stdio.h
|
#ifndef FIX_STDIO_H
#define FIX_STDIO_H
#include <stdio.h>
#if defined(__cplusplus)
extern "C" {
#endif
/*
For some reason the stdio.h on OSF1 fails to provide prototypes
for popen() and pclose() if _POSIX_SOURCE is defined.
*/
#if defined(OSF1)
#if defined(__STDC__) || defined(__cplusplus)
FILE *popen( char *, char * );
int pclose( FILE *__stream );
#else
FILE *popen();
int pclose();
#endif
#endif /* OSF1 */
/*
For some reason the stdio.h on Ultrix 4.3 fails to provide a prototype
for pclose() if _POSIX_SOURCE is defined - even though it does
provide a prototype for popen().
*/
#if defined(ULTRIX43)
#if defined(__STDC__) || defined(__cplusplus)
int pclose( FILE *__stream );
#else
int pclose();
#endif
#endif /* ULTRIX43 */
#if defined(__cplusplus)
}
#endif
#endif
|
#ifndef FIX_STDIO_H
#define FIX_STDIO_H
#include <stdio.h>
#if defined(__cplusplus)
extern "C" {
#endif
/*
For some reason the stdio.h on OSF1 fails to provide prototypes
for popen() and pclose() if _POSIX_SOURCE is defined.
*/
#if defined(OSF1)
#if defined(__STDC__) || defined(__cplusplus)
FILE *popen( char *, char * );
int pclose( FILE *__stream );
extern void setbuffer(FILE*, char*, int);
extern void setlinebuf(FILE*);
#else
FILE *popen();
int pclose();
extern void setbuffer();
extern void setlinebuf();
#endif
#endif /* OSF1 */
/*
For some reason the stdio.h on Ultrix 4.3 fails to provide a prototype
for pclose() if _POSIX_SOURCE is defined - even though it does
provide a prototype for popen().
*/
#if defined(ULTRIX43)
#if defined(__STDC__) || defined(__cplusplus)
int pclose( FILE *__stream );
#else
int pclose();
#endif
#endif /* ULTRIX43 */
#if defined(__cplusplus)
}
#endif
#endif
|
Add prototypes for setbuffer() and setlinebuf(). Questionable as these should probably be replaced with ANSI stype setbuf() calls.
|
Add prototypes for setbuffer() and setlinebuf(). Questionable as these
should probably be replaced with ANSI stype setbuf() calls.
|
C
|
apache-2.0
|
djw8605/htcondor,djw8605/condor,mambelli/osg-bosco-marco,htcondor/htcondor,djw8605/condor,clalancette/condor-dcloud,htcondor/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,neurodebian/htcondor,htcondor/htcondor,djw8605/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,htcondor/htcondor,bbockelm/condor-network-accounting,djw8605/condor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,htcondor/htcondor,htcondor/htcondor,djw8605/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,zhangzhehust/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,zhangzhehust/htcondor,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,zhangzhehust/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,clalancette/condor-dcloud,zhangzhehust/htcondor,djw8605/condor,neurodebian/htcondor,djw8605/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,neurodebian/htcondor,djw8605/condor,djw8605/htcondor,djw8605/condor,zhangzhehust/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,htcondor/htcondor,mambelli/osg-bosco-marco,neurodebian/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,djw8605/condor,clalancette/condor-dcloud,djw8605/condor,neurodebian/htcondor
|
5ca658382bf487b2da30a83a3449e16de8e98c36
|
examples/test.c
|
examples/test.c
|
#include <stdio.h>
#include <string.h>
#include "../src/mlist.h"
int main (int argc, char *argv[]) {
mlist_t *list;
int *n;
char *c;
char *s = NULL;
const char *name = "cubicdaiya";
list = mlist_create();
n = mlist_palloc(list, sizeof(int));
list = mlist_extend(list);
c = mlist_palloc(list, sizeof(char));
list = mlist_extend(list);
s = mlist_palloc(list, strlen(name) + 1);
list = mlist_extend(list);
*n = 5;
*c = 'a';
strncpy(s, name, strlen(name) + 1);
printf("n = %d\n", *n);
printf("c = %c\n", *c);
printf("name = %s\n", s);
mlist_destroy(list);
return 0;
}
|
#include <stdio.h>
#include <string.h>
#include "mlist.h"
int main (int argc, char *argv[]) {
mlist_t *list;
int *n;
char *c;
char *s = NULL;
const char *name = "cubicdaiya";
list = mlist_create();
n = mlist_palloc(list, sizeof(int));
list = mlist_extend(list);
c = mlist_palloc(list, sizeof(char));
list = mlist_extend(list);
s = mlist_palloc(list, strlen(name) + 1);
list = mlist_extend(list);
*n = 5;
*c = 'a';
strncpy(s, name, strlen(name) + 1);
printf("n = %d\n", *n);
printf("c = %c\n", *c);
printf("name = %s\n", s);
mlist_destroy(list);
return 0;
}
|
Revert "mv example source code"
|
Revert "mv example source code"
This reverts commit 7f0d00f7ff862b812cdf427dc717dee6b02ac84b.
|
C
|
bsd-3-clause
|
cubicdaiya/mlist
|
56e734d78f593b0da4fce749ead8c841e3453ba8
|
Source/DHScatterGraph.h
|
Source/DHScatterGraph.h
|
// Douglas Hill, May 2015
// https://github.com/douglashill/DHScatterGraph
#import <DHScatterGraph/DHScatterGraphLineAttributes.h>
#import <DHScatterGraph/DHScatterGraphPointSet.h>
#import <DHScatterGraph/DHScatterGraphView.h>
|
// Douglas Hill, May 2015
// https://github.com/douglashill/DHScatterGraph
extern double const DHScatterGraphVersionNumber;
extern unsigned char const DHScatterGraphVersionString[];
#import <DHScatterGraph/DHScatterGraphLineAttributes.h>
#import <DHScatterGraph/DHScatterGraphPointSet.h>
#import <DHScatterGraph/DHScatterGraphView.h>
|
Add framework version info to umbrella header
|
Add framework version info to umbrella header
The values of these constants are provided by Xcode’s automatically generated DerivedSources/DHScatterGraph_vers.c.
|
C
|
mit
|
douglashill/DHScatterGraph
|
70705c03128c4cf0594a1dcf91a62a91b8b566e2
|
lib/libc/gen/semctl.c
|
lib/libc/gen/semctl.c
|
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <stdarg.h>
#include <stdlib.h>
int semctl(int semid, int semnum, int cmd, ...)
{
va_list ap;
union semun semun;
union semun *semun_ptr;
va_start(ap, cmd);
if (cmd == IPC_SET || cmd == IPC_STAT || cmd == GETALL
|| cmd == SETVAL || cmd == SETALL) {
semun = va_arg(ap, union semun);
semun_ptr = &semun;
} else {
semun_ptr = NULL;
}
va_end(ap);
return (__semctl(semid, semnum, cmd, semun_ptr));
}
|
/*-
* Copyright (c) 2002 Doug Rabson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <stdarg.h>
#include <stdlib.h>
int semctl(int semid, int semnum, int cmd, ...)
{
va_list ap;
union semun semun;
union semun *semun_ptr;
va_start(ap, cmd);
if (cmd == IPC_SET || cmd == IPC_STAT || cmd == GETALL
|| cmd == SETVAL || cmd == SETALL) {
semun = va_arg(ap, union semun);
semun_ptr = &semun;
} else {
semun_ptr = NULL;
}
va_end(ap);
return (__semctl(semid, semnum, cmd, semun_ptr));
}
|
Add a missing copyright for Doug. There are other files missing this copyright in -stable.
|
Add a missing copyright for Doug. There are other files missing this
copyright in -stable.
PR: 41397
Submitted by: dfr
|
C
|
bsd-3-clause
|
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.