Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a43bab0a
Commit
a43bab0a
authored
Apr 01, 2009
by
Timothy Smith
Browse files
Options
Browse Files
Download
Plain Diff
merge -5.0 into -5.1 (minor conflicts resolved)
parents
f6750069
b70852c2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
35 deletions
+36
-35
cmd-line-utils/libedit/readline/readline.h
cmd-line-utils/libedit/readline/readline.h
+1
-1
include/my_global.h
include/my_global.h
+35
-34
No files found.
cmd-line-utils/libedit/readline/readline.h
View file @
a43bab0a
...
@@ -66,7 +66,7 @@ typedef KEYMAP_ENTRY *Keymap;
...
@@ -66,7 +66,7 @@ typedef KEYMAP_ENTRY *Keymap;
#ifndef CTRL
#ifndef CTRL
#include <sys/ioctl.h>
#include <sys/ioctl.h>
#if !defined(__sun) && !defined(__hpux) && !defined(_AIX)
#if !defined(__sun) && !defined(__hpux) && !defined(_AIX)
&& !defined(__QNXNTO__) && !defined(__USLC__)
#include <sys/ttydefaults.h>
#include <sys/ttydefaults.h>
#endif
#endif
#ifndef CTRL
#ifndef CTRL
...
...
include/my_global.h
View file @
a43bab0a
...
@@ -580,40 +580,6 @@ typedef unsigned short ushort;
...
@@ -580,40 +580,6 @@ typedef unsigned short ushort;
#define test_all_bits(a,b) (((a) & (b)) == (b))
#define test_all_bits(a,b) (((a) & (b)) == (b))
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
#ifndef HAVE_RINT
/**
All integers up to this number can be represented exactly as double precision
values (DBL_MANT_DIG == 53 for IEEE 754 hardware).
*/
#define MAX_EXACT_INTEGER ((1LL << DBL_MANT_DIG) - 1)
/**
rint(3) implementation for platforms that do not have it.
Always rounds to the nearest integer with ties being rounded to the nearest
even integer to mimic glibc's rint() behavior in the "round-to-nearest"
FPU mode. Hardware-specific optimizations are possible (frndint on x86).
Unlike this implementation, hardware will also honor the FPU rounding mode.
*/
static
inline
double
rint
(
double
x
)
{
double
f
,
i
;
f
=
modf
(
x
,
&
i
);
/*
All doubles with absolute values > MAX_EXACT_INTEGER are even anyway,
no need to check it.
*/
if
(
x
>
0
.
0
)
i
+=
(
double
)
((
f
>
0
.
5
)
||
(
f
==
0
.
5
&&
i
<=
(
double
)
MAX_EXACT_INTEGER
&&
(
longlong
)
i
%
2
));
else
i
-=
(
double
)
((
f
<
-
0
.
5
)
||
(
f
==
-
0
.
5
&&
i
>=
(
double
)
-
MAX_EXACT_INTEGER
&&
(
longlong
)
i
%
2
));
return
i
;
}
#endif
/* HAVE_RINT */
/* Define some general constants */
/* Define some general constants */
#ifndef TRUE
#ifndef TRUE
...
@@ -1572,4 +1538,39 @@ inline void operator delete[](void*, void*) { /* Do nothing */ }
...
@@ -1572,4 +1538,39 @@ inline void operator delete[](void*, void*) { /* Do nothing */ }
#define bool In_C_you_should_use_my_bool_instead()
#define bool In_C_you_should_use_my_bool_instead()
#endif
#endif
#ifndef HAVE_RINT
/**
All integers up to this number can be represented exactly as double precision
values (DBL_MANT_DIG == 53 for IEEE 754 hardware).
*/
#define MAX_EXACT_INTEGER ((1LL << DBL_MANT_DIG) - 1)
/**
rint(3) implementation for platforms that do not have it.
Always rounds to the nearest integer with ties being rounded to the nearest
even integer to mimic glibc's rint() behavior in the "round-to-nearest"
FPU mode. Hardware-specific optimizations are possible (frndint on x86).
Unlike this implementation, hardware will also honor the FPU rounding mode.
*/
static
inline
double
rint
(
double
x
)
{
double
f
,
i
;
f
=
modf
(
x
,
&
i
);
/*
All doubles with absolute values > MAX_EXACT_INTEGER are even anyway,
no need to check it.
*/
if
(
x
>
0
.
0
)
i
+=
(
double
)
((
f
>
0
.
5
)
||
(
f
==
0
.
5
&&
i
<=
(
double
)
MAX_EXACT_INTEGER
&&
(
longlong
)
i
%
2
));
else
i
-=
(
double
)
((
f
<
-
0
.
5
)
||
(
f
==
-
0
.
5
&&
i
>=
(
double
)
-
MAX_EXACT_INTEGER
&&
(
longlong
)
i
%
2
));
return
i
;
}
#endif
/* HAVE_RINT */
#endif
/* my_global_h */
#endif
/* my_global_h */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment