Patch by Vasilis Kaoutsis: Style and copyright header cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22671 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,19 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, OpenBeOS Project.
|
* Copyright 2002-2007, Haiku Inc. All rights reserved.
|
||||||
* All rights reserved.
|
* Distributed under the terms of the MIT License.
|
||||||
* Distributed under the terms of the OpenBeOS license.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* localeconv.c:
|
|
||||||
* defines the structure containing the current locale
|
|
||||||
* and the single access function 'localeconv()'
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Author(s):
|
|
||||||
* Daniel Reinhold ([email protected])
|
|
||||||
*
|
*
|
||||||
|
* Author:
|
||||||
|
* Daniel Reinhold, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
@@ -48,10 +41,9 @@ struct lconv _Locale = {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct lconv *
|
struct lconv*
|
||||||
localeconv(void)
|
localeconv(void)
|
||||||
{
|
{
|
||||||
// return pointer to the current locale
|
// return pointer to the current locale
|
||||||
return &_Locale;
|
return &_Locale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2007, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2002-2007, Axel Dörfler, [email protected]. All rights reserved.
|
||||||
* Distributed under the terms of the OpenBeOS License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, OpenBeOS Project.
|
* Copyright 2002-2007, Haiku Inc. All rights reserved.
|
||||||
* All rights reserved.
|
* Distributed under the terms of the MIT License.
|
||||||
* Distributed under the terms of the OpenBeOS license.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* abs.c:
|
|
||||||
* implements the standard C library functions:
|
|
||||||
* abs, labs, llabs
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Author(s):
|
|
||||||
* Daniel Reinhold ([email protected])
|
|
||||||
*
|
*
|
||||||
|
* Author:
|
||||||
|
* Daniel Reinhold, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -36,4 +29,3 @@ llabs(long long i)
|
|||||||
{
|
{
|
||||||
return (i < 0) ? -i : i;
|
return (i < 0) ? -i : i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,26 +1,17 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, OpenBeOS Project.
|
* Copyright 2002-2007, Haiku Inc. All rights reserved.
|
||||||
* All rights reserved.
|
* Distributed under the terms of the MIT License.
|
||||||
* Distributed under the terms of the OpenBeOS license.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* atof.c:
|
|
||||||
* implements the standard C library function atof()
|
|
||||||
* (merely a wrapper for strtod(), actually)
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Author(s):
|
|
||||||
* Daniel Reinhold ([email protected])
|
|
||||||
*
|
*
|
||||||
|
* Author:
|
||||||
|
* Daniel Reinhold, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
double
|
double
|
||||||
atof(const char *num)
|
atof(const char* num)
|
||||||
{
|
{
|
||||||
return strtod(num, NULL);
|
return strtod(num, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,54 +1,45 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, OpenBeOS Project.
|
* Copyright 2002-2007, Haiku Inc. All rights reserved.
|
||||||
* All rights reserved.
|
* Distributed under the terms of the MIT License.
|
||||||
* Distributed under the terms of the OpenBeOS license.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* atoi.c:
|
|
||||||
* implements the standard C library functions:
|
|
||||||
* atoi, atoui, atol, atoul, atoll
|
|
||||||
* (these are all just wrappers around calls to the strto[u]l[l] functions)
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Author(s):
|
|
||||||
* Daniel Reinhold ([email protected])
|
|
||||||
*
|
*
|
||||||
|
* Author:
|
||||||
|
* Daniel Reinhold, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
atoi(const char *num)
|
atoi(const char* num)
|
||||||
{
|
{
|
||||||
return (int) strtol(num, NULL, 10);
|
return (int) strtol(num, NULL, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
atoui(const char *num)
|
atoui(const char* num)
|
||||||
{
|
{
|
||||||
return (unsigned int) strtoul(num, NULL, 10);
|
return (unsigned int) strtoul(num, NULL, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
long
|
long
|
||||||
atol(const char *num)
|
atol(const char* num)
|
||||||
{
|
{
|
||||||
return strtol(num, NULL, 10);
|
return strtol(num, NULL, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned long
|
unsigned long
|
||||||
atoul(const char *num)
|
atoul(const char* num)
|
||||||
{
|
{
|
||||||
return strtoul(num, NULL, 10);
|
return strtoul(num, NULL, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
long long int
|
long long int
|
||||||
atoll(const char *num)
|
atoll(const char* num)
|
||||||
{
|
{
|
||||||
return strtoll(num, NULL, 10);
|
return strtoll(num, NULL, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, OpenBeOS Project.
|
* Copyright 2002-2007, Haiku Inc. All rights reserved.
|
||||||
* All rights reserved.
|
* Distributed under the terms of the MIT License.
|
||||||
* Distributed under the terms of the OpenBeOS license.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* div.c:
|
|
||||||
* implements the standard C library functions:
|
|
||||||
* div, ldiv
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Author(s):
|
|
||||||
* Daniel Reinhold ([email protected])
|
|
||||||
*
|
*
|
||||||
|
* Author:
|
||||||
|
* Daniel Reinhold, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -25,7 +18,7 @@ div(int numerator, int denominator)
|
|||||||
val.quot = numerator / denominator;
|
val.quot = numerator / denominator;
|
||||||
val.rem = numerator - denominator * val.quot;
|
val.rem = numerator - denominator * val.quot;
|
||||||
|
|
||||||
if ((val.rem > 0) && (val.quot < 0)) {
|
if (val.rem > 0 && val.quot < 0) {
|
||||||
val.rem -= denominator;
|
val.rem -= denominator;
|
||||||
++val.quot;
|
++val.quot;
|
||||||
}
|
}
|
||||||
@@ -42,11 +35,10 @@ ldiv(long numerator, long denominator)
|
|||||||
val.quot = numerator / denominator;
|
val.quot = numerator / denominator;
|
||||||
val.rem = numerator - denominator * val.quot;
|
val.rem = numerator - denominator * val.quot;
|
||||||
|
|
||||||
if ((val.rem > 0) && (val.quot < 0)) {
|
if (val.rem > 0 && val.quot < 0) {
|
||||||
val.rem -= denominator;
|
val.rem -= denominator;
|
||||||
++val.quot;
|
++val.quot;
|
||||||
}
|
}
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user