repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merged revisions 208012,208018-208019,208021,208023-208030,208033,208037,208040-20804...
[official-gcc.git]
/
main
/
gcc
/
testsuite
/
gfortran.dg
/
lto
/
pr60635_1.c
blob
eddc569e6504a308b148ae9a6e4f770d6c5c0caa
1
#include <stdint.h>
2
#include <stdbool.h>
3
4
static bool
littleendian
=
true
;
5
6
uint16_t
bigendc16
(
union
{
uint16_t
*
n
;
uint8_t
*
b
;}
x
){
7
8
if
(!
littleendian
)
return
*
x
.
n
;
9
10
uint16_t
res
= ((
uint16_t
)(
x
.
b
[
1
])<<
0
) |
11
((
uint16_t
)(
x
.
b
[
0
])<<
8
);
12
return
res
;
13
}
14